[issue41343] Convert complex methods to Argument Clinic

2020-07-19 Thread Dong-hee Na


Dong-hee Na  added the comment:

Hmm, I re-ran all the benchmark.
- conjugate => It looks like noise. 
- __getnewargs__ -> consistently showing performance improvement. (2-3%)

FYI, I ran benchmarks on the macOS.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41343] Convert complex methods to Argument Clinic

2020-07-19 Thread Dong-hee Na


Dong-hee Na  added the comment:

> But I am surprised that you get a difference for conjugate() and 
> __getnewargs__. 

It could be a noise :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41342] Convert int.__round__ to Argument Clinic

2020-07-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Yes, you can do this without Argument Clinic, but Argument Clinic allows to 
hide the use of unstable private API and cumbersome code under macros and in 
generated files.

> That said, it would be great if someone were to work on building-out AC to 
> support more interesting argument patterns like those in round().

The problem is not only in Argument Clinic (and the Argument Clinic part is 
mainly solved). The problem is that currently it is not possible to express the 
signature of int.__round__() (and dict.get(), and getattr()) in Python syntax, 
and the inspect module does not support any non-Python syntax for this either. 
Once we invent the way to express it, supporting it in Argument Clinic will be 
merely technical problem.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41273] asyncio: proactor read transport: use recv_into instead of recv

2020-07-19 Thread David Bolen


David Bolen  added the comment:

First, I also no longer see the error with a local PR 21446 build on the Win10 
buildbot.

As for timing, I believe policy is to revert, but in my view it can probably 
depend on how short "a bit" is for the fix.  We've been in this state for 4-5 
days already, so one more day, for example, probably won't matter that much.

If it looks like it'll be longer, or the timing is uncertain, then I'd probably 
suggest reverting until the new PR is ready.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36777] unittest discover throws TypeError on namespace packages

2020-07-19 Thread Inada Naoki


Inada Naoki  added the comment:

This issue is not duplicate of #23882.
In the example, test1 and test1.test2 are namespace package. But they are 
specified explicitly.

`./python.exe -m unittest discover test1.test2`

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41338] test_decimal emits DeprecationWarning due to PyUnicode_FromUnicode(NULL, size)

2020-07-19 Thread Inada Naoki


Change by Inada Naoki :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41338] test_decimal emits DeprecationWarning due to PyUnicode_FromUnicode(NULL, size)

2020-07-19 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 902356a7b0564e2c9659aaec56211de4d37109d0 by Inada Naoki in branch 
'master':
bpo-41338: Fix DeprecationWarning in tests (GH-21542)
https://github.com/python/cpython/commit/902356a7b0564e2c9659aaec56211de4d37109d0


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41341] Recursive evaluation of ForwardRef (and PEP 563)

2020-07-19 Thread Joseph Perez


Joseph Perez  added the comment:

Ok, I admit that I did not think about recursive type when proposing this "fix".
I've tried an implementation that just stop when recursion is encountered in a 
PR.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41341] Recursive evaluation of ForwardRef (and PEP 563)

2020-07-19 Thread Joseph Perez


Change by Joseph Perez :


--
keywords: +patch
pull_requests: +20699
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21553

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41342] Convert int.__round__ to Argument Clinic

2020-07-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I don't have an opinion on the PR but want to point-out the Argument Clinic 
itself doesn't provide a performance benefit.  Anything that it does can also 
be done directly by the code itself, including vectorcall logic.  You should be 
able to optimize the function calls without using the Argument Clinic.

That said, it would be great if someone were to work on building-out AC to 
support more interesting argument patterns like those in round().  Ideally, AC 
would provide complete, correct support right out of the box.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41342] Convert int.__round__ to Argument Clinic

2020-07-19 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
Removed message: https://bugs.python.org/msg373973

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41340] Not very good strcpy implementation in cpython/Python/strdup.c

2020-07-19 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

I don't think we need to spend much effort on this implementation, since it 
will only be used if the system libc doesn't have a strdup already.

--
nosy: +benjamin.peterson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41045] f-string's "debug" feature is undocumented

2020-07-19 Thread Ama Aje My Fren


Ama Aje My Fren  added the comment:

Hello all,

I have attempted to resolve this issue by adding some comments to PR21464 and 
later provided a reworded PR21509 that attempts to resolve this using ideas 
from @rishi93.

Finally I have tried to document f-string within pydoc itself with PR21552.

I request please that they be marked with skip-news. Also request feedback on 
the PRs.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41045] f-string's "debug" feature is undocumented

2020-07-19 Thread Ama Aje My Fren


Change by Ama Aje My Fren :


--
pull_requests: +20698
pull_request: https://github.com/python/cpython/pull/21552

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41273] asyncio: proactor read transport: use recv_into instead of recv

2020-07-19 Thread Tony


Tony  added the comment:

Ok so I checked and the PR I am currently having a CR on fixes this issue: 
https://github.com/python/cpython/pull/21446

Do you want me to make a different PR tomorrow that fixes this specific issue 
to get it faster to master or is it ok to wait a bit?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41342] Convert int.__round__ to Argument Clinic

2020-07-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I don't have an opinion on the PR but want to point-out the Argument Clinic 
itself doesn't provide a performance benefit.  Anything that it does can also 
be done directly by the code itself, including vectorcall logic.  You should be 
able to optimize function calls without using the Argument Clinic.

