[issue38410] Possible fatal errors due to _PyEval_SetAsyncGen{Finalizer, Firstiter}()

2020-02-25 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +18019 pull_request: https://github.com/python/cpython/pull/18658 ___ Python tracker <https://bugs.python.org/issue38

[issue38410] Possible fatal errors due to _PyEval_SetAsyncGen{Finalizer, Firstiter}()

2020-02-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 18658 is a backport to 3.8 which preserves binary compatibility. -- ___ Python tracker <https://bugs.python.org/issue38

[issue39737] Speed up list.__eq__ by about 6%

2020-02-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset be7ead62db9a1db3e2cd997b0beffd4480e51f5c by sweeneyde in branch 'master': bpo-39737: Remove code repitition in list_richcompare (GH-18638) https://github.com/python/cpython/commit/be7ead62db9a1db3e2cd997b0beffd

[issue39737] Speed up list.__eq__ by about 6%

2020-02-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your contribution Dennis. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue39760] ast.FormattedValue.format_spec unnecessarily wrapped in JoinedStr

2020-02-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: FYI you can use ast CLI: $ echo 'f"is {x:d}"' | ./python -m ast Module( body=[ Expr( value=JoinedStr( values=[ Constant(value='is ', kind=None), FormattedValue(

[issue39762] PyLong_AS_LONG missing from longobject.h

2020-02-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Python 2 is no longer supported. -- nosy: +serhiy.storchaka resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue8269] Missing return values for PyUnicode C/API functions

2020-02-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, we missed this issue. refcounts.dat was updated in other issues. -- nosy: +serhiy.storchaka resolution: -> out of date stage: patch review -> resolved status: open -> closed ___ Python tracke

[issue31015] PyErr_WriteUnraisable should be more verbose in Python 2.7

2020-02-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is too late for 2.7. -- nosy: +serhiy.storchaka resolution: -> wont fix stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue22714] target of 'import statement' entry in general index for 'i' is wrong

2020-02-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are 5 links for the "import statement" entry. Issue35506 partially solved the problem -- the main link is now emphasized. But it is still the last of links. I afraid it is a limitation of Sphinx. If no other solution be proposed I

[issue23164] "pydoc filter" documentation restrictive

2020-02-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It was fixed in Python 3, and it is too late for 2.7. -- nosy: +serhiy.storchaka resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue25397] improve ac_cv_have_long_long_format GCC fallback

2020-02-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is too later for 2.7. The long long type is required for recent Python 3 versions, so this macro is no longer used. -- nosy: +serhiy.storchaka resolution: -> out of date stage: -> resolved status: open -&g

[issue39762] PyLong_AS_LONG missing from longobject.h

2020-02-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The reason why there was the PyInt_AS_LONG macro is that it is very simple and efficient. It never fails, because the value of the int object always fits in the C long. PyInt_AsLong is much slower. If you know that the object is int, you can use

[issue22947] Enable 'imageop' - "Multimedia Srvices Feature module" for 64-bit platform

2020-02-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Python 2.7 no longer supported. -- nosy: +serhiy.storchaka resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue39768] remove tempfile.mktemp()

2020-02-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Remove tempfile.mktemp() ___ Python tracker <https://bugs.python

[issue39768] remove tempfile.mktemp()

2020-02-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: wyz23x2, why do you think that this is not a duplicate of issue36309? -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue39

[issue36144] Dictionary union. (PEP 584)

2020-02-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 1. def __or__(self, other): return self.__class__(self.maps[0] | other, *self.maps[1:]) def __ror__(self, other): return other | dict(self) 2. def __or__(self, other): return self.__class__(other, *self.maps) def __ror__(self, other

[issue39725] unrelated `from None` exceptions lose prior exception information

2020-02-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Because there may be more exceptions than the code writer know. The code raised OverflowError and ValueError may be in different function, so the code writer know only about ValueError, but OverflowError is an implementation detail (and may be absent in

[issue39806] different behavior between __ior__ and __or__ in dict made by PEP 584

2020-03-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is how PEP 584 specifies it. The in-place operator is more lenient. It corresponds the behavior of list operators. >>> x = [] >>> y = (1, 2) >>> x + y Traceback (most recent call last): File "", line 1, in Type

[issue39811] Curses crash on ^4

2020-03-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is not related to curses and Python. Run arbitrary program (for example `cat` or `sleep 100`) and press Ctrl-4. You will get a core dump. This is because your terminal generates the signal SIGQUIT on Ctrl-4, and default action on SIGQUIT is core dump

[issue39816] More descriptive error message than "too many values to unpack"

2020-03-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with Chris and Kyle. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue39816> ___ ___

[issue39378] partial of PickleState struct should be traversed.

2020-03-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 1f577ce363121d590b51abf5c41d1bcf3d751436 by Hai Shi in branch 'master': bpo-39378: partial of PickleState struct should be traversed. (GH-18046) https://github.com/python/cpython/commit/1f577ce363121d590b51abf5c41d1b

[issue39495] xml.etree.ElementTree.TreeBuilder.start differs between pure Python and C implementations

2020-03-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 4edc95cf0a2960431621eee9bc194f6225f1690b by Shantanu in branch 'master': bpo-39495: Remove default value from C impl of TreeBuilder.start (GH-18275) https://github.com/python/cpython/commit/4edc95cf0a2960431621eee9bc194f

[issue38971] codecs.open leaks file descriptor when invalid encoding is passed

2020-03-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 2565edec2c974b2acca03b4cc5025e83f903ddd7 by Chris A in branch 'master': bpo-38971: Open file in codecs.open() closes if exception raised. (GH-17666) https://github.com/python/cpython/commit/2565edec2c974b2acca03b4cc5025e

[issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised

2020-03-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 28d0bcac8b7e6dbd28311f1283dabb6a4d649fcb by Serhiy Storchaka in branch 'master': bpo-38913: Fix segfault in Py_BuildValue("(s#O)", ...) if entered with exception raised. (GH-18656) https://github.com/p

[issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised

2020-03-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +18089 pull_request: https://github.com/python/cpython/pull/18732 ___ Python tracker <https://bugs.python.org/issue38

[issue39378] partial of PickleState struct should be traversed.

2020-03-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.or

[issue39822] Use NULL instead of None for empty attrib in C implementation of Element

2020-03-01 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Currently None is used instead of an empty directory for the attrib field in the C implementation of Element in ElementTree. It is a pure optimization: an empty dict takes a memory and its creation has a cost. The proposed PR makes NULL be using instead

[issue39822] Use NULL instead of None for empty attrib in C implementation of Element

2020-03-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +18092 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18735 ___ Python tracker <https://bugs.python.org/issu

[issue39495] xml.etree.ElementTree.TreeBuilder.start differs between pure Python and C implementations

2020-03-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.9 ___ Python tracker <https://bugs.python.or

[issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised

2020-03-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset a7b8a969eb3daacb1fcb029a8c5fecb5d09c964b by Serhiy Storchaka in branch '3.8': [3.8] bpo-38913: Fix segfault in Py_BuildValue("(sGH-O)", ...) if entered with exception raised. (GH-18656). (GH-18732) https://github.com/p

[issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised

2020-03-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> crash versions: +Python 3.9 ___ Python tracker <https://bugs.python

[issue38410] Possible fatal errors due to _PyEval_SetAsyncGen{Finalizer, Firstiter}()

2020-03-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 87a4cd5fbebdd0e6166b421d2c3706bc2f2e5a11 by Serhiy Storchaka in branch '3.8': bpo-38410: Properly handle PySys_Audit() failures (GH-18658) https://github.com/python/cpython/commit/87a4cd5fbebdd0e6166b421d2c3706

[issue38971] codecs.open leaks file descriptor when invalid encoding is passed

2020-03-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is too later for 2.7. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 2.7 ___ Python tracker <https://bugs.python.or

[issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised

2020-03-02 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- status: closed -> open ___ Python tracker <https://bugs.python.org/issue38913> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised

2020-03-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Actually there is a leak in PyErr_WarnEx(). -- ___ Python tracker <https://bugs.python.org/issue38913> ___ ___ Python-bug

[issue39831] Reference leak in PyErr_WarnEx()

2020-03-02 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The test added for issue38913 exposed a reference leak in PyErr_WarnEx(). -- components: Interpreter Core messages: 363203 nosy: serhiy.storchaka priority: normal severity: normal status: open title: Reference leak in PyErr_WarnEx() type: resource

[issue39831] Reference leak in PyErr_WarnEx()

2020-03-02 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +18105 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18750 ___ Python tracker <https://bugs.python.org/issu

[issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised

2020-03-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Opened issue39831. -- resolution: -> fixed status: open -> closed ___ Python tracker <https://bugs.python.org/i

[issue39831] Reference leak in PyErr_WarnEx()

2020-03-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 2d2f85517f8216146a2f888d1ad4d765b3be2339 by Serhiy Storchaka in branch 'master': bpo-39831: Fix a reference leak in PyErr_WarnEx(). (GH-18750) https://github.com/python/cpython/commit/2d2f85517f8216146a2f888d1ad4d7

[issue39831] Reference leak in PyErr_WarnEx()

2020-03-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is not so easy for 3.7. -- resolution: fixed -> stage: resolved -> status: closed -> open ___ Python tracker <https://bugs.python.or

[issue39831] Reference leak in PyErr_WarnEx()

2020-03-03 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +18119 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18764 ___ Python tracker <https://bugs.python.org/issu

[issue39831] Reference leak in PyErr_WarnEx()

2020-03-03 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +18120 pull_request: https://github.com/python/cpython/pull/18765 ___ Python tracker <https://bugs.python.org/issue39

[issue39831] Reference leak in PyErr_WarnEx()

2020-03-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset ae75a294352e9b9487f5dc8e88f068e7e6974dc2 by Serhiy Storchaka in branch 'master': bpo-39831: Remove outdated comment. (GH-18764) https://github.com/python/cpython/commit/ae75a294352e9b9487f5dc8e88f068

[issue35712] Make NotImplemented unusable in boolean context

2020-03-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 469325c30e147680543b2f5118b83fd95055a499 by MojoVampire in branch 'master': bpo-35712: Make using NotImplemented in a boolean context issue a deprecation warning (GH-13195) https://github.com/python/cpyt

[issue35712] Make NotImplemented unusable in boolean context

2020-03-03 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue39842] partial_format()

2020-03-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What would "{} {}".partial_format({}) return? It is not possible to implement a "safe" variant of str.format(), because in difference to Template it can call arbitrary code and allows easily to produce arbitrary large strings. Template

[issue27743] Python 2 has a wrong artificial limit on the amount of memory that can be allocated in ctypes

2020-03-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It was fixed in issue16865. -- nosy: +serhiy.storchaka resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue39863] Add trimend option to readline() and readlines()

2020-03-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It would be better to name it keepends and set it True by default. I wanted this feature. The problem is that it is not just concrete implementation, it is an interface. Adding new parameters for IOBase methods will break all IOBase subclasses. And there

[issue39871] math.copysign raises SystemError with non-float x and custom y

2020-03-05 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +easy (C) stage: -> needs patch versions: +Python 3.7, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issu

[issue39876] csv.DictReader.fieldnames interprets unicode as ascii

2020-03-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: csv.DictReader does not work with encodings. It works with already decoded strings. You have to specify the correct encoding in open() (and "t" in mode is ignored): with open(filename, "r", encoding="utf-8") as csvfile:

[issue39887] Duplicate C object description of vectorcallfunc

2020-03-07 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : $ make html ... Warning, treated as error: /home/serhiy/py/cpython/Doc/c-api/call.rst:71:duplicate C object description of vectorcallfunc, other instance in /home/serhiy/py/cpython/Doc/c-api/typeobj.rst -- assignee: docs@python components

[issue39199] Improve the AST documentation

2020-03-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Would not be better to use mode='eval' for expression nodes? >>> print(ast.dump(ast.parse('123', mode='eval'), indent=4)) Expression( body=Constant(value=123, kind=Non

[issue34822] Simplify AST for slices

2020-03-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It was added to produce nicer output. Currently: >>> print(ast.unparse(ast.parse('a[i, j]'))) a[(i, j)] With PR 9605: >>> print(ast.unparse(ast.parse('a[i, j]'))) a[i, j] The current code is not consistent w

[issue39889] Fix ast.unparse() for subscription by extended slices and tuples

2020-03-07 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : ast.unparse() produces incorrect output for ExtSlice containing a single element: >>> print(ast.unparse(ast.parse('a[i:j,]'))) a[i:j] It also produces redundant parenthesis for Index containing Tuple: >>> print(ast.unparse(

[issue39889] Fix ast.unparse() for subscription by extended slices and tuples

2020-03-07 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +18183 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18824 ___ Python tracker <https://bugs.python.org/issu

[issue39889] Fix ast.unparse() for subscription by extended slices and tuples

2020-03-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset c4928fc1a853f3f84e2b4ec1253d0349137745e5 by Serhiy Storchaka in branch 'master': bpo-39889: Fix ast.unparse() for subscript. (GH-18824) https://github.com/python/cpython/commit/c4928fc1a853f3f84e2b4ec1253d03

[issue39889] Fix ast.unparse() for subscription by extended slices and tuples

2020-03-07 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +18184 pull_request: https://github.com/python/cpython/pull/18826 ___ Python tracker <https://bugs.python.org/issue39

[issue39889] Fix ast.unparse() for subscription by extended slices and tuples

2020-03-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 92b72788ecf2ee5dfac780c7dfb5ee5350fc641d by Serhiy Storchaka in branch '3.8': [3.8] bpo-39889: Fix unparse.py for subscript. (GH-18824). (GH-18826) https://github.com/python/cpython/commit/92b72788ecf2ee5dfac780c7dfb5ee

[issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()`

2020-03-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are two reasons: 1. os.path.expanduser() returns the path unchanged when a home directory cannot be resolved, pathlib.Path.expanduser() raises an error. The latter behavior looks more robust, but we can't change os.path.expanduser(

[issue36287] Make ast.dump() not output optional default fields

2020-03-07 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +18200 pull_request: https://github.com/python/cpython/pull/18843 ___ Python tracker <https://bugs.python.org/issue36

[issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()`

2020-03-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I see no reason to change the current code. -- resolution: -> not a bug stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue36287] Make ast.dump() not output optional default fields

2020-03-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 18843 solves this issue by setting None as class attributes for optional fields and attributes (like "kind" or "end_col_offset"). It is not so easy for fields like "type_ignores". They are mutable lists, so this approach

[issue39638] Keep ASDL signatures for AST nodes

2020-03-08 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue39638> ___ ___ Python-bugs-list mailing list Unsub

[issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()`

2020-03-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It was discussed in issue19776. Having separate implementation we can avoid design flaws of os.path.expanduser(). -- ___ Python tracker <https://bugs.python.org/issue39

[issue39889] Fix ast.unparse() for subscription by extended slices and tuples

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

[issue34822] Simplify AST for slices

2020-03-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, I did not know about your PR Batuhan and fixed this bug in issue39889. After fixing the bug in the current code PR 9605 only simplifies the code. So in this case the new code is not more complex than correctly written old code

[issue39903] Double decref in _elementtree.Element.__getstate__

2020-03-08 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : There is very strange code in _elementtree.Element.__getstate__ which decrement references to elements of a list before decrementing a reference to the list itself. It happens only if creating a dict fails, so it is almost impossible to reproduce, but

[issue39903] Double decref in _elementtree.Element.__getstate__

2020-03-08 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +18207 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18850 ___ Python tracker <https://bugs.python.org/issu

[issue39567] Add audit for os.walk(), os.fwalk(), Path.glob() and Path.rglob()

2020-03-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset db283b32e7580741a8b6b7f27f616cc656634750 by Serhiy Storchaka in branch 'master': bpo-39567: Document audit for os.walk, os.fwalk, Path.glob and Path.rglob. (GH-18499) https://github.com/python/cpyt

[issue39567] Add audit for os.walk(), os.fwalk(), Path.glob() and Path.rglob()

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

[issue37948] get_type_hints fails if there are un-annotated fields in a dataclass

2020-03-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 14166 does not fix this issue. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue37948> ___ ___

[issue39904] Move handling of one-argument call of type() from type.__new__() to type.__call__()

2020-03-08 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The builtin type() serves two functions: 1. When called with a single positional argument it returns the type of the argument. >>> type(1) 2. Otherwise it acts as any class when called -- creates an instance of this class (a type). It

[issue39904] Move handling of one-argument call of type() from type.__new__() to type.__call__()

2020-03-08 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +18209 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18852 ___ Python tracker <https://bugs.python.org/issu

[issue39831] Reference leak in PyErr_WarnEx()

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

[issue39831] Reference leak in PyErr_WarnEx()

2020-03-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 89fabe51af27a16ae7174ad94921e3980e28 by Serhiy Storchaka in branch '3.7': [3.7] bpo-39831: Fix a reference leak in PyErr_WarnEx(). (GH-18750). (GH-18765) https://github.com/python/cpython/commit/89fabe51af27a16ae7174ad949

[issue38249] Optimize out Py_UNREACHABLE in the release mode

2020-03-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Updated the PR according to review comments. PyNumber_ToBase() now raises SystemError for unsupported base instead of crashing. unicode_eq() asserts that unicode strings are ready (it is only called for hashed strings and if we have a hash they should be

[issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base

2020-03-08 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka nosy_count: 1.0 -> 2.0 pull_requests: +18220 pull_request: https://github.com/python/cpython/pull/18863 ___ Python tracker <https://bugs.python.org/issu

[issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base

2020-03-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry Zackery, I did not know about this issue so I wrote different PR to fix this problem. And only after writing it I have found this issue. There are several differences between your PR and PR 18863. * SystemError is raised instead of ValueError

[issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base

2020-03-08 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- versions: -Python 2.7 ___ Python tracker <https://bugs.python.org/issue38643> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base

2020-03-08 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- components: +C API -Interpreter Core ___ Python tracker <https://bugs.python.org/issue38643> ___ ___ Python-bugs-list mailin

[issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()`

2020-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is not so easy. There was reason why it was not done earlier. scandir() wastes more limited resource than memory -- file descriptors. It should also be properly closed and do not depend on the garbage collector. Consider the example: def traverse(path

[issue39903] Double decref in _elementtree.Element.__getstate__

2020-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 88944a44aa84b0f3674939019b1befbc7a9dc874 by Serhiy Storchaka in branch 'master': bpo-39903: Fix double decref in _elementtree.Element.__getstate__ (GH-18850) https://github.com/python/cpython/commit/88944a44aa84b0f3674939019b1bef

[issue39903] Double decref in _elementtree.Element.__getstate__

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

[issue39822] Use NULL instead of None for empty attrib in C implementation of Element

2020-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset dccd41e29fb9e75ac53c04ed3b097f51f8f65c4e by Serhiy Storchaka in branch 'master': bpo-39822: Use NULL instead of None for empty attrib in Element. (GH-18735) https://github.com/python/cpython/commit/dccd41e29fb9e75ac53c04ed3b097f

[issue39822] Use NULL instead of None for empty attrib in C implementation of Element

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

[issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()`

2020-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It would be slower and less reliable implementation of os.listdir(). -- ___ Python tracker <https://bugs.python.org/issue39

[issue39916] More reliable use of scandir in Path.glob()

2020-03-09 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Path.glob() uses os.scandir() in the following code. entries = list(scandir(parent_path)) It properly closes the internal file descriptor opened by scandir() if success because it is automatically closed closed when the iterator is exhausted. But

[issue39916] More reliable use of scandir in Path.glob()

2020-03-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +18237 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18880 ___ Python tracker <https://bugs.python.org/issu

[issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()`

2020-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Less reliable how? See issue39916. > so it looks like scandir as a small overhead when accumulating all results > and not using the extra info it returns. Try with larger directories. The difference may be not so small. $ python3 -m timeit -s

[issue39904] Move handling of one-argument call of type() from type.__new__() to type.__call__()

2020-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 413f01352a8268fb62bb47bde965462d7b82a06a by Serhiy Storchaka in branch 'master': bpo-39904: Move handling of one-argument call of type() from type.__new__() to type.__call__(). (GH-18852) https://github.com/python/cpyt

[issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base

2020-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset e5ccc94bbb153431698b2391df625e8d47a93276 by Serhiy Storchaka in branch 'master': bpo-38643: Raise SystemError instead of crashing when PyNumber_ToBase is called with invalid base. (GH-18863) https://github.com/python/cpyt

[issue39904] Move handling of one-argument call of type() from type.__new__() to type.__call__()

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

[issue38249] Optimize out Py_UNREACHABLE in the release mode

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

[issue38249] Optimize out Py_UNREACHABLE in the release mode

2020-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset eebaa9bfc593d5a46b293c1abd929fbfbfd28199 by Serhiy Storchaka in branch 'master': bpo-38249: Expand Py_UNREACHABLE() to __builtin_unreachable() in the release mode. (GH-16329) https://github.com/python/cpyt

[issue36287] Make ast.dump() not output optional default fields

2020-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset b7e9525f9c7ef02a1d2ad8253afdeb733b0951d4 by Serhiy Storchaka in branch 'master': bpo-36287: Make ast.dump() not output optional fields and attributes with default values. (GH-18843) https://github.com/python/cpyt

[issue39199] Improve the AST documentation

2020-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: As you worked much with ast.dump(), what multi-line formatting do you prefer, the current Module( body=[ If( test=Name(id='x', ctx=Load()), body=[

[issue39923] Command errored out with exit status 1: while jsonlib

2020-03-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> json module install error i was use windows 10 pro 64 bit, pls give solutions to rectify this issue ___ Python tra

[issue39921] json module install error i was use windows 10 pro 64 bit, pls give solutions to rectify this issue

2020-03-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> third party stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue34822] Simplify AST for slices

2020-03-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 13d52c268699f199a8e917a0f1dc4c51e5346c42 by Serhiy Storchaka in branch 'master': bpo-34822: Simplify AST for subscription. (GH-9605) https://github.com/python/cpython/commit/13d52c268699f199a8e917a0f1dc4c

[issue34822] Simplify AST for slices

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

<    21   22   23   24   25   26   27   28   29   30   >