[issue19483] Allow more low-level parser configuration in ElementTree

2020-09-07 Thread Stefan Behnel
Stefan Behnel added the comment: Changing subject to make it clear what this ticket is really about. -- title: Pure-Python ElementTree classes no longer available since 3.3 -> Allow more low-level parser configuration in ElementTree versions: +Python 3.10 -Python 3.3, Python

[issue20198] xml.etree.ElementTree.ElementTree.write attribute sorting

2020-09-07 Thread Stefan Behnel
Change by Stefan Behnel : -- resolution: -> duplicate stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue20198> ___ ___

[issue41756] Do not always use exceptions to return result from coroutine

2020-09-11 Thread Stefan Behnel
Stefan Behnel added the comment: Big +1 from me, too, for the same reasons Yury gave. -- nosy: +scoder ___ Python tracker <https://bugs.python.org/issue41

[issue41756] Do not always use exceptions to return result from coroutine

2020-09-11 Thread Stefan Behnel
Stefan Behnel added the comment: Copying some of the design discussion from the PR here (https://github.com/python/cpython/pull/22196/files#r486730457), because it belongs into the ticket. Yury Selivanov proposed to add a new C-API function for this (naming changes by me): typedef

[issue41756] Do not always use exceptions to return result from coroutine

2020-09-16 Thread Stefan Behnel
Stefan Behnel added the comment: I'm happy to see this moving forward. Not convinved of the "PyIter_Send()" name, though. I don't consider this part of the iterator protocol. It's specific to generators and coroutines. Cython would probably guard its usage b

[issue41756] Do not always use exceptions to return result from coroutine

2020-09-18 Thread Stefan Behnel
Stefan Behnel added the comment: I would also have preferred a more type specific function, but yeah, as long as the types for which the function would normally be used are special cased early enough in the implementation, it makes no big difference. Fine with me, too

[issue41756] Do not always use exceptions to return result from coroutine

2020-09-18 Thread Stefan Behnel
Stefan Behnel added the comment: BTW, just to give this a house number, I remember having measured a performance improvement of up to 70% at some point when switching from "generators always raise a StopIteration at the end" to "generators just return NULL" in Cython

[issue39960] Using typename.__setattr__ in extension type with Py_TPFLAGS_HEAPTYPE is broken (hackcheck too eager?)

2020-09-20 Thread Stefan Behnel
Stefan Behnel added the comment: Closing again since GH-21528 has been merged in issue 41295. -- status: open -> closed ___ Python tracker <https://bugs.python.org/issu

[issue38225] iscoroutinefunction broken with cython - allow tagging of functions as async?

2020-09-22 Thread Stefan Behnel
Stefan Behnel added the comment: FYI, https://github.com/cython/cython/pull/3427 has been merged into Cython. In Cython 3.0, compiled coroutines will disguise as non-compiled coroutines, from the PoV of asyncio. Restricting this ticket to Py3.10 since we're rather discussing a new fe

[issue41295] CPython 3.8.4 regression on __setattr__ in multiinheritance with metaclasses

2020-09-29 Thread Stefan Behnel
Change by Stefan Behnel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-09-30 Thread Stefan Behnel
Stefan Behnel added the comment: > That example is especially problematic. No, it's not. It uses .findall(), which returns a list. It's like when you make a copy of a list to iterate over, when you want to modify the original list in the loop. That could be made explicit in

[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-09-30 Thread Stefan Behnel
Change by Stefan Behnel : -- keywords: +patch pull_requests: +21489 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22464 ___ Python tracker <https://bugs.python.org/issu

[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-09-30 Thread Stefan Behnel
Change by Stefan Behnel : -- stage: -> patch review ___ Python tracker <https://bugs.python.org/issue41892> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-09-30 Thread Stefan Behnel
Stefan Behnel added the comment: @WoodyWoo, you can (and should) do something like this: for ELEMchild in list(etroot): Modifying a container while iterating over it is usually not a good idea. The same applies to Python lists and dicts, for example. -- stage: patch review

[issue41899] Poor example for Element.remove()

2020-10-01 Thread Stefan Behnel
Stefan Behnel added the comment: Closing as duplicate of issue 41892. Let's keep the discussion there. -- ___ Python tracker <https://bugs.python.org/is

[issue41899] Poor example for Element.remove()

2020-10-01 Thread Stefan Behnel
Change by Stefan Behnel : -- Removed message: https://bugs.python.org/msg377740 ___ Python tracker <https://bugs.python.org/issue41899> ___ ___ Python-bugs-list m

[issue41899] Poor example for Element.remove()

2020-10-01 Thread Stefan Behnel
Stefan Behnel added the comment: Closing as duplicate of issue 41891. Let's keep the discussion there. -- nosy: +scoder resolution: -> duplicate stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.pyth

[issue31256] xml.etree.ElementTree: add support for doctype in tostring method

2020-10-01 Thread Stefan Behnel
Stefan Behnel added the comment: Yes, it fixed already. Thanks! -- nosy: +scoder resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue41900] XML C14N serialisation fails with default namespace

2020-10-01 Thread Stefan Behnel
New submission from Stefan Behnel : import xml.etree.ElementTree as ET xml=""" http://soap.sforce.com/2006/04/metadata";> """ print(ET.canonicalize(xml)) Fails with: ValueError: Namespace "" is not declared in scope when trying to build t

[issue41900] XML C14N serialisation fails with default namespace

2020-10-01 Thread Stefan Behnel
Change by Stefan Behnel : -- keywords: +patch pull_requests: +21493 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/22474 ___ Python tracker <https://bugs.python.org/issu

[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-10-02 Thread Stefan Behnel
Change by Stefan Behnel : -- versions: +Python 3.10, Python 3.9 ___ Python tracker <https://bugs.python.org/issue41892> ___ ___ Python-bugs-list mailin

[issue41900] XML C14N serialisation fails with default namespace

2020-10-02 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset 6a412c94b6b68e7e3632562dc7358a12ffd1447f by scoder in branch 'master': bpo-41900: C14N 2.0 serialisation failed for unprefixed attributes when a default namespace was defined. (GH-22474) https://github.com/python/cpyt

[issue41900] XML C14N serialisation fails with default namespace

2020-10-02 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset a0f2b664335eb689abdecc677e09a193f503af59 by Miss Skeleton (bot) in branch '3.9': bpo-41900: C14N 2.0 serialisation failed for unprefixed attributes when a default namespace was defined. (GH-22474) (GH-22507) https://github.com/pyth

[issue41900] XML C14N serialisation fails with default namespace

2020-10-02 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset cfed5343331350c5737b464970a31f7588319e8b by Miss Skeleton (bot) in branch '3.8': bpo-41900: C14N 2.0 serialisation failed for unprefixed attributes when a default namespace was defined. (GH-22474) (GH-22508) https://github.com/pyth

[issue41900] XML C14N serialisation fails with default namespace

2020-10-02 Thread Stefan Behnel
Change by Stefan Behnel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue6721] Locks in the standard library should be sanitized on fork

2020-10-02 Thread Stefan Behnel
Change by Stefan Behnel : -- nosy: +scoder nosy_count: 29.0 -> 30.0 pull_requests: +21519 pull_request: https://github.com/python/cpython/pull/22474 ___ Python tracker <https://bugs.python.org/iss

[issue33802] Regression in logging configuration

2020-10-02 Thread Stefan Behnel
Change by Stefan Behnel : -- nosy: +scoder nosy_count: 9.0 -> 10.0 pull_requests: +21521 pull_request: https://github.com/python/cpython/pull/22474 ___ Python tracker <https://bugs.python.org/issu

[issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential)

2020-10-02 Thread Stefan Behnel
Change by Stefan Behnel : -- nosy: +scoder nosy_count: 9.0 -> 10.0 pull_requests: +21520 pull_request: https://github.com/python/cpython/pull/22474 ___ Python tracker <https://bugs.python.org/issu

[issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential)

2020-10-03 Thread Stefan Behnel
Change by Stefan Behnel : -- pull_requests: -21520 ___ Python tracker <https://bugs.python.org/issue36533> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue6721] Locks in the standard library should be sanitized on fork

2020-10-03 Thread Stefan Behnel
Change by Stefan Behnel : -- pull_requests: -21519 ___ Python tracker <https://bugs.python.org/issue6721> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36533] logging regression with threading + fork are mixed in 3.7.1rc2 (deadlock potential)

2020-10-03 Thread Stefan Behnel
Change by Stefan Behnel : -- nosy: -scoder ___ Python tracker <https://bugs.python.org/issue36533> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33802] Regression in logging configuration

2020-10-03 Thread Stefan Behnel
Change by Stefan Behnel : -- pull_requests: -21521 ___ Python tracker <https://bugs.python.org/issue33802> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue6721] Locks in the standard library should be sanitized on fork

2020-10-03 Thread Stefan Behnel
Change by Stefan Behnel : -- nosy: -scoder ___ Python tracker <https://bugs.python.org/issue6721> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33802] Regression in logging configuration

2020-10-03 Thread Stefan Behnel
Change by Stefan Behnel : -- nosy: -scoder ___ Python tracker <https://bugs.python.org/issue33802> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-10-04 Thread Stefan Behnel
Change by Stefan Behnel : -- pull_requests: +21547 pull_request: https://github.com/python/cpython/pull/22546 ___ Python tracker <https://bugs.python.org/issue41

[issue41892] use both "for in" and "ElementTree.remove" has a index bug

2020-10-04 Thread Stefan Behnel
Stefan Behnel added the comment: Closing since this works as designed. Users are responsible for avoiding concurrent tree modifications during iteration. -- resolution: -> not a bug stage: patch review -> resolved status: open -&g

[issue41756] Do not always use exceptions to return result from coroutine

2020-10-11 Thread Stefan Behnel
Stefan Behnel added the comment: > Don't forget to remove PyGen_Send() That's the function that allows sending data into a generator. It's also used internally by "PyIter_Send()". Are you really suggesting to remove it, or to make it underscore-priv

[issue42151] Pure Python xml.etree.ElementTree is missing default attribute values

2020-10-26 Thread Stefan Behnel
Stefan Behnel added the comment: The patch looks right. I'm not sure if this can still be changed in Py3.8, though, since that has been around for quite a while now. Admittedly, few people will disable the C accelerator module and thus whitness this issue, but for them, this is a bre

[issue42151] Pure Python xml.etree.ElementTree is missing default attribute values

2020-10-28 Thread Stefan Behnel
Stefan Behnel added the comment: In general, since the C accelerator is enabled by default, and few people would consider disabling it explicitly, I generally consider the behaviour of the C implementation to be "right", if both implementations differ. As a single data point, the

[issue40624] add support for != (not-equals) in ElementTree XPath

2020-11-08 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset 97e8b1eaeaf3aa325c84ff2e13417c30414d0269 by Ammar Askar in branch 'master': bpo-40624: Add support for the XPath != operator in xml.etree (GH-22147) https://github.com/python/cpython/commit/97e8b1eaeaf3aa325c84ff2e13417c

[issue40624] add support for != (not-equals) in ElementTree XPath

2020-11-08 Thread Stefan Behnel
Change by Stefan Behnel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue13988] Expose the C implementation of ElementTree by default when importing ElementTree

2012-02-10 Thread Stefan Behnel
Stefan Behnel added the comment: Eli Bendersky, 10.02.2012 15:52: > * The current contents of xml/etree/ElementTree.py will move to > xml/etree/pyElementTree.py IIRC, there is a well specified way how accelerator modules should be used by Python modules. I recall a lengthy discuss

[issue13988] Expose the C implementation of ElementTree by default when importing ElementTree

2012-02-10 Thread Stefan Behnel
Stefan Behnel added the comment: Eli Bendersky, 10.02.2012 16:43: >>> I don't see a compelling enough reason to break imports in existing code by >>> removing the cElementTree module, so we should not do that. > > Agreed. Perhaps it should just be deprecated? Giv

[issue13988] Expose the C implementation of ElementTree by default when importing ElementTree

2012-02-11 Thread Stefan Behnel
Stefan Behnel added the comment: Eli Bendersky, 11.02.2012 09:08: > The more I think about it, the more the bootstrap code in _elementtree.c > annoys me. It's the only instance of calling PyRun_String in Modules/ ! > > It's hackish and causes ugly import problems. If t

[issue14006] Improve the documentation of xml.etree.ElementTree

2012-02-14 Thread Stefan Behnel
Stefan Behnel added the comment: Both lxml and ElementTree have tutorials: http://effbot.org/zone/element.htm http://lxml.de/tutorial.html Here is another tutorial that may server as a source for an intro: http://infohost.nmt.edu/tcc/help/pubs/pylxml/web/index.html And the general ET

[issue14006] Improve the documentation of xml.etree.ElementTree

2012-02-14 Thread Stefan Behnel
Stefan Behnel added the comment: Oh, and here are the ReST sources of the lxml docs: https://github.com/lxml/lxml/tree/master/doc/ Specifically the tutorial: https://raw.github.com/lxml/lxml/master/doc/tutorial.txt and the parsing part: https://raw.github.com/lxml/lxml/master/doc

[issue14098] provide public C-API for reading/setting sys.exc_info()

2012-02-22 Thread Stefan Behnel
New submission from Stefan Behnel : Following up on recent mailing list threads on pypy-dev and python-dev, this is a request for adding a public C-API to read and write the sys.exc_info() fields, currently stored in tstate->exc_*. While not of major interest for CPython itself, this C-

[issue14098] provide public C-API for reading/setting sys.exc_info()

2012-02-23 Thread Stefan Behnel
Stefan Behnel added the comment: I wonder if these functions should have an error return value, i.e. return -1 on failure. They'd "never" fail in CPython, but other implementations may want to report failures, in case their internal implementation is more involved. OTOH, d

[issue14098] provide public C-API for reading/setting sys.exc_info()

2012-02-23 Thread Stefan Behnel
Stefan Behnel added the comment: Writing up a test case, I noticed that it makes sense to let PyErr_SetExcInfo() steal the references. This matches the main use case of saving and restoring the fields. For the getter, it's still best to return new references in order to support the use

[issue14098] provide public C-API for reading/setting sys.exc_info()

2012-02-23 Thread Stefan Behnel
Changes by Stefan Behnel : -- keywords: +patch Added file: http://bugs.python.org/file24613/exc_info_capi.patch ___ Python tracker <http://bugs.python.org/issue14

[issue14121] add a convenience C-API function for unpacking iterables

2012-02-25 Thread Stefan Behnel
New submission from Stefan Behnel : In the context of better interfacing of PyPy with Cython, it appears that simple looking things like PyTuple_GET_ITEM() are often rather involved in PyPy's C-API implementation. However, since functions/macros like these are used very frequently, thi

[issue14128] _elementtree should expose types and factory functions consistently with ElementTree

2012-02-26 Thread Stefan Behnel
Stefan Behnel added the comment: Note that Element is also a factory function in lxml.etree, and people have been living with this quite happily. I don't see a reason to change either side. There is a dedicated function iselement(obj) for exactly the purpose of testing if something

[issue14128] _elementtree should expose types and factory functions consistently with ElementTree

2012-02-26 Thread Stefan Behnel
Stefan Behnel added the comment: For the record, the relevant mailing list discussion can be found here: http://thread.gmane.org/gmane.comp.python.devel/129429/focus=129794 -- ___ Python tracker <http://bugs.python.org/issue14

[issue14172] ref-counting leak in buffer usage in Python/marshal.c

2012-03-02 Thread Stefan Behnel
New submission from Stefan Behnel : Line 428 in Python/marshal.c calls pb->bf_releasebuffer() without dec-refing the view.obj field afterwards. I don't think this is really so truly performance critical that it can't accept the couple of nanoseconds that it takes

[issue11379] Remove "lightweight" from minidom description

2012-03-02 Thread Stefan Behnel
Stefan Behnel added the comment: Thanks Eli. What about the "Lightweight DOM implementation", though? Following Martin's comment that performance characteristics (like "fast", "memory friendly" or "lightweight") should normally not be documente

[issue11379] Remove "lightweight" from minidom description

2012-03-02 Thread Stefan Behnel
Stefan Behnel added the comment: Yes, I think that's better. -- ___ Python tracker <http://bugs.python.org/issue11379> ___ ___ Python-bugs-list mailing list

[issue14178] Failing tests for ElementTree

2012-03-02 Thread Stefan Behnel
New submission from Stefan Behnel : These are tests from lxml's ET compatibility test suite that now fail in ElementTree: def test_delslice_step(self): Element = self.etree.Element SubElement = self.etree.SubElement a = Element('a') b = S

[issue13797] Allow objects implemented in pure Python to export PEP 3118 buffers

2012-03-03 Thread Stefan Behnel
Stefan Behnel added the comment: FWIW, Cython lets user code implement the buffer interface for extension types using the special methods "__getbuffer__()" and "__releasebuffer__()", so providing the same methods (although with a different signature) also for normal Pyt

[issue14098] provide public C-API for reading/setting sys.exc_info()

2012-03-05 Thread Stefan Behnel
Changes by Stefan Behnel : Added file: http://bugs.python.org/file24734/pyerr_getexcinfo.patch ___ Python tracker <http://bugs.python.org/issue14098> ___ ___ Python-bug

[issue14181] Support getbuffer redirection scheme in memoryview

2012-03-05 Thread Stefan Behnel
Stefan Behnel added the comment: Then I'm abusing this ticket to say: thanks for verifying this. -- ___ Python tracker <http://bugs.python.org/is

[issue14181] Support getbuffer redirection scheme in memoryview

2012-03-06 Thread Stefan Behnel
Stefan Behnel added the comment: Yes, I think this is much clearer. -- ___ Python tracker <http://bugs.python.org/issue14181> ___ ___ Python-bugs-list mailin

[issue14220] "yield from" kills generator on re-entry

2012-03-07 Thread Stefan Behnel
New submission from Stefan Behnel : Based on the existing "test_attempted_yield_from_loop" in Lib/test/test_pep380.py, I wrote this test and I wonder why it does not work: """ def test_attempted_reentry(): """ >>> for line in test_

[issue11379] Remove "lightweight" from minidom description

2012-03-07 Thread Stefan Behnel
Stefan Behnel added the comment: Oh, right, I missed that part. I also think that a visible note is better. And +1 for "W3C DOM interface". -- ___ Python tracker <http://bugs.python.o

[issue14220] "yield from" kills generator on re-entry

2012-03-07 Thread Stefan Behnel
Stefan Behnel added the comment: Here is an analysis of this (less verbose) code: def g1(): yield "y1" yield from g2() yield "y4" def g2(): yield "y2" try: yield from gi except ValueError:

[issue14220] "yield from" kills generator on re-entry

2012-03-07 Thread Stefan Behnel
Stefan Behnel added the comment: Ah, yes, that should work in both implementations. I'll give it a try. Thanks! -- resolution: fixed -> status: closed -> open ___ Python tracker <http://bugs.python.

[issue14246] Accelerated ETree XMLParser cannot handle io.StringIO

2012-03-13 Thread Stefan Behnel
Stefan Behnel added the comment: FWIW, lxml also has support for parsing Unicode strings. It doesn't encode the input, however, but parses straight from the underlying buffer (after detecting the buffer layout etc. at module init time - and yes, I still haven't fixed this up

[issue13797] Allow objects implemented in pure Python to export PEP 3118 buffers

2012-03-20 Thread Stefan Behnel
Stefan Behnel added the comment: Ok, just for the record: a single __buffer__() special method with delegation-only semantics would also work for Cython. Taking this path would provide a cleaner separation of the (then delegation-only) Python level protocol and the (all purpose) C level

[issue14098] provide public C-API for reading/setting sys.exc_info()

2012-04-01 Thread Stefan Behnel
Stefan Behnel added the comment: This is now implemented in PyPy: https://bitbucket.org/pypy/pypy/changeset/623bcea85df3 Are there any objections to applying the equivalent patch to CPython? -- ___ Python tracker <http://bugs.python.

[issue13897] Move fields relevant to sys.exc_info out of frame into generator/threadstate

2012-04-09 Thread Stefan Behnel
Stefan Behnel added the comment: FWIW, Cython keeps the exception state in the generator struct and that works nicely. Note that Amaury is right in that extensions use tstate->exc_value and friends. Cython does so quite extensively, for example. I don't see any use in changing t

[issue13897] Move fields relevant to sys.exc_info out of frame into generator/threadstate

2012-04-09 Thread Stefan Behnel
Stefan Behnel added the comment: I can't speak for much outside of Cython, and Cython generated modules would best be regenerated with a newer Cython version anyway in order to work with Py3.3. I'm not sure that's currently required, though. As long as there is a way to acce

[issue14098] provide public C-API for reading/setting sys.exc_info()

2012-04-10 Thread Stefan Behnel
Stefan Behnel added the comment: Done. -- ___ Python tracker <http://bugs.python.org/issue14098> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13897] Move fields relevant to sys.exc_info out of frame into generator/threadstate

2012-04-14 Thread Stefan Behnel
Stefan Behnel added the comment: >> As long as there is a way to access these fields directly from the >> struct (with the usual preprocessor conditional), I don't think Cython >> will actually start to use the PyErr_[GS]etExcInfo() functions in >> CPython - s

[issue14592] old-style (level=-1) importing broken after importlib changes

2012-04-16 Thread Stefan Behnel
New submission from Stefan Behnel : Up to the early Py3.3 developer versions, calling __import__() with a level of -1 worked as in Python 2, i.e. it tried a relative import first and then a global import. This no longer seems to be available after the importlib rewrite (e.g. as of rev

[issue14594] document imp.load_dynamic()

2012-04-16 Thread Stefan Behnel
New submission from Stefan Behnel : The imp.load_dynamic() function is used by third party code (e.g. Cython's pyximport) but is not currently documented. http://docs.python.org/dev/library/imp.html The latest changes to the import mechanism suggest that it should better be document

[issue14592] old-style (level=-1) importing broken after importlib changes

2012-04-16 Thread Stefan Behnel
Stefan Behnel added the comment: It turns out that it wasn't all that hard to work around. Calling __import__ twice seems to do the trick. It's more overhead, but if people want speed, they can just be explicit about what kind of import they actually mean. So I wouldn't mind c

[issue14592] old-style (level=-1) importing broken after importlib changes

2012-04-16 Thread Stefan Behnel
Stefan Behnel added the comment: > Yeah, the fix is dead-simple, import with level=1 and if that fails import > with level=0. With one caveat: relative imports don't work outside of packages, so the importing code has to know when it's in a package or not. Otherwise, the relat

[issue14592] old-style (level=-1) importing broken after importlib changes

2012-04-16 Thread Stefan Behnel
Stefan Behnel added the comment: Hmm, interesting - it stripped the command from my e-mail. I was doing this: >>> __import__("sys", level=1) Traceback (most recent call last): File "", line 1, in SystemError: error

[issue18911] minidom does not encode correctly when calling Document.writexml

2019-05-31 Thread Stefan Behnel
Stefan Behnel added the comment: Asking users unconditionally to use the "xmlcharrefreplace" replacement method seems wrong for UTF-8. It should not be necessary. We should, however, document explicitly that the file will receive text and not bytes, i.e. that users are

[issue18911] minidom does not encode correctly when calling Document.writexml

2019-05-31 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset 5ac0b988fd5f1428efe35329c531c7b5c74d37f6 by Stefan Behnel (Windson yang) in branch 'master': bpo-18911: clarify that the minidom XML writer receives texts but not bytes (GH-13352) https://github.com/python/cpyt

[issue18911] minidom does not encode correctly when calling Document.writexml

2019-05-31 Thread Stefan Behnel
Change by Stefan Behnel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8 -Python 2.7, Python 3.5, Python 3.6 ___ Python tracker <https://bugs.python.or

[issue18911] minidom does not encode correctly when calling Document.writexml

2019-05-31 Thread Stefan Behnel
Change by Stefan Behnel : -- resolution: fixed -> stage: resolved -> backport needed status: closed -> open versions: +Python 3.7 ___ Python tracker <https://bugs.python.or

[issue18911] minidom does not encode correctly when calling Document.writexml

2019-05-31 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset 18e23f227be59241cbb1eeb6d6669771dd7275fb by Stefan Behnel (Miss Islington (bot)) in branch '3.7': bpo-18911: clarify that the minidom XML writer receives texts but not bytes (GH-13718) https://github.com/python/cpyt

[issue18911] minidom does not encode correctly when calling Document.writexml

2019-06-01 Thread Stefan Behnel
Change by Stefan Behnel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue36885] Make makeunicode.py script more readable

2019-06-01 Thread Stefan Behnel
Change by Stefan Behnel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue37221] PyCode_New API change breaks backwards compatibility policy

2019-06-11 Thread Stefan Behnel
Stefan Behnel added the comment: Note that PyCode_New() is not the only change in 3.8 beta1 that breaks Cython generated code. The renaming of "tp_print" to "tp_vectorcall" is equally disruptive, because Cython has (or had) a work-around for CPython (mis-)behaviour

[issue37250] C files generated by Cython set tp_print to NULL: PyTypeObject.tp_print removed, replaced with tp_vectorcall_offset

2019-06-12 Thread Stefan Behnel
Stefan Behnel added the comment: > they can equally easily zero out the entire structure and ignore it without > changing behavior on any Python 3.x. Any solution that we apply in Cython will require users to regenerate their .c sources with a new Cython version in order to make it c

[issue37250] C files generated by Cython set tp_print to NULL: PyTypeObject.tp_print removed, replaced with tp_vectorcall_offset

2019-06-12 Thread Stefan Behnel
Stefan Behnel added the comment: (I forgot to state the obvious third option, which is: don't do anything and leave everything as it is now in beta-1.) -- ___ Python tracker <https://bugs.python.org/is

[issue37250] C files generated by Cython set tp_print to NULL: PyTypeObject.tp_print removed, replaced with tp_vectorcall_offset

2019-06-14 Thread Stefan Behnel
Stefan Behnel added the comment: I agree with Steve that broadly redefining a global name in a widely used header file is not a good idea. You never know what names users have in their code. Yes, you can work around it by undef-ing it again, but honestly, in that case, both sides are hacks

[issue37250] C files generated by Cython set tp_print to 0: PyTypeObject.tp_print removed

2019-06-24 Thread Stefan Behnel
Stefan Behnel added the comment: Thank you, Petr, for bringing this discussion back on a solid basis, actually twice already. And sorry for causing this problem in the first place. The "tp_print = 0" was necessary to fix misbehaviour in Py2, and we should have restricted it to

[issue37221] PyCode_New API change breaks backwards compatibility policy

2019-06-24 Thread Stefan Behnel
Stefan Behnel added the comment: I'm really only waiting for bpo-37250 to be resolved, then I can prepare a new point release of Cython, preferably this week. -- ___ Python tracker <https://bugs.python.org/is

[issue37399] XML text behaviour change if there are comments

2019-06-27 Thread Stefan Behnel
Stefan Behnel added the comment: I think it might be this call that strikes here: https://github.com/python/cpython/commit/43851a202c#diff-f3b827d6e1d5c270ab42bc2c0523c1d2R2842 treebuilder_flush_data() is not made for concatenating text, it simply replaces it. If both text parts come

[issue37399] XML text behaviour change if there are comments

2019-06-30 Thread Stefan Behnel
Stefan Behnel added the comment: I'm working on a patch. It's not entirely trivial, so it might take a couple of days. -- assignee: -> scoder ___ Python tracker <https://bugs.pytho

[issue37221] PyCode_New API change breaks backwards compatibility policy

2019-07-01 Thread Stefan Behnel
Stefan Behnel added the comment: > Is it part of Cython 0.29.11 released yesterday? Yes. -- ___ Python tracker <https://bugs.python.org/issue37221> ___ _

[issue37500] 3.8.0b2 no longer optimizes away "if 0:" ?

2019-07-05 Thread Stefan Behnel
Stefan Behnel added the comment: > it should not be rely upon IMHO, the correct behaviour under coverage analysis is to keep the code and not discard it. After all, it is code that exists, and that is not being executed, so it should count as uncovered code. The fact that some Pyt

[issue37221] PyCode_New API change breaks backwards compatibility policy

2019-07-07 Thread Stefan Behnel
Stefan Behnel added the comment: No need to keep this bug open on CPython side. The backwards compatibility has been restored (and I'll release Cython 0.29.12 today to resolve the issue on that side.) -- resolution: -> fixed status: open -

[issue37399] XML text behaviour change if there are comments

2019-07-19 Thread Stefan Behnel
Change by Stefan Behnel : -- keywords: +patch pull_requests: +14646 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/14856 ___ Python tracker <https://bugs.python.org/issu

[issue34160] ElementTree not preserving attribute order

2019-07-19 Thread Stefan Behnel
Change by Stefan Behnel : -- pull_requests: +14654 pull_request: https://github.com/python/cpython/pull/14867 ___ Python tracker <https://bugs.python.org/issue34

[issue34160] ElementTree not preserving attribute order

2019-07-19 Thread Stefan Behnel
Stefan Behnel added the comment: I created a PR that adds a couple of paragraphs to the documentation. Comments welcome. -- versions: +Python 3.9 ___ Python tracker <https://bugs.python.org/issue34

[issue37636] Deprecate slicing and ordering operations on sys.version

2019-07-21 Thread Stefan Behnel
Stefan Behnel added the comment: > Changing the major version number itself is a breaking change So is the proposed change, in a way. At some point, there will be a 4.0 release, which may or may not break the code in question. So, testing for "version_info[0] == 3" is already w

[issue37399] XML text behaviour change if there are comments

2019-07-24 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset c6cb4cdd21c0c3a09b0617dbfaa7053d3bfa6def by Stefan Behnel in branch 'master': bpo-37399: Correctly attach tail text to the last element/comment/pi (GH-14856) https://github.com/python/cpython/commit/c6cb4cdd21c0c3a09b0617dbfaa705

<    1   2   3   4   5   6   7   8   9   10   >