That said, it would be great is someone were to work on building-out AC to 
support more interesting argument patterns like those in round().  It would be 
great if there were complete, correct support right out of the box.

--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39017] Infinite loop in the tarfile module

2020-07-19 Thread Michał Górny

Michał Górny  added the comment:

Given that a CVE was assigned for this, I think it'd be better if the news were 
in the 'Security' category and not 'Library'.

--
nosy: +mgorny

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39093] tkinter objects garbage collected from non-tkinter thread cause crash

2020-07-19 Thread E. Paine


Change by E. Paine :


--
keywords: +patch
pull_requests: +20697
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21532

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31821] pause_reading() doesn't work from connection_made()

2020-07-19 Thread Alex Grönholm

Change by Alex Grönholm :


--
nosy: +alex.gronholm

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41336] Random segfaults during zoneinfo object creation stopped using Ctrl-C

2020-07-19 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
priority: normal -> high

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41339] make queue.Queue objects iterable

2020-07-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I prefer the current API because it makes the blocking step explicit.  That 
isn't the kind of thing that should be hidden behind a "for" or buried in 
another tool that accepts an iterable argument, sorted(q), for example. 

Also, the get() method supports two arguments "block" and "timeout" which would 
be inaccessible by a iterator.

The typical use case for queue objects is to process the gets one-at-a-time, 
blocking until a job arrives.  Queues typically start out empty.  And if they 
become empty later, it doesn't usually mean that there will be no more job 
requests.  This would make it awkward to use the proposed feature in real code 
without introducing an unnecessary extra level of nesting.

-- Code with current API --
while True:
job = q.get()
work(job)

-- Code with proposed API --
while True:  # Needed to restart when the queue is empty.
for job in q:# Consumes all currently available jobs.
work(job)# Now nested two layers deep.
sleep(0.1)   # Prevent spin-wait bug.

For most users, the proposed feature would likely be a distraction that leads 
them away from the cleaner, lower overhead solution with an explicit get().  
Also, the spin-wait bug is hard to see during code review or debugging.

FWIW, there is a race-condition in your definition of __next__().  The LBYL 
logic should probably be replaced with EAFP logic putting a get_nowait() inside 
a try/except.

I suggest taking this to the python-ideas mail list to discuss the pros and 
cons.  There are cases where a for-loop would look nicer than what we have now, 
so people might find the proposal acceptable despite all the problems listed 
above.

I'll mark this as closed.  If the idea gains traction on the mail list, feel 
free to re-open.

--
resolution:  -> later
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41273] asyncio: proactor read transport: use recv_into instead of recv

2020-07-19 Thread Tony


Tony  added the comment:

I see, I'll start working on a fix soon

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41273] asyncio: proactor read transport: use recv_into instead of recv

2020-07-19 Thread David Bolen


David Bolen  added the comment:

I can at least confirm that this commit is the source of the issue on the 
Windows 10 buildbot.  Interactively, it fails every time with it in place 
(unlike the buildbot which has had the occasional success) and passes reliably 
with it reverted.

The error arises during the SubprocessProactorTests test suite, but seemingly 
not with a specific test, just something that shows up when the entire suite is 
run.  At least I haven't been able to get it to occur by running individual 
tests.

Since the buildbot test output hides the underlying exception, here's the 
details of the two unraisable exceptions in question from 
test_asyncio.test_subprocess.SubprocessProactorTests.  I enabled tracemalloc 
but the original allocation is from the common utils module so probably not 
that much extra help:

D:\test\cpython\lib\asyncio\windows_utils.py:112: ResourceWarning: unclosed 

  _warn(f"unclosed {self!r}", ResourceWarning, source=self)
Object allocated at (most recent call last):
  File "D:\test\cpython\lib\asyncio\windows_utils.py", lineno 164
self.stdout = PipeHandle(stdout_rh)
D:\test\cpython\lib\asyncio\windows_utils.py:112: ResourceWarning: unclosed 

  _warn(f"unclosed {self!r}", ResourceWarning, source=self)
Object allocated at (most recent call last):
  File "D:\test\cpython\lib\asyncio\windows_utils.py", lineno 166
self.stderr = PipeHandle(stderr_rh)
Exception ignored in: 
Traceback (most recent call last):
  File "D:\test\cpython\lib\asyncio\proactor_events.py", line 115, in __del__
_warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
  File "D:\test\cpython\lib\asyncio\proactor_events.py", line 79, in __repr__
info.append(f'fd={self._sock.fileno()}')
  File "D:\test\cpython\lib\asyncio\windows_utils.py", line 102, in fileno
raise ValueError("I/O operation on closed pipe")
ValueError: I/O operation on closed pipe
Exception ignored in: 
Traceback (most recent call last):
  File "D:\test\cpython\lib\asyncio\proactor_events.py", line 115, in __del__
_warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
  File "D:\test\cpython\lib\asyncio\proactor_events.py", line 79, in __repr__
info.append(f'fd={self._sock.fileno()}')
  File "D:\test\cpython\lib\asyncio\windows_utils.py", line 102, in fileno
raise ValueError("I/O operation on closed pipe")
ValueError: I/O operation on closed pipe

--
nosy: +db3l

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39093] tkinter objects garbage collected from non-tkinter thread cause crash

2020-07-19 Thread E. Paine


Change by E. Paine :


--
keywords: +patch
pull_requests: +20695
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21532

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39093] tkinter objects garbage collected from non-tkinter thread cause crash

2020-07-19 Thread E. Paine


