[issue42002] Clean up initialization of the sys module

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

[issue42006] Stop using PyDict_GetItem, PyDict_GetItemString and _PyDict_GetItemId

2020-10-11 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : There are design flaws in PyDict_GetItem(), PyDict_GetItemString() and _PyDict_GetItemId(). 1. They suppress all exceptions raised internally. Most common of are MemoryError, KeyboardInterrupt and RecursionError whose raising is out of control of the

[issue42006] Stop using PyDict_GetItem, PyDict_GetItemString and _PyDict_GetItemId

2020-10-11 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +21622 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22648 ___ Python tracker <https://bugs.python.org/issu

[issue41993] Possible issues when remove not completely initialized module from sys.module

2020-10-11 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +21623 pull_request: https://github.com/python/cpython/pull/22649 ___ Python tracker <https://bugs.python.org/issue41

[issue41993] Possible issues when remove not completely initialized module from sys.module

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

[issue26964] Incorrect documentation for `-u`-flag

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

[issue42010] Generic types accept indexing/subscripting, causing confusion

2020-10-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +gvanrossum, levkivskyi ___ Python tracker <https://bugs.python.org/issue42010> ___ ___ Python-bugs-list mailing list Unsub

[issue42015] Order of decrementing reference counts in meth_dealloc

2020-10-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Do you mind to create a PR Yannick? -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue42

[issue42015] Order of decrementing reference counts in meth_dealloc

2020-10-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Yannick for your report and PR! -- ___ Python tracker <https://bugs.python.org/issue42015> ___ ___ Python-bug

[issue42018] winreg SetValue(Ex) should mention integer as an acceptable value

2020-10-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker <https://bugs.python.org/issue42

[issue42018] winreg SetValue(Ex) should mention integer as an acceptable value

2020-10-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka type: -> enhancement versions: +Python 3.10, Python 3.8 ___ Python tracker <https://bugs.python.org/issu

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

2020-10-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Few things I forget about. The new C API function should be exported in PC/python3dll.c. Also, in Include/abstract.h it should only be available for limited C API >= 3.10: #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A ... #endif

[issue42015] Order of decrementing reference counts in meth_dealloc

2020-10-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 04b8631d84a870dda456ef86039c1baf34d08500 by Yannick Jadoul in branch 'master': bpo-42015: Reorder dereferencing calls in meth_dealloc, to make sure m_self is kept alive long enough (GH-22670) https://github.com/python/cpyt

[issue42015] Order of decrementing reference counts in meth_dealloc

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

[issue41993] Possible issues when remove not completely initialized module from sys.module

2020-10-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 391a544f2a52673f6630c672e89840fd6ac36723 by Miss Skeleton (bot) in branch '3.9': bpo-41993: Fix possible issues in remove_module() (GH-22631) (GH-22647) https://github.com/python/cpython/commit/391a544f2a52673f6630c672e89840

[issue42014] shutil.rmtree calls onerror with different function than failed

2020-10-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Added Hynek, the original committer of this code. -- nosy: +giampaolo.rodola, hynek, serhiy.storchaka, tarek versions: -Python 3.5, Python 3.6, Python 3.7 ___ Python tracker <https://bugs.python.org/issue42

[issue41876] Add __repr__ for Tkinter Font objects

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

[issue41876] Add __repr__ for Tkinter Font objects

2020-10-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset b4d895336a4692c95b4533adcc5c63a489e5e4e4 by Anatoliy Platonov in branch 'master': bpo-41876: Overload __repr__ for tkinter Font objects (GH-22450) https://github.com/python/cpython/commit/b4d895336a4692c95b4533adcc5c63

[issue20184] Derby #16: Convert 50 sites to Argument Clinic across 9 files

2020-10-14 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +21664 pull_request: https://github.com/python/cpython/pull/22693 ___ Python tracker <https://bugs.python.org/issue20

[issue42033] Seemingly unnecessary complexification of foo(**kw)

