[issue39435] pickle: inconsistent arguments pickle.py vs _pickle.c vs docs

2020-01-23 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +17547 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18160 ___ Python tracker ___

[issue39439] Windows Multiprocessing in Virtualenv: sys.prefix is incorrect

2020-01-23 Thread Adam Meily
Change by Adam Meily : -- pull_requests: +17546 pull_request: https://github.com/python/cpython/pull/18159 ___ Python tracker ___

[issue39439] Windows Multiprocessing in Virtualenv: sys.prefix is incorrect

2020-01-23 Thread Adam Meily
Change by Adam Meily : -- pull_requests: +17545 pull_request: https://github.com/python/cpython/pull/18158 ___ Python tracker ___

[issue39439] Windows Multiprocessing in Virtualenv: sys.prefix is incorrect

2020-01-23 Thread Adam Meily
Change by Adam Meily : -- pull_requests: +17544 pull_request: https://github.com/python/cpython/pull/18157 ___ Python tracker ___

[issue38092] environment variables not passed correctly using new virtualenv launching in windows and python3.7+

2020-01-23 Thread Adam Meily
Change by Adam Meily : -- pull_requests: +17543 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/18157 ___ Python tracker ___

[issue39439] Windows Multiprocessing in Virtualenv: sys.prefix is incorrect

2020-01-23 Thread Eryk Sun
Eryk Sun added the comment: > can you confirm that the fix is to just change spawn.get_executable() > to return sys.executable, like it was prior to the PR mentioned in > the other ticket? Yes, in spawn.py, change `_python_exe = sys._base_executable` to `_python_exe = sys.executable`. This

[issue39439] Windows Multiprocessing in Virtualenv: sys.prefix is incorrect

2020-01-23 Thread Adam Meily
Adam Meily added the comment: OK, that makes sense. For 3.7, I can create a PR for that corrects the order of arguments passed into _winapi.CreateProcess For 3.8 / master, the problem appears to be that the check in popen_spawn_win32.py to set the subprocess env is failing because

[issue39440] Use PyNumber_InPlaceAdd in sum() for the second iteration onward

2020-01-23 Thread edk
edk added the comment: It's not only sequences. But I didn't know this had come up before, sorry. Maybe the nature of the warning in the source code s a bit misleading? -- stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue39440] Use PyNumber_InPlaceAdd in sum() for the second iteration onward

2020-01-23 Thread Brandt Bucher
Change by Brandt Bucher : -- resolution: -> duplicate ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39440] Use PyNumber_InPlaceAdd in sum() for the second iteration onward

2020-01-23 Thread Brandt Bucher
Brandt Bucher added the comment: Prior discussion at https://bugs.python.org/issue18305. Note the final comment. In short, this is a breaking semantic change, and the general consensus is that using sum for sequence concatenation is an anti-pattern. -- nosy: +brandtbucher

[issue39440] Use PyNumber_InPlaceAdd in sum() for the second iteration onward

2020-01-23 Thread Ammar Askar
Change by Ammar Askar : -- keywords: +patch pull_requests: +17542 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18156 ___ Python tracker ___

[issue35182] Popen.communicate() breaks when child closes its side of pipe but not exits

2020-01-23 Thread Gregory P. Smith
Gregory P. Smith added the comment: thanks everyone! -- resolution: -> fixed stage: patch review -> commit review status: open -> closed versions: +Python 3.9 ___ Python tracker

[issue35182] Popen.communicate() breaks when child closes its side of pipe but not exits

2020-01-23 Thread miss-islington
miss-islington added the comment: New changeset 61b3484cdf27ceca1c1069a351487d2db4b2b48c by Miss Islington (bot) (Alex Rebert) in branch '3.7': [3.7] bpo-35182: fix communicate() crash after child closes its pipes (GH-18117) (GH-18151)

[issue35182] Popen.communicate() breaks when child closes its side of pipe but not exits

2020-01-23 Thread miss-islington
miss-islington added the comment: New changeset 5654f83b9706af88040f515791f1cdc5d81cd9d6 by Miss Islington (bot) (Alex Rebert) in branch '3.8': [3.8] bpo-35182: fix communicate() crash after child closes its pipes (GH-18117) (GH-18148)

[issue39440] Use PyNumber_InPlaceAdd in sum() for the second iteration onward