Change by E. Paine :


--
keywords: +patch
pull_requests: +20696
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21532

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39093] tkinter objects garbage collected from non-tkinter thread cause crash

2020-07-19 Thread E. Paine


Change by E. Paine :


--
keywords: +patch
pull_requests: +20694
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21532

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38227] Setting a signal handler gets multiprocessing.Pool stuck

2020-07-19 Thread Greg Lindahl


Change by Greg Lindahl :


--
nosy: +wumpus

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39093] tkinter objects garbage collected from non-tkinter thread cause crash

2020-07-19 Thread E. Paine


Change by E. Paine :


--
keywords: +patch
pull_requests: +20693
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21532

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41343] Convert complex methods to Argument Clinic

2020-07-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I wrote similar patch for __format__ and got similar tiny speed up. It is 
expectable. But I am surprised that you get a difference for conjugate() and 
__getnewargs__. It may be a compiler artifact.

In any case the benefit of converting to Argument Clinic in this case is adding 
signatures for these methods.

--
nosy: +mark.dickinson, serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41295] CPython 3.8.4 regression on __setattr__ in multiinheritance with metaclasses

2020-07-19 Thread Guido van Rossum

Guido van Rossum  added the comment:

@Łukasz: this should be good for the 3.8.5 release.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41342] Convert int.__round__ to Argument Clinic

2020-07-19 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41343] Convert complex methods to Argument Clinic

2020-07-19 Thread Dong-hee Na


Change by Dong-hee Na :


--
keywords: +patch
pull_requests: +20692
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21550

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41343] Convert complex methods to Argument Clinic

2020-07-19 Thread Dong-hee Na


Change by Dong-hee Na :


--
assignee:  -> corona10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41343] Convert complex methods to Argument Clinic

2020-07-19 Thread Dong-hee Na


New submission from Dong-hee Na :

Mean +- std dev: [master_format] 3.54 us +- 0.06 us -> [clinic_format] 3.29 us 
+- 0.07 us: 1.08x faster (-7%)

Mean +- std dev: [master_conjugate] 3.56 us +- 0.09 us -> [clinic_conjugate] 
3.32 us +- 0.06 us: 1.07x faster (-7%)

Mean +- std dev: [master__getnewargs__] 425 ns +- 18 ns -> 
[clinic__getnewargs__] 412 ns +- 7 ns: 1.03x faster (-3%)

--
components: Argument Clinic
messages: 373966
nosy: corona10, larry
priority: normal
severity: normal
status: open
title: Convert complex methods to Argument Clinic
type: performance
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41295] CPython 3.8.4 regression on __setattr__ in multiinheritance with metaclasses

2020-07-19 Thread kam193


kam193  added the comment:

@Jonas: I know, running those tests isn't so easy, I think a few libraries are 
incompatible with python 3.9/3.10 yet or I didn't find right prerequisites. But 
fortunately, everything is running on patched 3.8, so after back-porting I can 
run it

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38169] Increase Code Coverage for SharedMemory and ShareableListe

2020-07-19 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset bfd0fbdc1352534b3c91b46dbae4285f5220acf4 by Vinay Sharma in 
branch 'master':
bpo-38169: Increase code coverage for SharedMemory and ShareableList (GH-16139)
https://github.com/python/cpython/commit/bfd0fbdc1352534b3c91b46dbae4285f5220acf4


--
nosy: +corona10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38169] Increase Code Coverage for SharedMemory and ShareableListe

2020-07-19 Thread Dong-hee Na


Change by Dong-hee Na :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41342] Convert int.__round__ to Argument Clinic

2020-07-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +20691
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21549

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41342] Convert int.__round__ to Argument Clinic

2020-07-19 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

int.__round__ was not converted to Argument Clinic because it is not impossible 
to express a correct signature for it in Python. But now we can at least make 
Argument Clinic not producing incorrect signature. And converting to Argument 
Clinic has a performance benefit.

$ ./python -m pyperf timeit -q --compare-to=../cpython-baseline/python 
"round(12345)"
Mean +- std dev: [/home/serhiy/py/cpython-baseline/python] 123 ns +- 6 ns -> 
[/home/serhiy/py/cpython-release/python] 94.4 ns +- 2.4 ns: 1.31x faster (-23%)

$ ./python -m pyperf timeit -q --compare-to=../cpython-baseline/python 
"round(12345, 0)"
Mean +- std dev: [/home/serhiy/py/cpython-baseline/python] 159 ns +- 4 ns -> 
[/home/serhiy/py/cpython-release/python] 98.6 ns +- 2.4 ns: 1.61x faster (-38%)

$ ./python -m pyperf timeit -q --compare-to=../cpython-baseline/python 
"round(12345, -2)"
Mean +- std dev: [/home/serhiy/py/cpython-baseline/python] 585 ns +- 9 ns -> 
[/home/serhiy/py/cpython-release/python] 534 ns +- 14 ns: 1.09x faster (-9%)

--
components: Argument Clinic, Interpreter Core
messages: 373963
nosy: larry, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Convert int.__round__ to Argument Clinic
type: performance
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41339] make queue.Queue objects iterable

2020-07-19 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41262] Convert memoryview to Argument Clinic

2020-07-19 Thread Stefan Krah


Stefan Krah  added the comment:

Thanks, I can confirm that the speedup for memoryview.cast() is large in 
microbenchmarks.

