[issue40971] Documentation still mentions 'u' string formatting option

2020-06-13 Thread Gordon P. Hemsley
New submission from Gordon P. Hemsley : https://docs.python.org/3/library/stdtypes.html#old-string-formatting still lists the 'u' string formatting option, described as "Obsolete type – it is identical to 'd'." and linking to PEP 237. However, testing indicates that Python 3 does n

[issue36967] Eliminate unnecessary check in _strptime when determining AM/PM

2019-05-19 Thread Gordon P. Hemsley
Change by Gordon P. Hemsley : -- components: +Library (Lib) ___ Python tracker <https://bugs.python.org/issue36967> ___ ___ Python-bugs-list mailing list Unsub

[issue36967] Eliminate unnecessary check in _strptime when determining AM/PM

2019-05-19 Thread Gordon P. Hemsley
Change by Gordon P. Hemsley : -- keywords: +patch pull_requests: +13338 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36967> ___ _

[issue36967] Eliminate unnecessary check in _strptime when determining AM/PM

2019-05-19 Thread Gordon P. Hemsley
New submission from Gordon P. Hemsley : Since __calc_am_pm() explicitly limits self.am_pm to 2 values, there are only ever 3 possible values of %p: AM, PM, or blank. Since blank is treated the same as AM, there is only the need to check whether %p is PM. This eliminates an unnecessary

[issue36959] ISO date errors in _strptime are jumbled

2019-05-18 Thread Gordon P. Hemsley
Gordon P. Hemsley added the comment: Ah yes, to be clear, I wasn't trying to suggest that the error messages themselves were wrong—just that they weren't triggering when the tests were expecting them to. Some of the existing tests currently trigger the "unconverted data remains"

[issue36959] ISO date errors in _strptime are jumbled

2019-05-18 Thread Gordon P. Hemsley
Gordon P. Hemsley added the comment: I've created a PR that fixes the issue, which I discovered while evaluating the test coverage for _strptime. Certain scenarios of error messages were never being hit because the cascade was out of order, and the tests were not showing that because

[issue36959] ISO date errors in _strptime are jumbled

2019-05-18 Thread Gordon P. Hemsley
Change by Gordon P. Hemsley : -- keywords: +patch pull_requests: +13319 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36959> ___ _

[issue36959] ISO date errors in _strptime are jumbled

2019-05-18 Thread Gordon P. Hemsley
New submission from Gordon P. Hemsley : This has not been apparent because the tests for this code are not testing what they think they're testing. -- components: Library (Lib), Tests messages: 342810 nosy: gphemsley priority: normal severity: normal status: open title: ISO date

[issue23012] RuntimeError: settrace/setprofile function gets lost

2019-05-17 Thread Gordon P. Hemsley
Change by Gordon P. Hemsley : -- nosy: +gphemsley ___ Python tracker <https://bugs.python.org/issue23012> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36474] RecursionError resets trace function set via sys.settrace

2019-05-17 Thread Gordon P. Hemsley
Change by Gordon P. Hemsley : -- nosy: +gphemsley ___ Python tracker <https://bugs.python.org/issue36474> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10933] Tracing disabled when a recursion error is triggered (even if properly handled)

2019-05-17 Thread Gordon P. Hemsley
Change by Gordon P. Hemsley : -- nosy: +gphemsley ___ Python tracker <https://bugs.python.org/issue10933> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36954] test_recursive_repr breaks tracing in test_xml_etree

2019-05-17 Thread Gordon P. Hemsley
New submission from Gordon P. Hemsley : When running test_xml_etree with tracing, e.g. when running test coverage, tracing breaks after the execution of test_recursive_repr. -- components: Tests messages: 342783 nosy: blueyed, gphemsley, serhiy.storchaka priority: normal pull_requests

[issue36684] codecov.io code coverage has not updated since 2019-04-13

2019-05-06 Thread Gordon P. Hemsley
Change by Gordon P. Hemsley : -- pull_requests: +13059 ___ Python tracker <https://bugs.python.org/issue36684> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36684] codecov.io code coverage has not updated since 2019-04-13

