[issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order

2021-05-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Possible solution: add an ordered subtype of frozenset which would keep an array of items in the original order. The compiler only creates frozenset when optimizes "x in {1, 2}" or "for x in {1, 2}". It should now create an ordered f

[issue43413] tuple subclasses allow arbitrary kwargs

2021-05-28 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- assignee: -> serhiy.storchaka versions: +Python 3.11 -Python 3.10, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issu

[issue44260] _Random.seed() is called twice

2021-05-28 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : _Random.seed() is called twice: first it is called in _Random.__new__(), then it is called in Random.__init__(). By default it reads system enthropy, so it consumes global system resource without need. -- components: Extension Modules messages

[issue44268] gettext: deprecate selecting plural form by fractional numbers (part 2)

2021-05-30 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Non-integer numbers in GNUTranslations.ngettext() are deprecated since 3.7 (see issue28692 for rationale). But I forget to add deprecation warning for default implementation (which just tests n == 1) and forget to add the "deprecated" direct

[issue44260] _Random.seed() is called twice

2021-05-30 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +25051 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26455 ___ Python tracker <https://bugs.python.org/issu

[issue21550] Add Python implementation of the tar utility

2021-05-30 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: test needed -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue43413] tuple subclasses allow arbitrary kwargs

2021-05-30 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +25052 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26456 ___ Python tracker <https://bugs.python.org/issu

[issue43413] tuple subclasses allow arbitrary kwargs

2021-05-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Surprisingly there were almost no tests for keyword arguments in subclasses. PR 26456 makes checks for some classes (like tuple, list, frozenset) more strict: if subclass does not define __init__ or __new__, it will reject arbitrary keyword arguments. It

[issue43413] tuple subclasses allow arbitrary kwargs

2021-05-30 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +rhettinger ___ Python tracker <https://bugs.python.org/issue43413> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44271] asyncio random crash with longtime run

2021-05-31 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- title: asyncio random carsh with longtime run -> asyncio random crash with longtime run ___ Python tracker <https://bugs.python.org/issu

[issue44260] _Random.seed() is called twice

2021-05-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset a6a20658814e8668966fc86de0e80a4772864781 by Serhiy Storchaka in branch 'main': bpo-44260: Do not read system entropy without need in Random() (GH-26455) https://github.com/python/cpython/commit/a6a20658814e8668966fc86de0e80a

[issue44260] _Random.seed() is called twice

2021-05-31 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.11 ___ Python tracker <https://bugs.python.or

[issue44278] Improve syntax error message for assigning to "..."

2021-06-01 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Some users can be confused by syntax error message for assigning to ellipsis [1]: >>> ... = 1 File "", line 1 ... = 1 ^^^ SyntaxError: cannot assign to Ellipsis here. Maybe you meant '==' instead of '=&

[issue44278] Improve syntax error message for assigning to "..."

2021-06-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +25071 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26477 ___ Python tracker <https://bugs.python.org/issu

[issue44278] Improve syntax error message for assigning to "..."

2021-06-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- versions: +Python 3.10 ___ Python tracker <https://bugs.python.org/issue44278> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44278] Improve syntax error message for assigning to "..."

2021-06-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> Assigning to Ellipsis should be the same as assigning to __debug__ ___ Python tracker <https://

[issue44273] Assigning to Ellipsis should be the same as assigning to __debug__

2021-06-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch nosy: +serhiy.storchaka nosy_count: 2.0 -> 3.0 pull_requests: +25072 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26477 ___ Python tracker <https://bugs.p

[issue40199] Invalid escape sequence DeprecationWarnings don't trigger by default

2021-06-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ah, there is a difference between debug and regular builds. I tested with the debug build. -- components: +Interpreter Core -Windows nosy: +ncoghlan, vstinner -paul.moore, steve.dower, tim.golden, zach.ware versions: +Python 3.10, Python 3.11

[issue44310] Document that lru_cache uses hard references

2021-06-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a full duplicate of issue19859. Both ideas of using weak references and changing documentation were rejected. -- nosy: +serhiy.storchaka resolution: -> duplicate superseder: -> functools.lru_cache keeps objects alive f