Still, if the speedup cannot be seen in programs like test_buffer,
the amount of code that's being added for a speedup < 5% in real
world programs is quite substantial (if you count the generated
code and the fast_call machinery).

But we can leave it in.  Preemptively, if someone sees this and
thinks the flood gates are open for _decimal:  No, it won't be
converted to AC.

--
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23882] unittest discovery doesn't detect namespace packages when given no parameters

2020-07-19 Thread Inada Naoki


Inada Naoki  added the comment:

In such case, both directories must be specified explicitly.

Test discovery doesn't know that a directory is namespace package or
namespace package. So it shouldn't assume it is namespace package unless
specified.

Note that PEP 420 searches namespace package only when it is specified.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41341] Recursive evaluation of ForwardRef (and PEP 563)

2020-07-19 Thread Joseph Perez

New submission from Joseph Perez :

(This issue is already broached in https://bugs.python.org/issue38605, and a in 
some way in https://bugs.python.org/issue35834, but only as a secondary 
subject, that's why I've opened a ticket on this particular issue)

ForwardRef of ForwardRef are not currently evaluated by get_type_hints, only 
the first level is, as illustrated in these examples:
```python
from typing import ForwardRef, Optional, get_type_hints
def func(a: "Optional[\"int\"]"):
pass
assert get_type_hints(func)["a"] == Optional[ForwardRef("int")] 
# one would expect get_type_hints(func)["a"] == Optional[int] 
```
```python
from __future__ import annotations
from typing import ForwardRef, Optional, get_type_hints
def func(a: Optional["int"]):
pass
assert get_type_hints(func)["a"] == Optional[ForwardRef("int")]
# one would expect get_type_hints(func)["a"] == Optional[int] (which is the 
case without the import of __future__.annotations!)
```
On the one hand I find this behavior quite counter-intuitive; I rather think 
ForwardRef as kind of internal (and wonder why there is no leading underscore, 
like _GenericAlias where it's used) and I don't understand the purpose of 
exposing it as the result of the public API get_type_hints. By the way, if 
ForwardRef can be obtained by retrieving annotations without get_type_hints, 
stringified annotations (especially since PEP 563) make get_type_hints kind of 
mandatory, and thus make ForwardRef disappeared (only at the first level so …)

On the other hand, the second example show that adoptions of postponed 
annotations can change the result of get_type_hints; several libraries relying 
of get_type_hints could be broken.

An other issue raised here is that if these ForwardRef are not evaluated by 
get_type_hints, how will be done their evaluatation by the user? It would 
require to retrieve some globalns/localns — too bad, it's exactly what is doing 
get_type_hints. And if the ForwardRef is in a class field, the class 
globalns/localns will have to be kept somewhere while waiting to encounter 
these random ForwardRef; that's feasible, but really tedious.

Agreeing with Guido Von Rossum (https://bugs.python.org/msg370232), this 
behavior could be easily "fixed" in get_type_hints.
Actually, there would be only one line to change in ForwardRef._evaluate:
```python
# from
self.__forward_value__ = _type_check(
eval(self.__forward_code__, globalns, localns),
"Forward references must evaluate to types.",
is_argument=self.__forward_is_argument__)
# to
self.__forward_value__ = _eval_type(
_type_check(
eval(
self.__forward_code__, globalns, localns),
"Forward references must evaluate to types.",
is_argument=self.__forward_is_argument__,
),
globalns,
localns,
)

And if this fix could solve the "double ForwardRef" issue mentionned in 
https://bugs.python.org/issue38605, it would also resolve 
https://bugs.python.org/issue35834 in the same time, raising NameError in case 
of unknown ForwardRef with postponed annotation.

--
messages: 373960
nosy: BTaskaya, eric.smith, gvanrossum, joperez, levkivskyi, lukasz.langa, 
vstinner
priority: normal
severity: normal
status: open
title: Recursive evaluation of ForwardRef (and PEP 563)
type: behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41205] Documentation Decimal power 0 to the 0 is Nan (versus 0 to the 0 which is 1)

2020-07-19 Thread miss-islington


miss-islington  added the comment:


New changeset dac8a3a15647d016842e2ae7284cefa27ce5e838 by Miss Islington (bot) 
in branch '3.8':
bpo-41205: Document Decimal power 0 to the 0 (GH-21386)
https://github.com/python/cpython/commit/dac8a3a15647d016842e2ae7284cefa27ce5e838


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41205] Documentation Decimal power 0 to the 0 is Nan (versus 0 to the 0 which is 1)

2020-07-19 Thread miss-islington


miss-islington  added the comment:


New changeset 8831162464138eb0267f4967b85710247ee95fde by Miss Islington (bot) 
in branch '3.9':
bpo-41205: Document Decimal power 0 to the 0 (GH-21386)
https://github.com/python/cpython/commit/8831162464138eb0267f4967b85710247ee95fde


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38169] Increase Code Coverage for SharedMemory and ShareableListe

2020-07-19 Thread Vinay Sharma


Vinay Sharma  added the comment:

Remove Check to prevent creating shared_memory with size 0. Will create a 
different issue for the same.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41205] Documentation Decimal power 0 to the 0 is Nan (versus 0 to the 0 which is 1)

2020-07-19 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 8.0 -> 9.0
pull_requests: +20689
pull_request: https://github.com/python/cpython/pull/21547

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41205] Documentation Decimal power 0 to the 0 is Nan (versus 0 to the 0 which is 1)

2020-07-19 Thread miss-islington


Change by miss-islington :


--
pull_requests: +20690
pull_request: https://github.com/python/cpython/pull/21548

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41205] Documentation Decimal power 0 to the 0 is Nan (versus 0 to the 0 which is 1)

2020-07-19 Thread Stefan Krah

Stefan Krah  added the comment:


New changeset 10e466448f67850ed7bb2e2a4e7f017f2b050cad by Srinivas Reddy 
Thatiparthy (శ్రీనివాస్  రెడ్డి తాటిపర్తి) in branch 'master':
bpo-41205: Document Decimal power 0 to the 0 (GH-21386)
https://github.com/python/cpython/commit/10e466448f67850ed7bb2e2a4e7f017f2b050cad


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41336] Random segfaults during zoneinfo object creation stopped using Ctrl-C

2020-07-19 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 4.0 -> 5.0
pull_requests: +20688
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21546

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41229] Asynchronous generator memory leak

2020-07-19 Thread Joongi Kim


Change by Joongi Kim :


--
nosy: +Joongi Kim
nosy_count: 6.0 -> 7.0
pull_requests: +20687
pull_request: https://github.com/python/cpython/pull/21545

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41340] Not very good strcpy implementation in cpython/Python/strdup.c

2020-07-19 Thread fj92f3jj923f923


Change by fj92f3jj923f923 :


--
keywords: +patch
pull_requests: +20686
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21544

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41340] Not very good strcpy implementation in cpython/Python/strdup.c

2020-07-19 Thread fj92f3jj923f923


New submission from fj92f3jj923f923 :

Hi, all!

strdup implementation inside cpython/Python/strdup.c is not the best one.
It calls strlen + strcpy, which is the same as calling strlen twice + memcpy.
So I replaced it by the call of strlen + memcpy.

It is easy to look any implementation in any library.
Here for example:
https://code.woboq.org/userspace/glibc/string/strdup.c.html

So I fixed it here:
https://github.com/python/cpython/pull/21544

--
components: C API
messages: 373955
nosy: fj92f3jj923f923
priority: normal
severity: normal
status: open
title: Not very good strcpy implementation in cpython/Python/strdup.c
type: performance
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41229] Asynchronous generator memory leak

2020-07-19 Thread Nathaniel Smith


Nathaniel Smith  added the comment:

Oh! I see it. This is actually working as intended.

What's happening is that the event loop will clean up async generators when 
they're garbage collected... but, this requires that the event loop get a 
chance to run. In the demonstration program, the main task creates lots of 
async generator objects, but never returns to the main loop. So they're all 
queued up to be collected, but it can't actually happen until you perform a 
real async operation. For example, try adding 'await asyncio.sleep(1)` before 
the input() call so that the event loop has a chance to run, and you'll see 
that the objects are collected immediately.

So this is a bit tricky, but this is actually expected behavior, and falls 
under the general category of "don't block the event loop, it will break stuff".

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41229] Asynchronous generator memory leak

2020-07-19 Thread Nathaniel Smith


Nathaniel Smith  added the comment:

...On closer examination, it looks like that Trio PR has at least one test that 
checks that async generators are collected promptly after they stop being 
referenced, and that test passes:

https://github.com/python-trio/trio/pull/1564/files#diff-c79a78487c2f350ba99059813ea0c9f9R38

So, I have no idea what's going on here.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23882] unittest discovery doesn't detect namespace packages when given no parameters

2020-07-19 Thread Roger Gammans


Roger Gammans  added the comment:

But namespace packages are still useful for what PEP420 envisages and they 
should be able to have runnable tests.

For instance

 projectX/
   - interfaces/
 - proxyX.py
 - testX.py
 projectY/
   - intefaces/
 - proxyY.py
 - testY.py

Here interfaces is a namespace package and projectX and projectY are kept 
separate, perhaps to reduce dependency and/or for separation of concerns.

I don't think this is insurmountable - even taking into account Inada's very 
good point about dangerous_scripts. A full tests/ packages in on both projectX 
and projectY would allow their test to run. However, in some environments, it 
is normal to put the test alongside the code as shown here.

But some better documentation on this issue would advisable, and some guidance 
on the best practice.

Python has a complex ecosystem, and so an individual developer might hit this 
problem but be using a third party `framework`, which hasn't taken all of this 
on board. Eg. https://code.djangoproject.com/ticket/30403 . (I'm not really 
singling django out, although it's the one I hit) So it important that there is 
a clear understanding of the best way to deal with this case.

--
nosy: +rgamm...@gammascience.co.uk

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41229] Asynchronous generator memory leak