2019-05-06 Thread Gordon P. Hemsley
Gordon P. Hemsley added the comment: Hah, that's indeed where I've landed in my experimentation. -- ___ Python tracker <https://bugs.python.org/issue36

[issue36684] codecov.io code coverage has not updated since 2019-04-13

2019-05-05 Thread Gordon P. Hemsley
Gordon P. Hemsley added the comment: It seems the primary cause of the problem is simply that testing crossed the boundary of maximum execution time allotted by Travis CI. I'm experimenting now with ways to speed up testing without losing granularity. However, given how long code coverage

[issue32424] Synchronize copy methods between Python and C implementations of xml.etree.ElementTree.Element

2019-05-05 Thread Gordon P. Hemsley
Gordon P. Hemsley added the comment: It seems the final open question on this is whether the mismatch between the Python and C implementations is enough to bypass PendingDeprecationWarning for copy() in favor of jumping straight to DeprecationWarning

[issue36684] codecov.io code coverage has not updated since 2019-04-13

2019-05-04 Thread Gordon P. Hemsley
Gordon P. Hemsley added the comment: Testing has shown that the gcc build itself runs fine. The problem appears to be with how the coverage tests are run. -- ___ Python tracker <https://bugs.python.org/issue36

[issue32424] Synchronize copy methods between Python and C implementations of xml.etree.ElementTree.Element

2019-04-28 Thread Gordon P. Hemsley
Change by Gordon P. Hemsley : -- pull_requests: +12918 ___ Python tracker <https://bugs.python.org/issue32424> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36685] C implementation of xml.etree.ElementTree does not make a copy of attrib argument when creating new Element

2019-04-21 Thread Gordon P. Hemsley
Change by Gordon P. Hemsley : -- keywords: +patch pull_requests: +12823 stage: needs patch -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue32424] Synchronize copy methods between Python and C implementations of xml.etree.ElementTree.Element

2019-04-21 Thread Gordon P. Hemsley
Change by Gordon P. Hemsley : -- pull_requests: +12822 ___ Python tracker <https://bugs.python.org/issue32424> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36684] codecov.io code coverage has not updated since 2019-04-13

2019-04-21 Thread Gordon P. Hemsley
Gordon P. Hemsley added the comment: I'm not sure when the gcc build started failing, but it looks like the commits at the boundary failed due to max build time. Something is apparently too slow to run. -- ___ Python tracker <ht

[issue36684] codecov.io code coverage has not updated since 2019-04-13

2019-04-21 Thread Gordon P. Hemsley
Gordon P. Hemsley added the comment: It looks like this may be the result of the code coverage being provided by the optional gcc build, which has been failing for quite a while. -- ___ Python tracker <https://bugs.python.org/issue36

[issue36684] codecov.io code coverage has not updated since 2019-04-13

2019-04-21 Thread Gordon P. Hemsley
Gordon P. Hemsley added the comment: In fact, it seems the last commit on master was 962b028b0c20abcf39594f08b1e5f8c36c4e5f6f 3 months ago, which doesn't even have valid report. The previous commit, 9932a22897ef9905161dac7476e6976370e13515, was the last to have a functioning report

[issue32424] Synchronize copy methods between Python and C implementations of xml.etree.ElementTree.Element

2019-04-20 Thread Gordon P. Hemsley
Gordon P. Hemsley added the comment: Opened issue36685 for discussion of the attrib copy issue. -- ___ Python tracker <https://bugs.python.org/issue32

[issue36685] C implementation of xml.etree.ElementTree does not make a copy of attrib argument when creating new Element

2019-04-20 Thread Gordon P. Hemsley
Gordon P. Hemsley added the comment: My proposed solution to this was to make a copy of the attrib dictionary in the create_new_element() method in the C implementation, which solves the problem. However, this was apparently objected to on the grounds of performance. Not knowing C very well

[issue36685] C implementation of xml.etree.ElementTree does not make a copy of attrib argument when creating new Element

2019-04-20 Thread Gordon P. Hemsley
New submission from Gordon P. Hemsley : In the process of investigating and writing tests for issue32424, I discovered that the C implementation of xml.etree.ElementTree does not make a copy of the attrib argument when creating a new element, allowing the attributes of the element