[issue44309] Add support for yescrypt in crypt.

2021-06-05 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +christian.heimes versions: +Python 3.11 -Python 3.10 ___ Python tracker <https://bugs.python.org/issue44309> ___ ___ Pytho

[issue44318] Asyncio classes missing __slots__

2021-06-05 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What is the problem with this? Setting __slots__ is needed if we want to save memory for creating a lot of instances. It can also be used for preventing adding arbitrary attributes and/or making weak references. Setting __slots__ in base class is required

[issue44323] install module fail on windows 10

2021-06-06 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- title: insttall module faid on wondows 10 -> install module fail on windows 10 ___ Python tracker <https://bugs.python.org/issu

[issue44317] Suggestion for better syntax errors in tokenizer errors

2021-06-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue43833. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue44317> ___ ___ Python-bug

[issue44339] Discrepancy between math.pow(0.0, -inf) and 0.0**-inf

2021-06-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What about math.pow(0.0, -1.0)? Should it return -inf or raise ZeroDivisionError? And what about math.pow(-0.0, -inf)? Should it return inf, -inf or nan or raise an exception? -- nosy: +serhiy.storchaka

[issue44357] Add math.cbrt() function: Cube Root

2021-06-09 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : See also issue27353. -- nosy: +lemburg, mark.dickinson, rhettinger, serhiy.storchaka, stutzbach versions: +Python 3.11 -Python 3.10 ___ Python tracker <https://bugs.python.org/issue44

[issue44355] Allow spaces in format strings

2021-06-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Syntax of format strings cannot be the same as in f-strings. {0} means the first positional argument in format string an integer literal 0 in f-string. {a[x]} means the value of literal string key "x" of keyword argument a in format string, an

[issue44357] Add math.cbrt() function: Cube Root

2021-06-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I am surprised that this was not proposed before. Perhaps because it is so easy to write x**(1/3), and if you want a real root of negative argument, it is -(-x)**(1/3). It can be slightly less accurate that the result of C library function cbrt(), but

[issue44376] Improve performance of integer exponentiation

2021-06-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Is it because exponentiation becomes slower or because multiplication becomes faster? What are absolute numbers? -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue44

[issue44380] glob.glob handling of * (asterisk) wildcard is broken

2021-06-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Only pattern beginning with a dot can match filename beginning with a dot. >From https://docs.python.org/3/library/glob.html Note that unlike fnmatch.fnmatch(), glob treats filenames beginning with a dot (.) as special cases. This phrase was added

[issue44380] glob.glob handling of * (asterisk) wildcard is broken

2021-06-10 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +nailor, petri.lehtinen ___ Python tracker <https://bugs.python.org/issue44380> ___ ___ Python-bugs-list mailing list Unsub

[issue44379] Pickling recursion error, did not import pickle

2021-06-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is because you run the code in IDLE. print(tempList) converts argument to string and write it to sys.stdout. In IDLE sys.stdout is a proxy object which uses RPC to communicate with the IDLE process which should insert the written text in the console

[issue44370] Inconsistent results for min() and max() with math.nan as argument

2021-06-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The idea of math.ieee754_total_order looks interesting, but how would it work with min/max? In https://grouper.ieee.org/groups/msc/ANSI_IEEE-Std-754-2019/background/minNum_maxNum_Removal_Demotion_v3.pdf there is a comparison of several standards and

[issue44364] Add non integral tests for `sqrt()`

2021-06-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: >>> math.sqrt(2.5) == 2.5**0.5 True >>> math.sqrt(25.25) == 25.25**0.5 True If we test the precision of math.sqrt(), would not be better to test it with data for which naive way of calculating the root returns different result? For e

[issue44364] Add non integral tests for `sqrt()`