2020-07-19 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

Huh, this is very weird. I can confirm that the async generator objects aren't 
cleaned up until loop shutdown on asyncio.

On the trio main branch, we don't yet use the `set_asyncgen_hooks` mechanism, 
and the async generator objects are cleaned up immediately.

However, if I check out this PR that will add it: 
https://github.com/python-trio/trio/pull/1564

...then we see the same bug happening with Trio: all the async generators are 
kept around until loop shutdown.

Also, it doesn't seem to be a circular references issue – if I explicitly call 
`gc.collect()`, then the asyncgen destructors are still *not* called; only 
shutting down the loop does it.

This doesn't make any sense, because asyncio/trio only keep weak references to 
the async generator objects, so they should still be freed.

So maybe the `set_asyncgen_hooks` code introduces a reference leak on async 
generator objects, or something?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41339] make queue.Queue objects iterable

2020-07-19 Thread Alan Iwi


New submission from Alan Iwi :

It is possible to make `queue.Queue` and `queue.SimpleQueue` objects iterable 
by adding simple `__iter__` and `__next__` methods.  This is to suggest adding 
these methods to the existing `Queue` and `SimpleQueue` so that they are 
iterable by default.

```
class Fifo(SimpleQueue):

def __iter__(self):
return self

def __next__(self):
if not self.empty():
return self.get()
raise StopIteration
```