[issue32424] Synchronize copy methods between Python and C implementations of xml.etree.ElementTree.Element

2019-04-20 Thread Gordon P. Hemsley
Gordon P. Hemsley added the comment: Taking a step back, I want to make sure I understand the action items for resolving this: * Add copy() as an alias to __copy__() in the C implementation to match the Python implementation. * Deprecate copy() in favor of copy.copy() in both the Python

[issue36684] codecov.io code coverage has not updated since 2019-04-13

2019-04-20 Thread Gordon P. Hemsley
New submission from Gordon P. Hemsley : The last commit available on codecov.io is from a week ago (d28aaa7df8bcd46f4135d240d041b0b171b664cc): https://codecov.io/gh/python/cpython And the widget on the README is showing a status of "unknown". -- messages: 340588 nosy:

[issue32424] Synchronize copy methods between Python and C implementations of xml.etree.ElementTree.Element

2018-01-20 Thread Gordon P. Hemsley
Gordon P. Hemsley <gphems...@gphemsley.org> added the comment: >> As discussed above, starting with msg309074, __deepcopy__() is being added >> to the Python implementation because it already exists in the C >> implementation. > > Python implementation sho

[issue32466] Remove fractions._gcd()

2017-12-31 Thread Gordon P. Hemsley
Gordon P. Hemsley <gphems...@gphemsley.org> added the comment: So, if I'm understanding your position correctly: * We're back to needing a test for the line in question. * We're eschewing the possibility of changing the behavior of `fractions.Fraction` to force int numerator and denom

[issue32466] Remove fractions._gcd()

2017-12-31 Thread Gordon P. Hemsley
Gordon P. Hemsley <gphems...@gphemsley.org> added the comment: Side note: https://github.com/aleaxit/gmpy/issues/127 suggests that the types in question were added to the numeric tower for gmpy 2.0.9 and 2.1.0. -- ___ Python tracke

[issue32466] Remove fractions._gcd()

2017-12-31 Thread Gordon P. Hemsley
Gordon P. Hemsley <gphems...@gphemsley.org> added the comment: Indeed, that is the code fragment I was referring to. Mathematically speaking, a rational number is one that can be expressed as a fraction of two integers, so in that regard the numerator and the denominator shoul

[issue32466] Remove fractions._gcd()

2017-12-31 Thread Gordon P. Hemsley
New submission from Gordon P. Hemsley <gphems...@gphemsley.org>: I noticed that there was a single line of Lib/fractions.py that did not have test coverage: the normalize step for fractions with non-integer numerators and/or denominators. I initially was going to implement

[issue32424] Synchronize copy methods between Python and C implementations of xml.etree.ElementTree.Element

2017-12-30 Thread Gordon P. Hemsley
Gordon P. Hemsley <gphems...@gphemsley.org> added the comment: As discussed above, starting with msg309074, __deepcopy__() is being added to the Python implementation because it already exists in the C implementation. And additional tests have in fact uncovered further discrepancies b

[issue32424] Synchronize copy methods between Python and C implementations of xml.etree.ElementTree.Element

2017-12-29 Thread Gordon P. Hemsley
Gordon P. Hemsley <gphems...@gphemsley.org> added the comment: Given the discussion, I've gone ahead and created a new PR that synchronizes the three copy methods between implementations and deprecates Element.copy(). -- ___ Python tracke

[issue32424] Synchronize copy methods between Python and C implementations of xml.etree.ElementTree.Element

2017-12-29 Thread Gordon P. Hemsley
Change by Gordon P. Hemsley <gphems...@gphemsley.org>: -- title: Rename copy() to __copy__() in xml.etree.ElementTree.Element Python implementation -> Synchronize copy methods between Python and C implementations of xml.etree.ElementTre

[issue32424] Rename copy() to __copy__() in xml.etree.ElementTree.Element Python implementation

2017-12-29 Thread Gordon P. Hemsley
Change by Gordon P. Hemsley <gphems...@gphemsley.org>: -- pull_requests: +4927 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue32424] Rename copy() to __copy__() in xml.etree.ElementTree.Element Python implementation