2020-01-23 Thread edk
New submission from edk : The C implementation of sum() contains this comment: /* It's tempting to use PyNumber_InPlaceAdd instead of PyNumber_Add here, to avoid quadratic running time when doing 'sum(list_of_lists, [])'. However, this would produce a

[issue39439] Windows Multiprocessing in Virtualenv: sys.prefix is incorrect

2020-01-23 Thread Eryk Sun
Eryk Sun added the comment: This is a duplicate of issue 38092. The required change to fix this is very simple, if you want to work on a PR. -- nosy: +eryksun resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> environment variables not passed

[issue39439] Windows Multiprocessing in Virtualenv: sys.prefix is incorrect

2020-01-23 Thread Adam Meily
New submission from Adam Meily : I upgraded from Python 3.7.1 to 3.7.6 and began noticing a behavior that was breaking my code. My code detects if it's running in a virtualenv. This check worked in 3.7.1 but is broken in 3.7.6. >From the documentation, sys.prefix and sys.exec_prefix should

[issue17005] Add a topological sort algorithm

2020-01-23 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 65ecc390c1fa5acdd6348ae3f9843bbdcd8870d1 by Pablo Galindo in branch 'master': bpo-17005: Minor improvements to the documentation of TopologicalSorter (GH-18155)

[issue39436] Strange behavior of comparing int and float numbers

2020-01-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: Further to what Matthew said, this is not just a Python oddity. It applies to just about all programming languages, including C, C++, Java, Javascript, Ruby, etc. Some of them have even less precision by default. Floats are not the same as the real numbers

[issue39438] better handling of foreign signal handlers in signal.signal

2020-01-23 Thread Steven G. Johnson
New submission from Steven G. Johnson : In embedded Python, if the embedding code sets a signal handler (e.g. for SIGINT), then signal.getsignal(SIGINT) returns None. However, signal.signal(SIGINT, signal.getsignal(SIGINT)) throws a TypeError, even though it should logically be a no-op.

[issue17005] Add a topological sort algorithm

2020-01-23 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +17541 pull_request: https://github.com/python/cpython/pull/18155 ___ Python tracker ___

[issue39437] collections.Counter support multiplication

2020-01-23 Thread Ammar Askar
Ammar Askar added the comment: Duplicate of https://bugs.python.org/issue25478 See Raymond's open PR here: https://github.com/python/cpython/pull/6574 -- nosy: +ammar2 resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Consider adding a normalize()

[issue39426] Pickler docstring misstates default and highest protocols

2020-01-23 Thread Mark Dickinson
Change by Mark Dickinson : -- keywords: +patch pull_requests: +17540 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18154 ___ Python tracker ___

[issue39431] Mention nonlocal too in assignment quirk

2020-01-23 Thread Terry J. Reedy
Change by Terry J. Reedy : -- stage: -> patch review type: -> behavior versions: +Python 3.7 ___ Python tracker ___ ___

[issue39437] collections.Counter support multiplication

2020-01-23 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39431] Mention nonlocal too in assignment quirk

2020-01-23 Thread miss-islington
Change by miss-islington : -- pull_requests: +17539 pull_request: https://github.com/python/cpython/pull/18153 ___ Python tracker ___

[issue39431] Mention nonlocal too in assignment quirk

2020-01-23 Thread Terry J. Reedy
Change by Terry J. Reedy : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue39437] collections.Counter support multiplication

2020-01-23 Thread Dominick Johnson
New submission from Dominick Johnson : I would love to see collections.Counter support scalar multiplication. ## My Use Case: I am writing a python script to manage hardware selections for custom-build computers. Users are able to select various options from a web interface, and the script

[issue39435] pickle: inconsistent arguments pickle.py vs _pickle.c vs docs

2020-01-23 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39436] Strange behavior of comparing int and float numbers

2020-01-23 Thread Matthew Barnett
Change by Matthew Barnett : -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39436] Strange behavior of comparing int and float numbers

2020-01-23 Thread Matthew Barnett
Matthew Barnett added the comment: Python floats have 53 bits of precision, so ints larger than 2**53 will lose their lower bits (assumed to be 0) when converted. -- nosy: +mrabarnett resolution: -> not a bug ___ Python tracker

[issue39431] Mention nonlocal too in assignment quirk

2020-01-23 Thread miss-islington
miss-islington added the comment: New changeset 5a2356be1a3f4a9b2e509a16062016b7d9dee7e9 by Miss Islington (bot) in branch '3.8': bpo-39431: Also mention nonlocal in assignment quirk (GH-17375) https://github.com/python/cpython/commit/5a2356be1a3f4a9b2e509a16062016b7d9dee7e9 --

[issue39431] Mention nonlocal too in assignment quirk

2020-01-23 Thread miss-islington
miss-islington added the comment: New changeset 0c12d70bfdedf85c62e1c2b8c55ef4e84e6ee461 by Miss Islington (bot) in branch '3.7': bpo-39431: Also mention nonlocal in assignment quirk (GH-17375) https://github.com/python/cpython/commit/0c12d70bfdedf85c62e1c2b8c55ef4e84e6ee461 --

[issue39431] Mention nonlocal too in assignment quirk

2020-01-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset 7142df5ea23b4ce0efb72746b4b3b65414e8dcb1 by Terry Jan Reedy (Shanavas M) in branch 'master': bpo-39431: Also mention nonlocal in assignment quirk (GH-17375) https://github.com/python/cpython/commit/7142df5ea23b4ce0efb72746b4b3b65414e8dcb1

[issue39431] Mention nonlocal too in assignment quirk

2020-01-23 Thread miss-islington
Change by miss-islington : -- keywords: +patch pull_requests: +17538 pull_request: https://github.com/python/cpython/pull/18152 ___ Python tracker ___

[issue39436] Strange behavior of comparing int and float numbers

2020-01-23 Thread Petr Pisl
New submission from Petr Pisl : When python compares float and int created from the same int number should be equal like int(1) == float(1) but from 9007199254740993 this is not true. int(9007199254740993) == float(9007199254740993) is not true. The same behavior is for bigger odd

[issue37444] Differing exception between builtins and importlib when importing beyond top-level package

2020-01-23 Thread Brett Cannon
Brett Cannon added the comment: Sorry, you're right; I forgot importlib got it "right" while import got it "wrong". :) -- ___ Python tracker ___

[issue39434] Remove unnecessary logic of float __floordiv__

2020-01-23 Thread Dong-hee Na
Change by Dong-hee Na : -- versions: +Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39435] pickle: inconsistent arguments pickle.py vs _pickle.c vs docs

2020-01-23 Thread Guido Imperiale
New submission from Guido Imperiale : (1) In the documentation for loads(), the name for the first argument of loads is 'bytes_object'. The actual signature, both in pickle.py and _pickle.c, it is instead 'data'. (2) In the documentation and in pickle.py, the default value for the 'buffers'

[issue39434] Remove unnecessary logic of float __floordiv__

2020-01-23 Thread Dong-hee Na
Change by Dong-hee Na : -- title: Add float __floordiv__ fast path -> Remove unnecessary logic of float __floordiv__ ___ Python tracker ___

[issue39434] Add float __floordiv__ fast path

2020-01-23 Thread Dong-hee Na
Dong-hee Na added the comment: @mark.dickinson I extract the common function. Now maintainence cost is same as AS-IS. optimization is still work :) AS-IS: Mean +- std dev: 360 ns +- 19 ns TO-BE: Mean +- std dev: 185 ns +- 8 ns what do you think? --

[issue17005] Add a topological sort algorithm

2020-01-23 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 99e6c260d60655f3d2885af545cbc220b808d492 by Pablo Galindo in branch 'master': bpo-17005: Add a class to perform topological sorting to the standard library (GH-11583)

[issue39434] Add float __floordiv__ fast path

2020-01-23 Thread Dong-hee Na
Dong-hee Na added the comment: > (e.g., because someone decides to "fix" the floor float division) Okay, what if we create a common divmod function except for creating a tuple? -- ___ Python tracker

[issue39434] Add float __floordiv__ fast path

2020-01-23 Thread Mark Dickinson
Mark Dickinson added the comment: So the risk here is that by adding the floordiv fast path, the division code is duplicated, and that increases the risk of accidentally losing the invariant that `a // b` is interchangeable with `divmod(a, b)[0]` (e.g., because someone decides to "fix" the

[issue39421] Use-after-free in heappushpop() of heapq module

2020-01-23 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue39421] Use-after-free in heappushpop() of heapq module

2020-01-23 Thread miss-islington
miss-islington added the comment: New changeset 993811ffe75c2573f97fb3fd1414b34609b8c8db by Miss Islington (bot) in branch '3.8': bpo-39421: Fix posible crash in heapq with custom comparison operators (GH-18118)

[issue39434] Add float __floordiv__ fast path

2020-01-23 Thread Dong-hee Na
Dong-hee Na added the comment: And on the other side, >>> 3.8 // 0.0 Traceback (most recent call last): File "", line 1, in ZeroDivisionError: float divmod() I think that people expect ZeroDivisionError: float floor division by zero not the current message. I caught this optimization

[issue35182] Popen.communicate() breaks when child closes its side of pipe but not exits

2020-01-23 Thread Alex Rebert
Change by Alex Rebert : -- pull_requests: +17537 pull_request: https://github.com/python/cpython/pull/18151 ___ Python tracker ___

[issue39434] Add float __floordiv__ fast path

2020-01-23 Thread Dong-hee Na
Dong-hee Na added the comment: > Is this worth optimizing? Floating-point floor division is a comparatively > rare operation. 1. I don't want to say that this should always be optimized. 2. However, this operation is a relatively primitive python operation. I think this optimization is easy

[issue39432] Distutils generates the wrong export symbol for unicode module names

2020-01-23 Thread Stefan Behnel
Change by Stefan Behnel : -- nosy: +petr.viktorin ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39432] Distutils generates the wrong export symbol for unicode module names

2020-01-23 Thread Stefan Behnel
Change by Stefan Behnel : -- keywords: +patch pull_requests: +17536 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/18150 ___ Python tracker

[issue39421] Use-after-free in heappushpop() of heapq module

2020-01-23 Thread miss-islington
Change by miss-islington : -- pull_requests: +17535 pull_request: https://github.com/python/cpython/pull/18149 ___ Python tracker ___

[issue35182] Popen.communicate() breaks when child closes its side of pipe but not exits

2020-01-23 Thread Alex Rebert
Change by Alex Rebert : -- pull_requests: +17534 stage: backport needed -> patch review pull_request: https://github.com/python/cpython/pull/18148 ___ Python tracker ___

[issue39421] Use-after-free in heappushpop() of heapq module

2020-01-23 Thread Ned Deily
Ned Deily added the comment: New changeset c563f409ea30bcb0623d785428c9257917371b76 by Ned Deily (Miss Islington (bot)) in branch '3.6': bpo-39421: Fix posible crash in heapq with custom comparison operators (GH-18118) (GH-18146)

[issue39434] Add float __floordiv__ fast path

2020-01-23 Thread Mark Dickinson
Mark Dickinson added the comment: Is this worth optimising? Floating-point floor division is a comparatively rare operation. -- nosy: +mark.dickinson ___ Python tracker ___

[issue39434] Add float __floordiv__ fast path

2020-01-23 Thread Dong-hee Na
Change by Dong-hee Na : -- keywords: +patch pull_requests: +17533 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18147 ___ Python tracker ___

[issue39434] Add float __floordiv__ fast path

2020-01-23 Thread Dong-hee Na
Change by Dong-hee Na : -- type: -> performance ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39434] Add float __floordiv__ fast path

2020-01-23 Thread Dong-hee Na
New submission from Dong-hee Na : ./python.exe -m pyperf timeit "a = 3.5" "b = a // 2" AS-IS: Mean +- std dev: 377 ns +- 4 ns my patch: Mean +- std dev: 204 ns +- 2 ns -- assignee: corona10 messages: 360559 nosy: corona10 priority: normal severity: normal status: open title: Add float

[issue39421] Use-after-free in heappushpop() of heapq module

2020-01-23 Thread miss-islington
miss-islington added the comment: New changeset 958064f8d2b84062b0582bbae911df8ccfc11fd6 by Miss Islington (bot) in branch '3.7': bpo-39421: Fix posible crash in heapq with custom comparison operators (GH-18118)

[issue39432] Distutils generates the wrong export symbol for unicode module names

2020-01-23 Thread Stefan Behnel
Change by Stefan Behnel : -- nosy: +scoder ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39432] Distutils generates the wrong export symbol for unicode module names

2020-01-23 Thread Stefan Behnel
Change by Stefan Behnel : -- stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39421] Use-after-free in heappushpop() of heapq module

2020-01-23 Thread miss-islington
Change by miss-islington : -- pull_requests: +17531 pull_request: https://github.com/python/cpython/pull/18145 ___ Python tracker ___

[issue39421] Use-after-free in heappushpop() of heapq module

2020-01-23 Thread miss-islington
Change by miss-islington : -- pull_requests: +17532 pull_request: https://github.com/python/cpython/pull/18146 ___ Python tracker ___

[issue39421] Use-after-free in heappushpop() of heapq module

2020-01-23 Thread miss-islington
Change by miss-islington : -- pull_requests: +17530 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/18144 ___ Python tracker ___

[issue39421] Use-after-free in heappushpop() of heapq module

2020-01-23 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 79f89e6e5a659846d1068e8b1bd8e491ccdef861 by Pablo Galindo in branch 'master': bpo-39421: Fix posible crash in heapq with custom comparison operators (GH-18118)

[issue39433] curses.setupterm can raise _curses.error

2020-01-23 Thread Julien Palard
New submission from Julien Palard : Currently the curses module can raise some `_curses.error` exception directly inheriting `Exception`. This make it non-trivial for a newcomer to catch (they think they need a `from _curses import error`, or an `except Exception`, but in fact `error` is

[issue39421] Use-after-free in heappushpop() of heapq module

2020-01-23 Thread Alex Gaynor
Change by Alex Gaynor : -- keywords: +security_issue nosy: +alex ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39432] Distutils generates the wrong export symbol for unicode module names

2020-01-23 Thread da-woods
New submission from da-woods : Distuitls generates "export symbols" for extension modules to help ensure that they have have the correct linkage on Windows. https://github.com/python/cpython/blob/0d30ae1a03102de07758650af9243fd31211325a/Lib/distutils/command/build_ext.py#L692 It generates

[issue17659] no way to determine First weekday (based on locale)

2020-01-23 Thread Cédric Krier
Cédric Krier added the comment: I submitted https://github.com/python/cpython/pull/18142 which implements (based on the initial patch) a function locale.getfirstweekday(). The implementation supports glibc (if _NL_TIME_FIRST_WEEKDAY is defined) and Windows (not yet tested). I did not keep

[issue17659] no way to determine First weekday (based on locale)

2020-01-23 Thread Cédric Krier
Change by Cédric Krier : -- pull_requests: +17529 pull_request: https://github.com/python/cpython/pull/18142 ___ Python tracker ___

[issue39431] Mention nonlocal too in assignment quirk

2020-01-23 Thread Shanavas M
New submission from Shanavas M : Doc says "A special quirk of Python is that -- if no :keyword:`global` statement is in A special quirk of Python is that -- if no :keyword:`global` or :keyword:`nonlocal` effect -- assignments to names always go into the innermost scope." nonlocal should

[issue39430] tarfile.open(mode="r") race condition when importing lzma

2020-01-23 Thread Maciej Gol
Maciej Gol added the comment: Uploading fixed file (the former had a typo) -- Added file: https://bugs.python.org/file48861/test.py ___ Python tracker ___

[issue39430] tarfile.open(mode="r") race condition when importing lzma

2020-01-23 Thread Maciej Gol
Change by Maciej Gol : Removed file: https://bugs.python.org/file48860/test.py ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39430] tarfile.open(mode="r") race condition when importing lzma

2020-01-23 Thread Maciej Gol
New submission from Maciej Gol : Hey guys, We have a component that archives and unarchives multiple files in separate threads that started to misbehave recently. We have noticed a bunch of `AttributeError: module 'lzma' has no attribute 'LZMAFile'` errors, which are unexpected because our

[issue39279] Don't allow non-Ascii digits in platform.py

2020-01-23 Thread Xiang Zhang
Xiang Zhang added the comment: @Ezio, at least for my config they are all ASCII digits. But still I don't think there is any rush to change current behaviour. -- ___ Python tracker

[issue39380] ftplib uses latin-1 as default encoding

2020-01-23 Thread Eric V. Smith
New submission from Eric V. Smith : What's the reason behind this change? I love UTF-8 and all, but is there some standard (de facto or de jure) that discusses this? What does this change fix? What's the implication to existing clients? I'm not opposed to the change per se, but I'd like to

[issue39320] Handle unpacking of */** arguments and rvalues in the compiler

2020-01-23 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +17527 pull_request: https://github.com/python/cpython/pull/18141 ___ Python tracker ___

[issue39320] Handle unpacking of */** arguments and rvalues in the compiler

2020-01-23 Thread Mark Shannon
Mark Shannon added the comment: New changeset 13bc13960cc83dbd1cb5701d9a59ac9b9144b205 by Mark Shannon in branch 'master': bpo-39320: Handle unpacking of *values in compiler (GH-17984) https://github.com/python/cpython/commit/13bc13960cc83dbd1cb5701d9a59ac9b9144b205 --