2020-10-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: $ python3.8 -m timeit -s "a = {'a': 1}" "dict(**a)" 200 loops, best of 5: 113 nsec per loop $ python3.9 -m timeit -s "a = {'a': 1}" "dict(**a)" 200 loops, best

[issue24828] Segfault when using store-context AST node in a load context

2020-10-16 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue41822] Document the meaning of values for sys.float_info.rounds

2020-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Python does not set the meaning and the value of these fields itself. It exposes C constants. Should we just copy definitions from corresponding C or floating-point standards? -- ___ Python tracker <ht

[issue41822] Document the meaning of values for sys.float_info.rounds

2020-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, seems it was what Raymond proposed initially. -- ___ Python tracker <https://bugs.python.org/issue41822> ___ ___ Pytho

[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

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

[issue36583] Do not swallow exceptions in the _ssl module

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

[issue36398] A possible crash in structseq.c's structseq_repr()

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

[issue36285] Integer overflow in array.array.remove()

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

[issue35436] Add missing PyErr_NoMemory() calls

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

[issue35414] A reference counting bug in PyState_RemoveModule()

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

[issue42051] plistlib inherits XML vulnerabilities: we should document them

2020-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Seems that we can not control entity definitions and expansions. We only can limit the number of expanded entities per element (the size of self.data). What is the reasonable default limit (taking into account that every < and 〹 is a separate entity)?

[issue42051] plistlib inherits XML vulnerabilities: we should document them

2020-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, I missed that there is a handler for EntityDecl. Well, then we can fix this issue in few lines of code. I think it should be backported. We can add private flag (global or class variable) to enable entity declarations, but do not support them in 3.10

[issue38252] Use 8-byte step to detect ASCII sequence in 64bit Windows builds

2020-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset a0c603cb9d4dbb9909979313a88bcd1f5fde4f62 by Ma Lin in branch 'master': bpo-38252: Use 8-byte step to detect ASCII sequence in 64bit Windows build (GH-16334) https://github.com/python/cpython/commit/a0c603cb9d4dbb9909979313a88bcd

[issue41966] datetime.time issue with pickling in PyPy

2020-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset c304c9a7efa8751b5bc7526fa95cd5f30aac2b92 by scaramallion in branch 'master': bpo-41966: Fix pickling pure datetime.time subclasses (GH-22731) https://github.com/python/cpython/commit/c304c9a7efa8751b5bc7526fa95cd5

[issue20184] Derby #16: Convert 50 sites to Argument Clinic across 9 files

2020-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 1bcaa81e520e30f920bd69e46fbf1d67a9107ce1 by Serhiy Storchaka in branch 'master': bpo-20184: Convert termios to Argument Clinic. (GH-22693) https://github.com/python/cpython/commit/1bcaa81e520e30f920bd69e46fbf1d

[issue41966] datetime.time issue with pickling in PyPy

2020-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset a055ced9d43630cadc3c1d5edab0884f2c5131ea by Miss Skeleton (bot) in branch '3.9': bpo-41966: Fix pickling pure datetime.time subclasses (GH-22731) (GH-22747) https://github.com/python/cpython/commit/a055ced9d43630cadc3c1d5edab088

[issue41966] datetime.time issue with pickling in PyPy

2020-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 1040299e9283609f3de0f6e32a0d43458fe7f4f6 by Miss Skeleton (bot) in branch '3.8': bpo-41966: Fix pickling pure datetime.time subclasses (GH-22731) (GH-22748) https://github.com/python/cpython/commit/1040299e9283609f3de0f6e32a0d43

[issue41966] datetime.time issue with pickling in PyPy

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

[issue38252] Use 8-byte step to detect ASCII sequence in 64bit Windows builds

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

[issue28660] TextWrapper break_long_words=True, break_on_hyphens=True on long words

2020-10-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset b81c833ab51fb7d7f0f8eaace37f60ef7455aa85 by Irit Katriel in branch 'master': bpo-28660: Make TextWrapper break long words on hyphens (GH-22721) https://github.com/python/cpython/commit/b81c833ab51fb7d7f0f8eaace37f60

[issue28660] TextWrapper break_long_words=True, break_on_hyphens=True on long words

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

[issue19270] Document that sched.cancel() doesn't distinguish equal events and can break order

2020-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 5368c2b6e23660cbce7e38dc68f859c66ac349ee by Bar Harel in branch 'master': bpo-19270: Fixed sched.scheduler.cancel to cancel correct event (GH-22729) https://github.com/python/cpython/commit/5368c2b6e23660cbce7e38dc68f859

[issue13451] sched.py: speedup cancel() method

2020-10-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +21724 pull_request: https://github.com/python/cpython/pull/22759 ___ Python tracker <https://bugs.python.org/issue13

[issue11698] Improve repr for structseq objects to show named, but unindexed fields

2020-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Other problem is that the repr looks like an evaluable expression, but evaluating it will always produce error. >>> st = os.stat('/dev/null') >>> st os.stat_result(st_mode=8630, st_ino=6, st_dev=6, st_nlink=1, st_uid=0, s

[issue38144] Add the root_dir and dir_fd parameters in glob.glob()

2020-10-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +21762 pull_request: https://github.com/python/cpython/pull/22805 ___ Python tracker <https://bugs.python.org/issue38

[issue38144] Add the root_dir and dir_fd parameters in glob.glob()

2020-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for catching this. It was an error introduced by merge. -- ___ Python tracker <https://bugs.python.org/issue38

[issue41491] plistlib can't load macOS BigSur system LaunchAgent

2020-10-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Does plutil support octal (0o) and binary (0b) literals? -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue41

[issue38144] Add the root_dir and dir_fd parameters in glob.glob()

2020-10-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 1d3469988e2c1f53ca84ffdc979d548c04ba3906 by Serhiy Storchaka in branch 'master': bpo-38144: Re-add accidentally removed audition for glob. (GH-22805) https://github.com/python/cpython/commit/1d3469988e2c1f53ca84ffdc979d54

[issue42102] Make builtins.callable "generic"

2020-10-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Callable is very special generic. It differs in many ways from List or Awaitable. You cannot just use GenericAlias. Also, in contrary to list() or dict(), callable() is not a constructor, it is a predicate. callable[[int], str]() does not make sense

[issue41052] Opt out serialization/deserialization for heap type

2020-10-21 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +21812 pull_request: https://github.com/python/cpython/pull/22870 ___ Python tracker <https://bugs.python.org/issue41

[issue41052] Opt out serialization/deserialization for heap type

2020-10-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I came to the same conclusion after trying to fix it. But we cannot just do it now. We have to fix bugs in Python 3.9 and support protocols 0 and 1 for some deprecation period. Also protocols 0 and 1 are used in some third-party implementations for other

[issue42103] [security] DoS (MemError via CPU and RAM exhaustion) when processing malformed Apple Property List files in binary format

2020-10-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are two issues here. The simple one is building a large format string for struct.unpack(). It has simple solution: use f'>{n}{_BINARY_FORMAT[size]}'. The hard issue is that read(n) allocates n bytes in memory even if there are not so

[issue42103] [security] DoS (MemError via CPU and RAM exhaustion) when processing malformed Apple Property List files in binary format

2020-10-22 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +21822 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22882 ___ Python tracker <https://bugs.python.org/issu

[issue42103] [security] DoS (MemError via CPU and RAM exhaustion) when processing malformed Apple Property List files in binary format

2020-10-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 22882 fixes problem in _read_ints(), adds validation for string size, and adds many tests for mailformed binary Plists. There may be problems with recursive collections. I'll try to solve the

[issue42103] [security] DoS (MemError via CPU and RAM exhaustion) when processing malformed Apple Property List files in binary format

2020-10-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: No, with recursive collections all is good. Then I'll just add a NEWS entry and maybe few more tests. -- ___ Python tracker <https://bugs.python.org/is

[issue24165] Free list for single-digits ints

2020-10-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I agree that it is not worth to add this optimization. -- ___ Python tracker <https://bugs.python.org/issue24165> ___ ___

[issue31484] Cache single-character strings outside of the Latin1 range

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

[issue41052] Opt out serialization/deserialization for heap type

2020-10-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 8cd1dbae32d9303caac3a473d3332f17bc98c921 by Serhiy Storchaka in branch 'master': bpo-41052: Fix pickling heap types implemented in C with protocols 0 and 1 (GH-22870) https://github.com/python/cpyt

[issue41052] Opt out serialization/deserialization for heap type

2020-10-25 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +21880 pull_request: https://github.com/python/cpython/pull/22963 ___ Python tracker <https://bugs.python.org/issue41

[issue41052] Opt out serialization/deserialization for heap type

2020-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 0aaecb30483e98fc29c1f4253967d05da092f0c5 by Serhiy Storchaka in branch '3.9': [3.9] bpo-41052: Fix pickling heap types implemented in C with protocols 0 and 1 (GH-22870). (GH-22963) https://github.com/python/cpyt

[issue42147] Micro optimization for longrange iteration if step is 1

2020-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, but I do not think it is worth. If there are any issues with multiplying by 1, it may be worth to optimize multiplication of integers in general. But iterating range(1 << 1000, (1 << 1000) + 100) looks a pretty artificial example. ---

[issue41052] Opt out serialization/deserialization for heap type

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

[issue42006] Stop using PyDict_GetItem, PyDict_GetItemString and _PyDict_GetItemId

2020-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset fb5db7ec58624cab0797b4050735be865d380823 by Serhiy Storchaka in branch 'master': bpo-42006: Stop using PyDict_GetItem, PyDict_GetItemString and _PyDict_GetItemId. (GH-22648) https://github.com/python/cpyt

[issue42006] Stop using PyDict_GetItem, PyDict_GetItemString and _PyDict_GetItemId

2020-10-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: My plan is to deprecate PyDict_GetItem() and functions with same design flaw and finally remove them (in 4.0?). We cannot start to ignore exceptions in PyDict_GetItem(). It would not fix the original flaw when the user code does not check an exception

[issue42152] Use PyDict_Contains() and PyDict_SetDefault() instead of PyDict_GetItemIdWithError

2020-10-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: serhiy.storchaka priority: normal severity: normal status: open title: Use PyDict_Contains() and PyDict_SetDefault() instead of PyDict_GetItemIdWithError ___ Python tracker <https://bugs.python.org/issue42

[issue42152] Use PyDict_Contains() and PyDict_SetDefault() instead of PyDict_GetItemWithError()

2020-10-26 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : It was common to use the code PyDict_GetItem(dict, key) == NULL to check whether the key is in the dict. PyDict_GetItem() returns borrowed reference, so no clean up is needed. And if we need to check only existence of the key, we do not need to store a

[issue42152] Use PyDict_Contains() and PyDict_SetDefault() instead of PyDict_GetItemWithError()

2020-10-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +21900 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22986 ___ Python tracker <https://bugs.python.org/issu

[issue42152] Use PyDict_Contains() and PyDict_SetDefault() instead of PyDict_GetItemWithError()

2020-10-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The code uses also _PyDict_ContainsId() added in issue42006 instead of _PyDict_GetItemIdWithError(). Few uses of _PyDict_GetItemStringWithError() are left as is. I do not think it is worth to introduce _PyDict_ContainsString(). They could be rewritten

[issue42147] Micro optimization for longrange iteration if step is 1

2020-10-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think that In sum(range(1 << 1000, (1 << 1000) + 100)) it is dwarfed by repeated addition of long integers in sum(). I expect the the effect of this optimization is even less that 13% in this case. In any case, for sum(range(a, b)) it is b

[issue42152] Use PyDict_Contains() and PyDict_SetDefault() instead of PyDict_GetItemWithError()

2020-10-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset b510e101f8b5b31276bf97b921ca9247162881d2 by Serhiy Storchaka in branch 'master': bpo-42152: Use PyDict_Contains and PyDict_SetDefault if appropriate. (GH-22986) https://github.com/python/cpython/commit/b510e101f8b5b31276bf97b921ca92

[issue42155] email.utils.parsedate_to_datetime() should return None when date cannot be parsed

2020-10-26 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Documentation says that parsedate_to_datetime() performs the same function as parsedata(), but on success returns a datetime. parsedata() returns None when date cannot be parsed, but parsedate_to_datetime() raises TypeError. >>> email.utils.

[issue42096] zipfile.is_zipfile incorrectly identifying a gzipped file as a zip archive

2020-10-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue42096> ___ ___ Python-bugs-list mailing list Un

[issue42096] zipfile.is_zipfile incorrectly identifying a gzipped file as a zip archive

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

[issue42163] _replace() no longer works on platform.uname_result objects

2020-10-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +jaraco, rhettinger ___ Python tracker <https://bugs.python.org/issue42163> ___ ___ Python-bugs-list mailing list Unsub

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

2020-10-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: specified_attributes = True is also set in xml.dom.expatbuilder. Should not it be set to true in the C implementation of ElementTree? -- ___ Python tracker <https://bugs.python.org/issue42

[issue42165] Question about converting numpy float to bytes (bug??)

2020-10-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Seems that np.float64 implements the buffer protocol, i.e. it can be accepted in any function that supports the buffer protocol (for example b'abc\xc1\x1c=~o\xd3\xd5?def'.index(np.float64(0.34103))). And pickle.loads() is one of such functions,

[issue30681] email.utils.parsedate_to_datetime() should return None when date cannot be parsed

2020-10-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: >>> email.utils.parsedate_to_datetime(None) Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/email/utils.py", line 200, in parsedate_to_datetime raise ValueError('Invalid dat

[issue42096] zipfile.is_zipfile incorrectly identifying a gzipped file as a zip archive

2020-10-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a duplicate of issue28494. I concur with Gregory. What we can do -- improve the documentation. -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> is_zipfile fal

[issue42185] class body bytecode uses less efficient *_NAME opcodes

2020-10-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It cannot use LOAD_GLOBAL because the name can be not global. For example: def f(self): ... f = property(f) It cannot use STORE_FAST and LOAD_FAST because they work with specific representation of locals as array, but in a class body it can be

[issue42176] Valgrind reports "Conditional jump or move depends on uninitialised value(s)" in `PyUnicode_AsEncodedString` and `PyUnicode_Decode`

2020-10-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It points on strcmp(lower, "us_ascii") == 0. Seems that the compiler optimizes calling strcmp() with compile-time constant "us_ascii" by reading and comparing first 8 bytes as single word. But if lower contains "latin1" i

[issue42189] copy.deepcopy() no longer works on platform.uname_result objects

2020-10-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +jaraco ___ Python tracker <https://bugs.python.org/issue42189> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42143] Corruptions in func_dealloc() with partially-created function object

2020-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 350526105fa9b131d8b941ae753378b741dabb2f by Yonatan Goldschmidt in branch 'master': bpo-42143: Ensure PyFunction_NewWithQualName() can't fail after creating the func object (GH-22953) https://github.com/python

[issue42143] Corruptions in func_dealloc() with partially-created function object

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

[issue42143] Corruptions in func_dealloc() with partially-created function object

2020-10-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 60324d26b58c89d68abb23fb42f1563d395c3910 by Miss Skeleton (bot) in branch '3.9': bpo-42143: Ensure PyFunction_NewWithQualName() can't fail after creating the func object (GH-22953) (GH-23021) https://github.com/python

[issue42202] Optimize function annotation

2020-10-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Are annotations now always known at compile time? As for representation, it can also be a sequence of pairs (('x', 'int'), ('z', 'float'), ('return', 'Hoge')) or a pair of sequences (('x&#x

[issue42203] Unexpected behaviour NameError: name 'open' is not defined

2020-10-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It can happen if the code is executed very late at the shutdown stage. The builtin module is restored to its initial state (open is imported from io) to get rid of reference cycles. -- nosy: +serhiy.storchaka, vinay.sajip

[issue42202] Optimize function annotation

2020-10-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Yes, but it is bit larger than my single tuple idea in most cases. Yes, but the code for creating a dict can be simpler. In any case we will better see what format is better when try to write a code. > I am not sure this is the best option because

[issue39513] NameError: name 'open' is not defined

2020-10-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think this is a multi-level problem, and it perhaps should be solved on different levels separately. As for logging, it can be used at shutdown by user code, it may help to understand the problem with the user code, and it may work most of time. But if

[issue42203] Unexpected behaviour NameError: name 'open' is not defined

2020-10-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, solving any of issue26789 or issue39513 will likely solve also this issue. But this issue is the one which relates to asyncio tests, so there may be some flaw in tests which should be fixed too. Solving issue26789 or issue39513 will eliminate

[issue26789] logging: Trying to log during Python finalization with NameError: name 'open' is not defined

2020-10-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am not sure that its all the same issue. There may be several different issues: * Issue39513. Logging fails with confusing traceback when called late at shutdown. I think that if logging cannot work at this stage it should either do nothing or emit a

[issue39513] NameError: name 'open' is not defined

2020-10-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Issue26789 is about asyncio, but this issue about logging. -- ___ Python tracker <https://bugs.python.org/issue39

[issue42195] Inconsistent __args__ between typing.Callable and collections.abc.Callable

2020-10-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Would not be better to change typing.Callable? Attributes __origin__, __args__ and __parameters__ are not documented in the typing module. They are also not mentioned in any PEP except PEP 585. So I don't know what is intention and correct value of

[issue42217] compiler: merge co_code and co_lnotab

2020-10-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Do you mean sharing values of co_code and co_lnotab between code objects of the same module? How much memory does this save (in absolute and relative value)? Which functions have the same co_code? -- nosy: +serhiy.storchaka

[issue41835] Speed up dict vectorcall creation using keywords

2020-10-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Both changes add significant amount of code (100 and 85 lines correspondingly). Even if they speed up a particular case of dict constructor it is not common use case. I think that it would be better to reject these changes. They make maintenance harder

[issue42160] unnecessary overhead in tempfile

2020-10-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue30030. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue42160> ___ ___ Python-bug

[issue42218] SystemError in compile builtin function

2020-10-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Nice catch Zac! -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue42218> ___ ___ Python-bugs-list m

[issue42160] unnecessary overhead in tempfile

2020-10-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Instead of os.getpid() we can use a global variable, and the single callback can reset it. But is it worth? Is os.getpid() so slow? -- ___ Python tracker <https://bugs.python.org/issue42

[issue41835] Speed up dict vectorcall creation using keywords

2020-10-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Do not overestimate the importance of _PyStack_AsDict(). Most of calls (~90-95% or like) are with positional only arguments, and most of functions do not have var-keyword parameter. So efforts in last years were spent on optimizing common cases, in

[issue42160] unnecessary overhead in tempfile

2020-10-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I have tested my idea, such optimization speeds up _RandomNameSequence by 16%. At the cost of more complex code. It is not worth. -- resolution: -> rejected stage: patch review -> resolved status: open -&g

[issue42222] Modernize integer test/conversion in randrange()

2020-10-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It changes the behavior. Currently randrange(10.0) works, but with PR 23064 it would fail. See issue40046 with a ready PR for increasing coverage for the random module. If it would accepted, some tests would fail with PR 23064. If you want to deprecate

[issue42222] Modernize integer test/conversion in randrange()

2020-10-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think and always thought that integer domain functions should not accept non-integer arguments even with integer value. This is why I submitted numerous patches for deprecating and finally removing support of non-integer arguments in most of integer

<    36   37   38   39   40   41   42   43   44   45   >