2017-12-28 Thread Gordon P. Hemsley
Gordon P. Hemsley <gphems...@gphemsley.org> added the comment: Two notes: * It appears that pypy is based on no more recent than Python 3.5, so this wouldn't immediately break them. (3.6 support is maybe in development?) * pypy appears to have already made other adjustmen

[issue32424] Rename copy() to __copy__() in xml.etree.ElementTree.Element Python implementation

2017-12-27 Thread Gordon P. Hemsley
Gordon P. Hemsley <gphems...@gphemsley.org> added the comment: Ultimately, yeah, the Python version should probably define __deepcopy__ as well. But since this is just a rename of an existing method, I figure we can defer that to anothe

[issue32424] Rename copy() to __copy__() in xml.etree.ElementTree.Element Python implementation

2017-12-27 Thread Gordon P. Hemsley
Change by Gordon P. Hemsley <gphems...@gphemsley.org>: -- keywords: +patch pull_requests: +4909 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue28236] In xml.etree.ElementTree Element can be created with empty and None tag

2017-12-24 Thread Gordon P. Hemsley
Gordon P. Hemsley <gphems...@gphemsley.org> added the comment: Issues of potential relevance to this discussion: * Issue28237 - In xml.etree.ElementTree bytes tag or attributes raises on serialization * Issue5166 - ElementTree and minidom don't prevent creation of not well-forme

[issue29209] Remove old-deprecated ElementTree features

2017-12-24 Thread Gordon P. Hemsley
Change by Gordon P. Hemsley <gphems...@gphemsley.org>: -- nosy: +gphemsley ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue29209> ___

[issue32425] Allow non-default XML parsers to take advantage of a _parse_whole definition in xml.etree.ElementTree.ElementTree.parse()

2017-12-24 Thread Gordon P. Hemsley
Gordon P. Hemsley <gphems...@gphemsley.org> added the comment: Sorry, the chunks are 64 KiB. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue32425] Allow non-default XML parsers to take advantage of a _parse_whole definition in xml.etree.ElementTree.ElementTree.parse()

2017-12-24 Thread Gordon P. Hemsley
New submission from Gordon P. Hemsley <gphems...@gphemsley.org>: Currently, ElementTree.parse() in xml.etree.ElementTree only invokes _parse_whole() on the parser if no parser is specified and it falls back to the built-in XMLParser. This has two drawbacks: * If the built-in XML

[issue32424] Rename copy() to __copy__() in xml.etree.ElementTree.Element Python implementation

2017-12-24 Thread Gordon P. Hemsley
New submission from Gordon P. Hemsley <gphems...@gphemsley.org>: Currently, the Python implementation of the Element class in xml.etree.ElementTree defines a method called copy() which the C implementation does not define, whereas the C implementation defines a __copy__()

[issue28236] In xml.etree.ElementTree Element can be created with empty and None tag

2017-12-24 Thread Gordon P. Hemsley
Gordon P. Hemsley <gphems...@gphemsley.org> added the comment: To be clear, we are talking about the Element class of the ElementTree module, which is distinct from the ElementTree class of the same module. That said, I personally question the implementation decision to represent thing

[issue28236] In xml.etree.ElementTree Element can be created with empty and None tag

2017-12-23 Thread Gordon P. Hemsley
Gordon P. Hemsley <gphems...@gphemsley.org> added the comment: I disagree. This library is meant to be an interface onto XML syntax, and XML has pretty strict requirements on syntax. As msg277125 shows, you're liable to get very far downstream before the error becomes apparent. In ad

[issue20291] Argument Clinic should understand *args and **kwargs parameters

2017-12-22 Thread Gordon P. Hemsley
Change by Gordon P. Hemsley <gphems...@gphemsley.org>: -- nosy: +gphemsley ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue20291> ___

[issue28236] In xml.etree.ElementTree Element can be created with empty and None tag

2017-12-21 Thread Gordon P. Hemsley
Gordon P. Hemsley <gphems...@gphemsley.org> added the comment: I decided to take a look at this, since it seems easy... At first glance, this would appear to be a straightforward change--the docs state in multiple places that Element() takes a string as its tag argument. But it tur