[issue36027] Support negative exponents in pow() where a modulus is specified.

2021-06-13 Thread Mark Dickinson
Change by Mark Dickinson : -- pull_requests: +25287 pull_request: https://github.com/python/cpython/pull/26703 ___ Python tracker ___

[issue36027] Support negative exponents in pow() where a modulus is specified.

2021-06-13 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 10.0 -> 11.0 pull_requests: +25288 pull_request: https://github.com/python/cpython/pull/26702 ___ Python tracker

[issue44400] Propose random.randbool()

2021-06-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: > I would like to get opinions from Raymond and then > proceed with this issue. I concur with Steven and Serhiy and don't think this should be added. -- resolution: -> rejected stage: -> resolved status: open -> closed

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

2021-06-13 Thread E. Paine
E. Paine added the comment: Reproducible in Python 3.9. The issue occurs because functools.partial is a class, not function. I believe the fix is simply something like: try: callit.__name__ = func.__name__ except AttributeError: callit.__name__ = type(func).__name__ This will use

[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

[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

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

2021-06-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: > There's also a somewhat arbitrary choice to be made here: > do we consider NaNs to be negative or positive? > That is, do we want NaNs to sort to the beginning of the > list, or the end? I had suggested putting NaNs at the beginning because that is

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

2021-06-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Maybe add two key functions for making NaN either the smallest > or the largest number? SQL does this with NULLS FIRST or NULLS LAST but it is a nuisance. I think it better to opt for simplicity and choose a default. --

[issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores.

2021-06-13 Thread Bodo Graumann
Bodo Graumann added the comment: Unfortunately this is not quite finished yet. First of all, the change is bigger than what is documented: “Changed in version 3.9: Hyphens and spaces are converted to underscore.“ In reality, now | Normalization works as follows: all non-alphanumeric |

[issue44406] Divergent sys.prefix behavior causes `python -m build` command to fail when in virtual environment

2021-06-13 Thread Paul Moore
Paul Moore added the comment: I don't inderstand what "discrepancy" you mean here. The documentation you quote explains the behaviour, and I don't see the problem. If build is failing, why do you not think that is a bug in build? I can only see one call to venv.EnvBuilder in the code you

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

2021-06-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: > How common match-case statements with literal integers? Nothing is common yet because the feature hasn't been released ;-) I suspect that if match-case were optimized for integer constants, they would be used. In discussions about case statements,

[issue44399] log rotator cookbook example might waste disk space

2021-06-13 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: docs@python -> vinay.sajip nosy: +vinay.sajip ___ Python tracker ___ ___

[issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2'

2021-06-13 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +25289 pull_request: https://github.com/python/cpython/pull/26704 ___ Python tracker

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

2021-06-13 Thread Mark Dickinson
Mark Dickinson added the comment: @Serhiy: can this be closed again? Does GH-26679 need to be backported to the 3.10 branch? -- ___ Python tracker ___

[issue16845] warnings.simplefilter should validate input

2021-06-13 Thread Joannah Nanjekye
Joannah Nanjekye added the comment: @Bonifacio2, As commented on the PR, I think opening a PR with a patch close to what @berker.peksag suggested looks more elaborate, IMHO. Thanks for your contribution. -- nosy: +nanjekyejoannah ___ Python

[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 point of view because all rich

[issue44399] log rotator cookbook example might waste disk space

2021-06-13 Thread Vinay Sajip
Vinay Sajip added the comment: The cookbook example is (by design) limited in scope and doesn't especially discuss usage in multi-thread or multi-process scenarios - as with other examples in the cookbook which aren't specifically concerned with such scenarios. I don't think this is a

[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 ___ ___

[issue44410] Exception in AsyncMock side_effect cases incorrect refcount

2021-06-13 Thread Daniel Andersson
New submission from Daniel Andersson : Dear maintainers, I discovered an unexpected behavior when the `side_effect` of an `AsyncMock` includes an exception. The test case below fails but I expected it to pass: ``` import sys import unittest from unittest.mock import AsyncMock class A:

[issue22334] test_tcl.test_split() fails on "x86 FreeBSD 7.2 3.x" buildbot

2021-06-13 Thread Jacob Walls
Change by Jacob Walls : -- nosy: +jacobtylerwalls nosy_count: 5.0 -> 6.0 pull_requests: +25293 pull_request: https://github.com/python/cpython/pull/26687 ___ Python tracker

[issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2'

2021-06-13 Thread miss-islington
miss-islington added the comment: New changeset f30f484e9660c6ad5d5a554869593d14d709a7f4 by Miss Islington (bot) in branch '3.10': bpo-44389: Remove duplicate SSL_OP_NO_TLSv1_2 flag (GH-26680) https://github.com/python/cpython/commit/f30f484e9660c6ad5d5a554869593d14d709a7f4 --

[issue44409] compile raises SyntaxError with undocumented lineno attribute None

2021-06-13 Thread Florian Weimer
New submission from Florian Weimer : This example results in an undocumented value None for the lineno attribute: ``` source = b"\xef\xbb\xbf#coding: utf8\nprint('\xe6\x88\x91')\n" try: compile(source, filename="example.py", mode="exec") except SyntaxError as e: print(str(e))

[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2021-06-13 Thread Jacob Walls
Change by Jacob Walls : -- nosy: +jacobtylerwalls nosy_count: 7.0 -> 8.0 pull_requests: +25291 pull_request: https://github.com/python/cpython/pull/26687 ___ Python tracker

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

2021-06-13 Thread miss-islington
miss-islington added the comment: New changeset 128899d8b8d65d86bd9bbea6801e9f36e6f409f2 by Miss Islington (bot) in branch '3.10': bpo-43475: Fix the Python implementation of hash of Decimal NaN (GH-26679) https://github.com/python/cpython/commit/128899d8b8d65d86bd9bbea6801e9f36e6f409f2

[issue44411] regrtests fail with segfault after failing calls to malloc

2021-06-13 Thread Jack DeVries
New submission from Jack DeVries : When running regrtests via `./python.exe -m test` on my system, several warnings about failing calls to malloc are generated during `test_decorators`. Then, a segmentation fault happens shortly thereafter in `test_descrtut`. The most recent commit on the

[issue39950] Add pathlib.Path.hardlink_to()

2021-06-13 Thread Barney Gale
Change by Barney Gale : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.10 -Python 3.9 ___ Python tracker ___

[issue44399] log rotator cookbook example might waste disk space

2021-06-13 Thread mori-b
mori-b added the comment: Indeed this situation would rise only under misusage of the log, where multiple processes inherit by mistake or by wrong design a file descriptor of a same log file (Regarding the threads case I unfortunately cannot reproduce). While this kind of misusage doesn't

[issue44413] OverflowError: mktime argument out of range after 2019

2021-06-13 Thread Vyacheslav
New submission from Vyacheslav : date_str = "2019-06-06 10:02:00" datetime_obj = datetime.strptime(date_str, "%Y-%m-%d %H:%M:%S") datetime_obj_utc1 = datetime_obj.replace(tzinfo=pytz.timezone("America/New_York")) datetime_obj_utc2 =

[issue44136] Remove pathlib flavours

2021-06-13 Thread Barney Gale
Barney Gale added the comment: Depends: bpo-39899, bpo-43757, bpo-44316, bpo-44403, bpo-44412 -- ___ Python tracker ___ ___

[issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2'

2021-06-13 Thread Christian Heimes
Christian Heimes added the comment: New changeset bf527277d4e4907e32d76ca7ba667ab3149fe258 by Christian Heimes in branch 'main': bpo-44389: Fix deprecation of OP_NO_TLSv1_3 (GH-26700) https://github.com/python/cpython/commit/bf527277d4e4907e32d76ca7ba667ab3149fe258 --

[issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2'

2021-06-13 Thread miss-islington
Change by miss-islington : -- pull_requests: +25290 pull_request: https://github.com/python/cpython/pull/26705 ___ Python tracker ___

[issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2'

2021-06-13 Thread Christian Heimes
Christian Heimes added the comment: OpenSSL has deprecated these constants: > SSL_OP_NO_SSLv3, SSL_OP_NO_TLSv1, SSL_OP_NO_TLSv1_1, SSL_OP_NO_TLSv1_2, > SSL_OP_NO_TLSv1_3, SSL_OP_NO_DTLSv1, SSL_OP_NO_DTLSv1_2 > > As of OpenSSL 1.1.0, these options are deprecated, use >

[issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2'

2021-06-13 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Thanks, Christian. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2021-06-13 Thread Mark Dickinson
Mark Dickinson added the comment: @realead > This change makes life harder for people trying to get sane behavior with > sets [...] Yes, code that assumes that all NaNs have the same hash value will need to change. But that doesn't seem unreasonable for objects that are already considered

[issue24132] Direct sub-classing of pathlib.Path

2021-06-13 Thread Barney Gale
Change by Barney Gale : -- pull_requests: +25298 pull_request: https://github.com/python/cpython/pull/26708 ___ Python tracker ___

[issue44136] Remove pathlib flavours

2021-06-13 Thread Barney Gale
Change by Barney Gale : -- pull_requests: +25297 pull_request: https://github.com/python/cpython/pull/26708 ___ Python tracker ___

[issue44412] Add os.path.fileuri() function

2021-06-13 Thread Barney Gale
Change by Barney Gale : -- keywords: +patch pull_requests: +25296 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26708 ___ Python tracker ___

[issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2'

2021-06-13 Thread miss-islington
miss-islington added the comment: New changeset 4becc569a606102bce624a4e28f4068317d09f42 by Miss Islington (bot) in branch '3.10': [3.10] bpo-44389: Fix deprecation of OP_NO_TLSv1_3 (GH-26700) (GH-26705) https://github.com/python/cpython/commit/4becc569a606102bce624a4e28f4068317d09f42

[issue44389] Modules/_ssl.c, repeated 'SSL_OP_NO_TLSv1_2'

2021-06-13 Thread Christian Heimes
Change by Christian Heimes : -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker ___

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

2021-06-13 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +25292 pull_request: https://github.com/python/cpython/pull/26706 ___ Python tracker

[issue44411] regrtests fail with segfault after failing calls to malloc

2021-06-13 Thread Jack DeVries
Change by Jack DeVries : -- components: +Library (Lib), macOS nosy: +ned.deily, ronaldoussoren ___ Python tracker ___ ___

[issue44411] regrtests fail with segfault after failing calls to malloc

2021-06-13 Thread Jack DeVries
Change by Jack DeVries : -- keywords: +patch pull_requests: +25295 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26707 ___ Python tracker ___

[issue37880] For argparse add_argument with action='store_const', const should default to None.

2021-06-13 Thread Jack DeVries
Change by Jack DeVries : -- keywords: +patch pull_requests: +25294 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26707 ___ Python tracker ___

[issue44412] Add os.path.fileuri() function

2021-06-13 Thread Barney Gale
New submission from Barney Gale : Proposal: - Introduce `os.path.fileuri()` function that produces a 'file://' URI - Adjust `PurePosixPath.to_uri()` to call `posixpath.fileuri()` - Adjust `PureWindowsPath.to_uri()` to call `ntpath.fileuri()` - Adjust `nturl2path.pathname2url()` to call

[issue22334] test_tcl.test_split() fails on "x86 FreeBSD 7.2 3.x" buildbot

2021-06-13 Thread Jacob Walls
Change by Jacob Walls : -- pull_requests: -25293 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22334] test_tcl.test_split() fails on "x86 FreeBSD 7.2 3.x" buildbot

2021-06-13 Thread Jacob Walls
Jacob Walls added the comment: Sorry for noise; I typo-d when linking a PR on GitHub. Unlinked. -- ___ Python tracker ___ ___

[issue22334] test_tcl.test_split() fails on "x86 FreeBSD 7.2 3.x" buildbot

2021-06-13 Thread Jacob Walls
Change by Jacob Walls : -- nosy: -jacobtylerwalls ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42998] pathlib.Path: add `username` argument to `home()`

2021-06-13 Thread Barney Gale
Barney Gale added the comment: Per discussion, expanduser('~other') is considered unreliable, and we shouldn't add new functions that call through to it. Resolving as 'rejected'. -- resolution: -> rejected stage: patch review -> resolved status: open -> closed

[issue44269] smtplib AUTH command doesn't handle EAI arguments

2021-06-13 Thread John L
Change by John L : -- keywords: +patch pull_requests: +25299 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26709 ___ Python tracker ___

[issue44386] importlib and math.pi interact strangely

2021-06-13 Thread Ned Deily
Change by Ned Deily : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue44388] venv API Docs for EnvBuilder.ensure_directories incorrectly describe behavior

2021-06-13 Thread Ned Deily
Change by Ned Deily : -- nosy: +vinay.sajip ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44414] from __future__ import annotations breaks profiler's handling of dataclasses

2021-06-13 Thread James Wilcox
New submission from James Wilcox : This program behaves differently when run under the profiler (either profile or cProfile) versus when run normally. ``` from __future__ import annotations # *** import dataclasses @dataclasses.dataclass class C: x: dataclasses.InitVar[int] def

[issue44409] compile raises SyntaxError with undocumented lineno attribute None

2021-06-13 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Well, in both cases this means that the line number is not available. I think None is a bit cleaner in this regard. -- ___ Python tracker

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

2021-06-13 Thread Arjun
Change by Arjun : -- pull_requests: +25302 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26714 ___ Python tracker ___

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

2021-06-13 Thread realead
realead added the comment: @mark.dickinson > ...my expectation was that there would be few cases of breakage, and that for > those few cases it shouldn't be difficult to fix the breakage. This expectation is probably correct. My issue is somewhat only partly on-topic here: If one wants to

[issue43425] test_peg_generator.test_c_parser emits DeprecationWarning due to distutils

2021-06-13 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25301 pull_request: https://github.com/python/cpython/pull/26713 ___ Python tracker

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

2021-06-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: > If one wants to have all NaNs in one equivalency class > (e.g. if used as a key-value for example in pandas) it > is almost impossible to do so in a consistent way > without taking a performance hit. ISTM the performance of the equivalent class case is

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

2021-06-13 Thread Rajeev Chaurasia
New submission from Rajeev Chaurasia : I am running an application using cronjob. This application runs on Linux(X86_64) platform where inside a loop we have print() and sys.stdout.flush() statements. This loop iterates around 500 times and after the loop we have few more sys.stdout.flush()

[issue44414] from __future__ import annotations breaks profiler's handling of dataclasses

2021-06-13 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- nosy: +Jelle Zijlstra ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44399] log rotator cookbook example might waste disk space

2021-06-13 Thread Vinay Sajip
Vinay Sajip added the comment: > But I understand if this is out of scope. I think it's out of scope here (as discussion of such issues will obscure the basic point about how to use the namer and rotator). However, it might be useful to have a "gotchas" section somewhere in the logging

[issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores.

2021-06-13 Thread STINNER Victor
STINNER Victor added the comment: > The codecs api feels extremely well-fitting for integrating iconv in python > and any alternative I can think of seems unsatisfactory. This issue is now closed, would you mind to open a new issue? -- ___ Python

[issue44409] compile raises SyntaxError with undocumented lineno attribute None

2021-06-13 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +3.10regression, 3.9regression -patch ___ Python tracker ___ ___ Python-bugs-list

[issue44409] compile raises SyntaxError with undocumented lineno attribute None

2021-06-13 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +25300 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26712 ___ Python tracker

[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2021-06-13 Thread Jacob Walls
Jacob Walls added the comment: Both this ticket and #19094 started from one method in urllib.parse and then generalized a proposal for the rest of the submodule to move away from duck-typing and to instead raise TypeErrors (or at least some error) for invalid types. The attached PR does

[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2021-06-13 Thread Jacob Walls
Jacob Walls added the comment: Well, now I've looked at the CPython test failure more closely, and it's in `test.test_venv.EnsurePipTest` where we just download latest pip. Their release cadence suggests a new release in July, about 2-4 weeks from now. So I'll wait on adding the

[issue19007] precise time.time() under Windows 8: use GetSystemTimePreciseAsFileTime

2021-06-13 Thread Eryk Sun
Eryk Sun added the comment: > What are the expected benefits from changing? Just a higher > resolution? I'm not sure that's worth anything if it's inaccurate. GetSystemTimePreciseAsFileTime() returns an accurate timestamp, which is the current system time plus the difference between the

[issue43425] test_peg_generator.test_c_parser emits DeprecationWarning due to distutils

2021-06-13 Thread miss-islington
miss-islington added the comment: New changeset 2b57ad3f5382edb6fe2dfe3c721573fbf25a826f by Miss Islington (bot) in branch '3.10': bpo-43425: Update test_c_parser not to use TempdirManager (GH-26693) https://github.com/python/cpython/commit/2b57ad3f5382edb6fe2dfe3c721573fbf25a826f

[issue44328] time.monotonic() should use a different clock source on Windows

2021-06-13 Thread Ryan Hileman
Ryan Hileman added the comment: > The monotonic clock should thus be based on QueryUnbiasedInterruptTime My primary complaint here is that Windows is the only major platform with a low resolution monotonic clock. Using QueryUnbiasedInterruptTime() on older OS versions wouldn't entirely help

[issue44328] time.monotonic() should use a different clock source on Windows

2021-06-13 Thread Eryk Sun
Eryk Sun added the comment: On second thought, starting with Windows 8, WaitForSingleObject() and WaitForMultipleObjects() exclude time when the system is suspended. For consistency, an external deadline (e.g. for SIGINT support) should work the same way. The monotonic clock should thus be

[issue44316] Support preserving path meaning in os.path.normpath() and abspath()

2021-06-13 Thread Eryk Sun
Eryk Sun added the comment: I think separate keep_curdir and keep_pardir options is over-complicating the signature. Also, I'd prefer to remove a dot component if it's not the first component since there's no reason to keep it. If you plan to use normpath() in pathlib, then the case for

[issue44310] Document that lru_cache uses hard references

2021-06-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset fafcfff9262ae9dee03a6638dfcbcfc23a7b by Raymond Hettinger in branch 'main': bpo-44310: Note that lru_cache keep references to both arguments and results (GH-26715)

[issue44310] Document that lru_cache uses hard references

2021-06-13 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +25304 pull_request: https://github.com/python/cpython/pull/26716 ___ Python tracker

[issue44310] Document that lru_cache uses hard references

2021-06-13 Thread Raymond Hettinger
Change by Raymond Hettinger : -- pull_requests: +25303 pull_request: https://github.com/python/cpython/pull/26715 ___ Python tracker ___

[issue44310] Document that lru_cache uses hard references

2021-06-13 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: duplicate -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___