2021-06-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 65733 and 262694 are integers in range 1..100 with largest relative errors of naive square root (with different signs). 33031 and 524557 are integers in range 1..100 with largest relative errors of naive cube root (with different signs

[issue44370] Inconsistent results for min() and max() with math.nan as argument

2021-06-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Maybe add two key functions for making NaN either the smallest or the largest number? min(1, NAN, key=nan_is_smallest) -> NAN max(1, NAN, key=nan_is_smallest) -> 1 sorted([1, NAN, 2], key=nan_is_smallest) -> [NAN, 1, 2] min(1, NAN, key=nan_is_larg

[issue43475] Worst-case behaviour of hash collision with float NaN

2021-06-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is an error in the Python implementation of Decimal.__hash__. It calls super().__hash__(), but the C implementation calls object.__hash__(). Also, the documentation for floating point hash has the same error. -- stage: resolved -> sta

[issue43475] Worst-case behaviour of hash collision with float NaN

2021-06-11 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +25265 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26679 ___ Python tracker <https://bugs.python.org/issu

[issue44400] Propose random.randbool()

2021-06-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is difficult to deprecate getrandbits() because it is one of two base methods. All Random methods call either getrandbits() or randome(). Overriding them is a way to make a new random generator. -- nosy: +serhiy.storchaka

[issue44401] const kwlist for PyArg_ParseTupleAndKeywords and PyArg_VaParseTupleAndKeywords

2021-06-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a duplicate of issue21011. We cannot change this because it breaks C API. -- nosy: +serhiy.storchaka resolution: -> wont fix stage: patch review -> resolved status: open -> closed superseder: -> PyArg_ParseTupleAndKeywords

[issue43475] Worst-case behaviour of hash collision with float NaN

2021-06-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 9f1c5f6e8af6ba3f659b2aea1e221ac9695828ba by Serhiy Storchaka in branch 'main': bpo-43475: Fix the Python implementation of hash of Decimal NaN (GH-26679) https://github.com/python/cpython/commit/9f1c5f6e8af6ba3f659b2aea1e221a

[issue44400] Propose random.randbool()

2021-06-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: As for randbool() I concur with Steven. It is too trivial and in most case you do not even need to call bool(). Alternate methods: choice((False, True)) random() < 0.5 They are less efficient than getrandbits(1), but can be easily extended

[issue44405] add program passed as string to dis module.

2021-06-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I often use the command-line interface of dis, ast, and sometimes tokenize modules. They are mature enough and not only for self-testing. If they are not documented, we need to document them. Since they read from stdin by default (no need to specify /dev

[issue44283] Add jump table for certain safe match-case statements

2021-06-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: How common match-case statements with literal integers? I expect that in most cases such magic numbers are not used directly, but as named constants. -- nosy: +serhiy.storchaka ___ Python tracker <ht

[issue43475] Worst-case behaviour of hash collision with float NaN

2021-06-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Maybe a new comparator is called for (like PY_EQ_FOR_HASH_COLLECTION), which > would yield float("nan") equivalent to float("nan") and which should be used > in hash-set/dict? It is difficult to do from technical p

[issue43475] Worst-case behaviour of hash collision with float NaN

2021-06-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Does this change need to be mentioned in What's New? -- ___ Python tracker <https://bugs.python.org/issue43475> ___ ___

[issue44415] sys.stdout.flush and print() hanging

2021-06-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What is self.logger and how do you run your application? Do you redirect its stdout and stderr and to where? -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue44

[issue44415] sys.stdout.flush and print() hanging

2021-06-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I do not know what are lib.logger.Log and lib.debugger.Tee, but I guess that lib.logger.Log() creates a logger which writes to sys.stdout, and lib.debugger.Tee() is a file-like object which writes to the specified file and to standard output. Standard

[issue44429] Tkinter Flow Geometry Manager

2021-06-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with Zachary. If the flow geometry manager be added in Tk we will add its support in Tkinter. We can even add pure Python implementation for older Tk versions. But we do not want to risk conflicting with Tk

[issue23316] Incorrect evaluation order of function arguments with *args

2021-06-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also thread "Order of positional and keyword arguments" on the Python-Dev mailing list (https://mail.python.org/archives/list/python-...@python.org/thread/I6AUYV6DVEMP7XVYVDWC62N6PK6FHX3H/). -- nosy: +serhiy

[issue44431] Add command-line functionality to uuid module

2021-06-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it would be a useful feature. But would not be better to make interface similar to interface of standard Linux command uuidgen? In any case it should support the -h or --help options. -- nosy: +serhiy.storchaka

[issue23316] Incorrect evaluation order of function arguments with *args

2021-06-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Would not be be better in long term to get rid of irregularities? It would make the grammar simpler and the documentation clearer. The only use case of such syntax in wrappers, but they always can be rewritten in other style, with natural order of

[issue23316] Incorrect evaluation order of function arguments with *args

2021-06-16 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- versions: +Python 3.11 -Python 3.4, Python 3.5 ___ Python tracker <https://bugs.python.org/issue23316> ___ ___ Python-bugs-list m

[issue44439] PickleBuffer doesn't have __len__ method

2021-06-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, LZMAFile.write() should not use len() directly on input data because it does not always work correctly with memoryview and other objects supporting the buffer protocol. It should use memoryview(data).nbytes or data = memoryview(data).cast('B

[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL

2021-06-19 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue12022> ___ ___ Python-bugs-list mailing list Un

[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL

2021-06-20 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +25391 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26809 ___ Python tracker <https://bugs.python.org/issu

[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL

2021-06-20 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +gvanrossum ___ Python tracker <https://bugs.python.org/issue12022> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL

2021-06-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 26809 makes "with" and "async with" raising TypeError instead of AttributeError for wrong types. -- ___ Python tracker <https://bug

[issue44469] Fix tests for "async with"

2021-06-20 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : In Lib/test/test_coroutines.py some tests test that the body of the "asyn with" statement with bad context manager was not executed by setting a value of a variable in the body and checking its value after executing. body_execut

[issue44469] Fix tests for "async with"

2021-06-20 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +25398 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26817 ___ Python tracker <https://bugs.python.org/issu

[issue44469] Fix tests for "async with"

2021-06-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 5d2b3a0d688cf8a33db3d266c9e7049c13766a4c by Serhiy Storchaka in branch 'main': bpo-44469: Fix tests for "async with" with bad object (GH-26817) https://github.com/python/cpython/commit/5d2b3a0d688cf8a33db3

[issue44471] Raise TypeError in ExitStack.enter_context() for bad argument

2021-06-21 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : For consistency with the "with" statement (see issue12022) ExitStack.enter_context() should raise TypeError instead of AttributeError if the argument is not a context manager. Same for AsyncExitStack.enter_async_context(). --

[issue44471] Raise TypeError in ExitStack.enter_context() for bad argument

2021-06-21 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +25401 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26820 ___ Python tracker <https://bugs.python.org/issu

[issue44471] Raise TypeError in ExitStack.enter_context() for bad argument

2021-06-21 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- dependencies: +AttributeError should report the same details when raised by lookup_special() as when raised in the REPL ___ Python tracker <https://bugs.python.org/issue44

[issue44469] Fix tests for "async with"

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

[issue37602] nonzero fixer problem

2021-06-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If no one going to provide documentation changes I propose to close this issue. -- nosy: +serhiy.storchaka status: open -> pending versions: +Python 3.11 -Python 3.6, Python 3.7, Python 3.8 ___ Python trac

[issue40801] Expose PyFloat_AsDouble at Python level: operator.as_float?

2021-06-21 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +25408 pull_request: https://github.com/python/cpython/pull/26827 ___ Python tracker <https://bugs.python.org/issue40

[issue40801] Expose PyFloat_AsDouble at Python level: operator.as_float?

2021-06-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 26827 is a draft for float.from_number() and complex.from_number(). -- versions: +Python 3.11 -Python 3.10 ___ Python tracker <https://bugs.python.org/issue40

[issue27547] Crash or freeze trying to execute b'a' * 0xFFFFFFFFFFFFFFF

2021-06-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Concur with Martin. Most likely it is an OS bug, the same as issue5614. -- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Malloc error

[issue44482] Possible resource leeak in glob in non-refcount implementations

2021-06-21 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : There is possible resource leak in glob on alternate Python implementation witch do not use reference counting to immediate releasing resources. It is in the code names = list(_iterdir(dirname, dir_fd, dironly)) where _iterdir() is a generator

[issue44482] Possible resource leeak in glob in non-refcount implementations

2021-06-21 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +25424 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26843 ___ Python tracker <https://bugs.python.org/issu

[issue44483] Fatal error in type union

2021-06-21 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The following example crashes: class TypeVar: @property def __module__(self): 1/0 str | TypeVar() Output: Fatal Python error: _Py_CheckSlotResult: Slot | of type type succeeded with an exception set Python runtime state: initialized

[issue44439] stdlib wrongly uses len() for bytes-like object

2021-06-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset bc6c12c72a9536acc96e7b9355fd69d1083a43c1 by Ma Lin in branch 'main': bpo-44439: BZ2File.write() / LZMAFile.write() handle buffer protocol correctly (GH-26764) https://github.com/python/cpython/commit/bc6c12c72a9536acc96e7b9355fd69

[issue44483] Fatal error in type union

2021-06-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset adfa1ba398c74720b42f16f06fd3ec0353599fa5 by Ken Jin in branch 'main': bpo-44483: Fix crash in union object with bad ``__module__`` (GH-26848) https://github.com/python/cpython/commit/adfa1ba398c74720b42f16f06fd3ec

[issue44439] stdlib wrongly uses len() for bytes-like object

2021-06-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 8bc26d8c9d092840054f57f9b4620de0d40d8423 by Ma Lin in branch '3.9': bpo-44439: BZ2File.write()/LZMAFile.write() handle length correctly (GH-26846) https://github.com/python/cpython/commit/8bc26d8c9d092840054f57f9b4620d

[issue44439] stdlib wrongly uses len() for bytes-like object

2021-06-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your contribution Ma Lin. -- components: +Library (Lib) resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> behavior versions: +Python 3.10, Python 3.11

[issue44439] stdlib wrongly uses len() for bytes-like object

2021-06-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 01858fbe31e8e0185edfbd3f10172f7c61391c9d by Miss Islington (bot) in branch '3.10': bpo-44439: BZ2File.write() / LZMAFile.write() handle buffer protocol correctly (GH-26764) (GH-26845) https://github.com/python/cpyt

[issue44483] Fatal error in type union

2021-06-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 7e6cad7e303b3991360a0fe332b0d21aa0f6fe5e by Miss Islington (bot) in branch '3.10': bpo-44483: Fix crash in union object with bad ``__module__`` (GH-26848) (GH-26852) https://github.com/python/cpyt

[issue44483] Fatal error in type union

2021-06-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, Checking each result individually is a right way. Not only because performance, but because calling any Python code while an error is set will cause a crash in debug build and weird bugs in release build. It is better to return as fast as you have an

[issue44482] Possible resource leeak in glob in non-refcount implementations

2021-06-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 5c7940257e1f611e7284fd504887bd29a63d0a94 by Serhiy Storchaka in branch 'main': bpo-44482: Fix very unlikely resource leak in glob in non-CPython implementations (GH-26843) https://github.com/python/cpyt

[issue44482] Possible resource leeak in glob in non-refcount implementations

2021-06-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes. I added you Guido to the nosy list to attract attention to a general issue. If the generator owns resources, it should be guaranteed closed. Since generator do not support the context manager protocol, we need to use closing(). Using generators is

[issue44482] Possible resource leeak in glob in non-refcount implementations

2021-06-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 38e021ab90b595945f15c59273c788f2f24053dc by Miss Islington (bot) in branch '3.10': bpo-44482: Fix very unlikely resource leak in glob in non-CPython implementations (GH-26843) (GH-26872) https://github.com/python/cpyt

[issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__)

2021-06-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset e9c8f784fa13ea3a51df3b72a498a3896ec9e768 by E-Paine in branch 'main': bpo-44404: tkinter `after` support callable classes (GH-26812) https://github.com/python/cpython/commit/e9c8f784fa13ea3a51df3b72a498a3

[issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__)

2021-06-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is on borderline between new feature and bugfix (depends on your interpretation of the documentation), so I decided to backport it to not yet released 3.10, but not to 3.9 which has been already used for a year. -- stage: patch review -> t

[issue20012] Re: Allow Path.relative_to() to accept non-ancestor paths

2021-06-23 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> pathlib's relative_to should behave like os.path.relpath ___ Python tracker <https://bugs.p

[issue42234] pathlib relative_to behaviour change

2021-06-23 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> pathlib's relative_to should behave like os.path.relpath ___ Python tracker <https://bugs.p

[issue20859] Context of documentation for conditional expressions

2021-06-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > "and exponentiation and conditional expressions, which group from right to > left". LGTM > "Python evaluates expressions from left to right (except for conditional > expressions)." LGTM. It would be nice to add a

[issue44501] Packing constant call arguments

2021-06-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > folding all contiguous LOAD_CONSTs (within some sort of limit ofc) into a > single tuple load and then adding an UNPACK_SEQUENCE I already experimented with this in issue33325. It does not worth an effort. For optimizing calls with constant arg

[issue44482] Possible resource leeak in glob in non-refcount implementations

2021-06-26 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +25489 pull_request: https://github.com/python/cpython/pull/26916 ___ Python tracker <https://bugs.python.org/issue44

[issue44404] tkinter's after() AttributeError with functools.partial (no attribute __name__)

2021-06-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There were some issues with the backporting bot. Seems they were temporary. Thank you for your contribution E. Paine. For this issue and others. -- resolution: -> fixed stage: patch review -> resolved status: open -&g

[issue44452] Allow paths to be joined without worrying about a leading slash

2021-06-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I understand why this problem arose. If you parse an HTTP URL, its path always starts with "/" if not empty. And you usually want to interpret it as a relative to some base directory. But lstrip('/') works well here. In any case y

[issue44518] Finalization of non-exhausted asynchronous generators is deferred

2021-06-27 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : In the following example: def gen(): try: yield 1 finally: print('finalize inner') def func(): try: for x in gen(): break finally: print('finalize outer') func() print(&

[issue44482] Possible resource leeak in glob in non-refcount implementations

2021-06-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 4861fdaf25f246eb9ee4e8161c15dad26efe895d by Serhiy Storchaka in branch '3.9': [3.9] bpo-44482: Fix very unlikely resource leak in glob in non-CPython implementations (GH-26843). (GH-26916) https://github.com/python/cpyt

[issue44110] Improve string's __getitem__ error message

2021-06-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset ed1076428cca3c8dc7d075c16a575aa390e25fb8 by Miguel Brito in branch 'main': bpo-44110: Improve string's __getitem__ error message (GH-26042) https://github.com/python/cpython/commit/ed1076428cca3c8dc7d075c16a575aa390e25fb8

[issue44110] Improve string's __getitem__ error message

2021-06-27 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.10 ___ Python tracker <https://bugs.python.or

[issue44110] Improve string's __getitem__ error message

2021-06-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your contribution Miguel. I decided to not backport this change to 3.10 because the benefit is too small in comparison with possibility to break someone's tests. -- ___ Python tracker &

[issue44518] Finalization of non-exhausted asynchronous generators is deferred

2021-06-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, I do not understand what do you mean. The problem is that non-exhausted asynchronous generators are not finalized until asyncio.run() is finished. This differs from synchronous generators which are finalized as early as possible (in CPython

[issue43232] Prohibit previously deprecated operations on asyncio.trsock.TransportSocket

2021-06-27 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- versions: +Python 3.11 -Python 3.10 ___ Python tracker <https://bugs.python.org/issue43232> ___ ___ Python-bugs-list mailin

[issue43234] Prohibit passing non-ThreadPoolExecutor executors to loop.set_default_executor following a deprecation

2021-06-27 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- versions: +Python 3.11 -Python 3.10 ___ Python tracker <https://bugs.python.org/issue43234> ___ ___ Python-bugs-list mailin

[issue44520] In Lib/urllib/parse.py quote_from_bytes, exception is thrown if bs = None

2021-06-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If you want to interpret None as an empty string, you can just write quote_from_bytes(data or b''). -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.o

[issue44518] Finalization of non-exhausted asynchronous generators is deferred

2021-06-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Inlined asyncio.run(func()) is roughly equivalent to the following code: loop = asyncio.new_event_loop() loop.run_until_complete(func()) loop.run_until_complete(loop.shutdown_asyncgens()) loop.close() If comment out loop.run_until_complete

<    8   9   10   11   12   13   14   15   16   17   >