--
components: Library (Lib)
messages: 373950
nosy: alaniwi
priority: normal
severity: normal
status: open
title: make queue.Queue objects iterable
type: enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41337] strangnedd with the parser

2020-07-19 Thread Eric V. Smith


Eric V. Smith  added the comment:

This doesn't appear to be a Python bug, but rather an issue with how you're 
using PyTorch. I suggest you ask for help on a PyTorch support forum, or maybe 
try StackOverflow.

--
nosy: +eric.smith
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39073] [security] email module incorrect handling of CR and LF newline characters in Address objects.

2020-07-19 Thread Ned Deily


Ned Deily  added the comment:

Merged for release in 3.9.0a6, 3.8.4, 3.7.8, 3.6.11, and 3.5.10.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41229] Asynchronous generator memory leak

2020-07-19 Thread Joongi Kim


Change by Joongi Kim :


--
nosy: +njs

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41229] Asynchronous generator memory leak

2020-07-19 Thread Joongi Kim


Joongi Kim  added the comment:

I've searched the Python documentation and the docs must be updated to 
explicitly state the necessity of aclose().

refs)
https://docs.python.org/3/reference/expressions.html#asynchronous-generator-functions
https://www.python.org/dev/peps/pep-0525/

I'm not sure that what the original authors' intention is, but for me, it looks 
like that calling aclose() is an optional thing and the responsibility to call 
aclose() on async generators is left to the asyncgen-shutdown handler of the 
event loop.

The example in this issue show that we need to aclose asyncgens whenever we are 
done with it, even far before shutting down the event loop.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39603] [security] http.client: HTTP Header Injection in the HTTP method

2020-07-19 Thread Ned Deily


Ned Deily  added the comment:

Merged for release in 3.9.0b5, 3.8.5, 3.7.9, and 3.6.12. Thanks, everyone!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10 -Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39603] [security] http.client: HTTP Header Injection in the HTTP method

2020-07-19 Thread Ned Deily


Ned Deily  added the comment:


New changeset f02de961b9f19a5db0ead56305fe0057a78787ae by Miss Islington (bot) 
in branch '3.6':
bpo-39603: Prevent header injection in http methods (GH-18485) (GH-21539)
https://github.com/python/cpython/commit/f02de961b9f19a5db0ead56305fe0057a78787ae


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39603] [security] http.client: HTTP Header Injection in the HTTP method

2020-07-19 Thread Ned Deily


Ned Deily  added the comment:


New changeset ca75fec1ed358f7324272608ca952b2d8226d11a by Miss Islington (bot) 
in branch '3.7':
bpo-39603: Prevent header injection in http methods (GH-18485) (GH-21538)
https://github.com/python/cpython/commit/ca75fec1ed358f7324272608ca952b2d8226d11a


--
nosy: +ned.deily

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41311] Add a function to get a random sample from an iterable (reservoir sampling)

2020-07-19 Thread Oscar Benjamin


Oscar Benjamin  added the comment:

Yeah, I guess it's a YAGNI.

Thanks Raymond and Tim for looking at this!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41229] Asynchronous generator memory leak

2020-07-19 Thread Joongi Kim


Joongi Kim  added the comment:

>From the given example, if I add "await q.aclose()" after "await 
>q.asend(123456)" it does not leak the memory.

This is a good example showing that we should always wrap async generators with 
explicit "aclosing" context manager (which does not exist yet in the stdlib).
I'm already doing so by writing a custom library:
https://github.com/achimnol/aiotools/blob/ef7bf0ce/src/aiotools/context.py#L152

We may need to update the documentation to recommend explicit aclosing of async 
generators.

--
nosy: +achimnol

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41320] async process closing after event loop closed

2020-07-19 Thread Joongi Kim


Change by Joongi Kim :


--
nosy: +achimnol

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41338] test_decimal emits DeprecationWarning due to PyUnicode_FromUnicode(NULL, size)

2020-07-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
nosy_count: 2.0 -> 3.0
pull_requests: +20685
pull_request: https://github.com/python/cpython/pull/21543

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36777] unittest discover throws TypeError on namespace packages

2020-07-19 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I didn't know packages without __init__.py are namespace packages back then and 
used empty packages. I guess it's related to the other issues with unittest and 
namespace packages issue36723, issue23882 and issue35617

--
nosy: +inada.naoki
title: unittest discover throws TypeError on empty packages -> unittest 
discover throws TypeError on namespace packages

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41338] test_decimal emits DeprecationWarning due to PyUnicode_FromUnicode(NULL, size)

2020-07-19 Thread Inada Naoki


Change by Inada Naoki :


--
keywords: +patch
pull_requests: +20684
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21542

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32528] Change base class for futures.CancelledError

2020-07-19 Thread miss-islington


miss-islington  added the comment:


New changeset 700cb6617545cdb8a9e16bb2e6efe90788a60d4d by Miss Islington (bot) 
in branch '3.8':
bpo-32528: Document the change in inheritance of asyncio.CancelledError 
(GH-21474)
https://github.com/python/cpython/commit/700cb6617545cdb8a9e16bb2e6efe90788a60d4d


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41338] test_decimal emits DeprecationWarning due to PyUnicode_FromUnicode(NULL, size)

2020-07-19 Thread Karthikeyan Singaravelan


New submission from Karthikeyan Singaravelan :

Probably related to issue36346

./python -Wall -m test test_decimal  
0:00:00 load avg: 3.07 Run tests sequentially
0:00:00 load avg: 3.07 [1/1] test_decimal
/root/cpython/Lib/test/test_decimal.py:592: DeprecationWarning: 
PyUnicode_FromUnicode(NULL, size) is deprecated; use PyUnicode_New() instead
  s = _testcapi.unicode_legacy_string('9.99')
/root/cpython/Lib/test/test_decimal.py:592: DeprecationWarning: 
PyUnicode_FromUnicode(NULL, size) is deprecated; use PyUnicode_New() instead
  s = _testcapi.unicode_legacy_string('9.99')
/root/cpython/Lib/test/test_decimal.py:2828: DeprecationWarning: 
PyUnicode_FromUnicode(NULL, size) is deprecated; use PyUnicode_New() instead
  c.rounding = _testcapi.unicode_legacy_string(rnd)
/root/cpython/Lib/test/test_decimal.py:2828: DeprecationWarning: 
PyUnicode_FromUnicode(NULL, size) is deprecated; use PyUnicode_New() instead
  c.rounding = _testcapi.unicode_legacy_string(rnd)
/root/cpython/Lib/test/test_decimal.py:2828: DeprecationWarning: 
PyUnicode_FromUnicode(NULL, size) is deprecated; use PyUnicode_New() instead
  c.rounding = _testcapi.unicode_legacy_string(rnd)
/root/cpython/Lib/test/test_decimal.py:2828: DeprecationWarning: 
PyUnicode_FromUnicode(NULL, size) is deprecated; use PyUnicode_New() instead
  c.rounding = _testcapi.unicode_legacy_string(rnd)
/root/cpython/Lib/test/test_decimal.py:2828: DeprecationWarning: 
PyUnicode_FromUnicode(NULL, size) is deprecated; use PyUnicode_New() instead
  c.rounding = _testcapi.unicode_legacy_string(rnd)
/root/cpython/Lib/test/test_decimal.py:2828: DeprecationWarning: 
PyUnicode_FromUnicode(NULL, size) is deprecated; use PyUnicode_New() instead
  c.rounding = _testcapi.unicode_legacy_string(rnd)
/root/cpython/Lib/test/test_decimal.py:2828: DeprecationWarning: 
PyUnicode_FromUnicode(NULL, size) is deprecated; use PyUnicode_New() instead
  c.rounding = _testcapi.unicode_legacy_string(rnd)
/root/cpython/Lib/test/test_decimal.py:2828: DeprecationWarning: 
PyUnicode_FromUnicode(NULL, size) is deprecated; use PyUnicode_New() instead
  c.rounding = _testcapi.unicode_legacy_string(rnd)
/root/cpython/Lib/test/test_decimal.py:2834: DeprecationWarning: 
PyUnicode_FromUnicode(NULL, size) is deprecated; use PyUnicode_New() instead
  s = _testcapi.unicode_legacy_string('ROUND_\x00UP')
/root/cpython/Lib/test/test_decimal.py:2828: DeprecationWarning: 
PyUnicode_FromUnicode(NULL, size) is deprecated; use PyUnicode_New() instead
  c.rounding = _testcapi.unicode_legacy_string(rnd)
/root/cpython/Lib/test/test_decimal.py:2828: DeprecationWarning: 
PyUnicode_FromUnicode(NULL, size) is deprecated; use PyUnicode_New() instead
  c.rounding = _testcapi.unicode_legacy_string(rnd)
/root/cpython/Lib/test/test_decimal.py:2828: DeprecationWarning: 
PyUnicode_FromUnicode(NULL, size) is deprecated; use PyUnicode_New() instead
  c.rounding = _testcapi.unicode_legacy_string(rnd)
/root/cpython/Lib/test/test_decimal.py:2828: DeprecationWarning: 
PyUnicode_FromUnicode(NULL, size) is deprecated; use PyUnicode_New() instead
  c.rounding = _testcapi.unicode_legacy_string(rnd)
/root/cpython/Lib/test/test_decimal.py:2828: DeprecationWarning: 
PyUnicode_FromUnicode(NULL, size) is deprecated; use PyUnicode_New() instead
  c.rounding = _testcapi.unicode_legacy_string(rnd)
/root/cpython/Lib/test/test_decimal.py:2828: DeprecationWarning: 
PyUnicode_FromUnicode(NULL, size) is deprecated; use PyUnicode_New() instead
  c.rounding = _testcapi.unicode_legacy_string(rnd)
/root/cpython/Lib/test/test_decimal.py:2828: DeprecationWarning: 
PyUnicode_FromUnicode(NULL, size) is deprecated; use PyUnicode_New() instead
  c.rounding = _testcapi.unicode_legacy_string(rnd)
/root/cpython/Lib/test/test_decimal.py:2828: DeprecationWarning: 
PyUnicode_FromUnicode(NULL, size) is deprecated; use PyUnicode_New() instead
  c.rounding = _testcapi.unicode_legacy_string(rnd)
/root/cpython/Lib/test/test_decimal.py:2834: DeprecationWarning: 
PyUnicode_FromUnicode(NULL, size) is deprecated; use PyUnicode_New() instead
  s = _testcapi.unicode_legacy_string('ROUND_\x00UP')

== Tests result: SUCCESS ==

1 test OK.

Total duration: 14.8 sec
Tests result: SUCCESS

--
components: Tests
messages: 373939
nosy: inada.naoki, xtreak
priority: normal
severity: normal
status: open
title: test_decimal emits DeprecationWarning due to PyUnicode_FromUnicode(NULL, 
size)
type: behavior
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41297] Remove doctest import from heapq

2020-07-19 Thread Ronald Oussoren


Change by Ronald Oussoren :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40828] shared memory problems with multiprocessing.Pool

2020-07-19 Thread Vinay Sharma


Vinay Sharma  added the comment:

Hi, Can you please confirm the python version in which you replicated this 
issue. I tried replicating (segmentation fault) this issue in python 3.8.0b3 
but didn't succeed. And shared_memory isn't present in 3.7. Also, shared_memory 
is known to throw some warnings, and there is already a PR and issue open for 
that https://bugs.python.org/issue38119.

--
nosy: +vinay0410

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41337] strangnedd with the parser

2020-07-19 Thread Justin Hodder


New submission from Justin Hodder :

Here a colab that demostrates the bug
https://colab.research.google.com/drive/1OWSEoV7Wx-EBA_2IprNZoASNvXIky3iC?usp=sharing
the following code gives"received an invalid combination of arguments - got 
(Tensor, Tensor), but expected one of:" 
import torch
torch.nn.Linear(
torch.as_strided(torch.ones((4,6*5*5*70*10)),(4,6*5*5,10),(4,2,-1))
,torch.ones(10,6*5*6))
#(4,2,3),(2,3,1))
The following code gives "TypeError: ones(): argument 'size' (position 1) 
must be tuple of ints, not str import torch"
import torch
#torch.nn.Linear(
torch.as_strided(torch.ones((4,6*5*5*70*10)),(4,6*5*5,10),(4,2,-1))
,torch.ones(10,6*5*6)#)
#(4,2,3),(2,3,1))


--
components: Interpreter Core
files: pythos_parser_bug.ipynb
messages: 373937
nosy: Justin Hodder
priority: normal
severity: normal
status: open
title: strangnedd with the parser
versions: Python 3.6
Added file: https://bugs.python.org/file49325/pythos_parser_bug.ipynb

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41295] CPython 3.8.4 regression on __setattr__ in multiinheritance with metaclasses

2020-07-19 Thread Stefan Behnel


Stefan Behnel  added the comment:

> test_asyncio altered the execution environment

That happened several times before in previous builds. I think there's just a 
part of the asyncio tests that is unreliable. I left a comment in issue 41273 
since it might be related, the sporadic failures started appearing in the build 
following the merge.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41273] asyncio: proactor read transport: use recv_into instead of recv

2020-07-19 Thread Stefan Behnel


Stefan Behnel  added the comment:

There have been sporadic buildbot failures in "test_asyncio" since this change, 
message being "1 test altered the execution environment", e.g.

https://buildbot.python.org/all/#/builders/129/builds/1443

Could someone please check if they are related?

--
nosy: +scoder

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41295] CPython 3.8.4 regression on __setattr__ in multiinheritance with metaclasses

2020-07-19 Thread Jonas Schäfer

Jonas Schäfer  added the comment:

@kam193 Thanks for running the aioxmpp tests. I built the patched python 
yesterday, but I didn’t manage to get a virtualenv with it up

Good to hear that the fix works as expected!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41333] Convert OrderedDict.pop() to Argument Clinic

2020-07-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41333] Convert OrderedDict.pop() to Argument Clinic

2020-07-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 6bf3237379b17632db52cb39d181e8bac70173f3 by Serhiy Storchaka in 
branch 'master':
bpo-41333: Convert OrderedDict.pop() to Argument Clinic (GH-21534)
https://github.com/python/cpython/commit/6bf3237379b17632db52cb39d181e8bac70173f3


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41323] Perform "peephole" optimization directly on control-flow graph.

2020-07-19 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +tim.peters

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41297] Remove doctest import from heapq

2020-07-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Can we close this?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41272] New clause in FOR and WHILE instead of ELSE

2020-07-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I see that this was already moved to the mailing list.  Am marking this as 
closed.  If the mail list discussion proves favorable, feel free to reopen.

--
nosy: +rhettinger
resolution:  -> later
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41311] Add a function to get a random sample from an iterable (reservoir sampling)

2020-07-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> I agree that this could be out of scope for the random module
> but I wanted to make sure the reasons were considered.

I think we've done that.  Let's go ahead and close this one down.

In general, better luck can be had by starting with a common real world problem 
not adequately solved by the library, then creating a clean API for it, and 
lastly searching for the best algorithm to implement it.  It is much tougher 
the other way around, starting with an algorithm you like, then hoping to find 
a use case to justify it, and hoping to find an API that isn't a footgun for 
everyday users.

FWIW, reservoir sampling was considered at the outset when sample() was first 
designed.  Subsequent to that we've also evaluated a high quality PR for 
switching the internals to reservoir sampling, but it proved to be inferior to 
the current implementation in most respects (code complexity, computational 
overhead, speed, and entropy consumed); the only gain was some memory savings.

--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com