[issue43901] Lazy-create an empty annotations dict in all unannotated user classes and modules

2021-04-25 Thread Larry Hastings


Change by Larry Hastings :


--
keywords: +patch
pull_requests: +24322
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/25623

___
Python tracker 

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



[issue43940] int casting to float results to a different value in memory

2021-04-25 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I believe that this may be the same issue as this thread

https://mail.python.org/archives/list/python-...@python.org/thread/35NECLGFIVAHWTIPAYDBJOJJX3FSY233/

in particular this comment:

https://mail.python.org/archives/list/python-...@python.org/message/QIC4DLFYEI3IVGUFK5KRTIELTKFI76B6/

--
nosy: +steven.daprano

___
Python tracker 

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



[issue43940] int casting to float results to a different value in memory

2021-04-25 Thread Huang Yang


Huang Yang  added the comment:

Also reproducible by:

from ctypes import *
 
i = int('7f94e57c', 16)
cp = pointer(c_int(i))
fp = cast(cp, POINTER(c_float))
print(fp.contents.value) # nan
p = pointer(c_float(fp.contents.value))
ip = cast(p, POINTER(c_int))
print(hex(ip.contents.value)) #'0x7fd4e57c'

--

___
Python tracker 

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



[issue43941] Unit test failure in test_gdb only with -O0

2021-04-25 Thread Larry Hastings


New submission from Larry Hastings :

Recent Python source trees fail a regression test in test_gdb.  Oddly, the 
behavior only appears up when optimization is turned off.

To reproduce:

% git clone cpython buildtrunk
% cd buildtrunk
% ./configure
% vi Makefile  # change "-O3" to "-O0" !!
% make -j
% ./python -m test -v test_gdb

You'll be rewarded with one failure:

==
FAIL: test_wrapper_call (test.test_gdb.PyBtTests)
--
Traceback (most recent call last):
  File "/home/larry/src/python/buildtrunk/Lib/test/test_gdb.py", line 947, in 
test_wrapper_call
self.assertRegex(gdb_output,
AssertionError: Regex didn't match: ", v=) at Python/bltinmodule.c:1207\n1207\t{\nBreakpoint 2: file 
Objects/descrobject.c, line 1386.\n\nBreakpoint 2, wrapper_call (wp=, args=, kwds=) at Objects/descrobject.c:1386\n1386\t{\nTraceback 
(most recent call first):\n  \n  File 
"", line 4, in __init__\n  File "", line 7, in \n'

--

I just reproduced this with version 3c4850e22239426e250ff43308e4802dc582 .  
Note that if you don't change the Makefile, and leave the optimization level at 
"-O3", you won't see this test failure.

Pablo, I nosied you just to get it on your radar.  Good luck with getting 
Python 3.10 over the finish line!

--
components: Library (Lib)
keywords: 3.10regression
messages: 391878
nosy: larry, pablogsal
priority: normal
severity: normal
stage: needs patch
status: open
title: Unit test failure in test_gdb only with -O0
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



[issue43940] int casting to float results to a different value in memory

2021-04-25 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +mark.dickinson, rhettinger, tim.peters

___
Python tracker 

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



[issue23975] numbers.Rational implements __float__ incorrectly

2021-04-25 Thread Sergey B Kirpichev


Change by Sergey B Kirpichev :


--
pull_requests: +24321
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/25619

___
Python tracker 

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



[issue43940] int casting to float results to a different value in memory

2021-04-25 Thread Huang Yang


Huang Yang  added the comment:

It's reproducible only if the float is nan, with prefix 7f or ff.
Seems the value is OR operated by 0x0040.

--

___
Python tracker 

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



[issue43940] int casting to float results to a different value in memory

2021-04-25 Thread Huang Yang


New submission from Huang Yang :

from ctypes import *
import struct

i = int('7f94e57c', 16)
cp = pointer(c_int(i))
fp = cast(cp, POINTER(c_float))
print(fp.contents.value) # nan
print(struct.pack(">f", fp.contents.value).hex()) # 7fd4e57c

# value changed: 7f94e57c -> 7fd4e57c

--
components: Library (Lib), ctypes
messages: 391876
nosy: yang8621
priority: normal
severity: normal
status: open
title: int casting to float results to a different value in memory
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue43936] os.path.realpath() normalizes paths before resolving links on Windows

2021-04-25 Thread Eryk Sun


Eryk Sun  added the comment:

> os.path.realpath() normalizes paths before resolving links 
> on Windows

Normalizing the input path is required in order to be consistent with the 
Windows file API. OTOH, the target path of a relative symlink gets resolved in 
a POSIX-ly correct manner in the kernel, and ntpath._readlink_deep() doesn't 
ensure this. 

I've attached a prototype that I wrote for a POSIX-like implementation that 
recursively resolves both the drive and the path. It uses the final path only 
as a shortcut to normalize volume GUID names as drives and the proper casing of 
UNC server and share names. However, it's considerably more work than the 
final-path approach, and more work always has the potential for more bugs. I'm 
providing it for the sake of discussion, or just for people to point to it as 
an example of what not to do... ;-)

Patching up the current implementation would probably involve extending 
_getfinalpathname() to support follow_symlinks=False. Aspects of the POSIX 
implementation would have to be adopted, but I think it can be kept relatively 
simple when integrated with _getfinalpathname(path, follow_symlinks=False). The 
latter also makes it easy to identify a UNC path, which is necessary because 
mountpoints should never be resolved in a UNC path, which is something the 
current implementation gets wrong.

What this wouldn't support is resolving an inaccessible drive as much as 
possible. Mapped drives are object symlinks that expand to UNC paths that can 
include an arbitrary filepath on a share. Substitute drives by definition 
target an arbitrary filepath, and can even target other substitute and mapped 
drives. A final-path only approach would leave the inaccessible drive in the 
result, along with any symlinks that are internal to the drive.

A final-path approach also can't support targets with rooted paths or ".." 
components that traverse a mountpoint. The final path will be on the 
mountpoint's device, which will change how such relative symlinks resolve. That 
said, rooted symlink targets are almost never seen in Windows, and targets that 
traverse a mountpoint by way of a ".." component should be rare, in principle. 

One problem is the frequent use of bind mountpoints in place of symlinks in 
Windows. In CMD, bind mountpoints can be created by anyone via `mklink /j`. 
Here's a fabricated example with a mountpoint (i.e. junction) that's used where 
normally a symlink should be used.

C:\
work\
foo\
bar [junction -> C:\work\bar]
remote [symlink -> \\baz\spam]
bar\
remote [symlink -> ..\remote]
remote [symlink -> \\qux\eggs]

C:\work\foo\bar\remote normally resolves as follows:

C:\work\foo\bar\remote
-> C:\work\foo\bar + ..\remote
-> C:\work\foo\remote
-> \\baz\spam

Assume that \\baz\spam is down, so C:\work\foo\bar\remote can't be strictly 
resolved. If the non-strict algorithm relies on getting the final path of 
C:\work\foo\bar\remote before resolving the target of "remote", then the result 
for this case will be incorrect.

C:\work\foo\bar\remote
-> C:\work\bar\remote
-> C:\work\bar + ..\remote
-> C:\work\remote
-> \\qux\eggs

--
components: +Windows
nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware
versions:  -Python 3.6, Python 3.7
Added file: https://bugs.python.org/file49984/realpath_posixly.py

___
Python tracker 

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



[issue43939] Deadlock in logging

2021-04-25 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

A few thoughts:

* We normally say "all bets are off" when it comes to manipulating Python 
internals with ctypes.  This issue is just one of many ways to wreak havoc.

* The programming pattern of killing running threads at arbitrary points in 
their execution is inherently fragile.  I don't think other modules are obliged 
to try to support it. 

* The pattern of "acquire(); try: something(); finally release();" is common.  
Logging is only of many modules in the ecosystem that use this pattern.

* ISTM we can't assume that the lock is a context manager because createLock() 
is a public method and users can do anything with it.

* That said, we could add our own __enter__ and __exit__ methods to the Handler 
class.

* Lastly, I have a vague memory that at one point there was a rejected proposal 
to switch logging to use the with-statement throughout.  We should research 
that to see if the reasoning is still applicable or not.

--
nosy: +pitrou, rhettinger
versions:  -Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue43534] turtle.textinput window is not transient

2021-04-25 Thread Senthil Kumaran


Senthil Kumaran  added the comment:


New changeset b47f05157bd05c5825c26389af5be3064a2c1313 by Miss Islington (bot) 
in branch '3.9':
bpo-43534: Fix the turtle module working with multiple root windows GH-25593
https://github.com/python/cpython/commit/b47f05157bd05c5825c26389af5be3064a2c1313


--

___
Python tracker 

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



[issue43534] turtle.textinput window is not transient

2021-04-25 Thread Senthil Kumaran


Senthil Kumaran  added the comment:


New changeset 9ca20fdc4c27e31832adbd6d393a87e7d8953e3c by Miss Islington (bot) 
in branch '3.8':
bpo-43534: Fix the turtle module working with multiple root windows GH-25594
https://github.com/python/cpython/commit/9ca20fdc4c27e31832adbd6d393a87e7d8953e3c


--
nosy: +orsenthil

___
Python tracker 

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



[issue11100] test_fdopen: close failed in file object destructor

2021-04-25 Thread Irit Katriel


Irit Katriel  added the comment:

Closing since python 2.7 is no longer maintained. Please create a new issue if 
this is still an issue in 3.8+

--
nosy: +iritkatriel
resolution:  -> out of date
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



[issue40608] PY3.8 GC segfault (Py_TRASHCAN_SAFE_BEGIN/END are not backwards compatible)

2021-04-25 Thread Irit Katriel


Irit Katriel  added the comment:

There has been no progress on PR12607. I think we should at least deprecate 
Py_TRASHCAN_SAFE_BEGIN/END in 3.10 and tell people to use Py_TRASHCAN_BEGIN/END 
instead.

--

___
Python tracker 

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



[issue43939] Deadlock in logging

2021-04-25 Thread DaRoee


Change by DaRoee :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue43532] Add keyword-only fields to dataclasses

2021-04-25 Thread Eric V. Smith


Change by Eric V. Smith :


--
pull_requests: +24320
pull_request: https://github.com/python/cpython/pull/25608

___
Python tracker 

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



[issue43938] Document that dataclasses.FrozenInstanceError derives from AttributeError

2021-04-25 Thread Llandy Riveron Del Risco


Change by Llandy Riveron Del Risco :


--
keywords: +patch
nosy: +llandy3d
nosy_count: 2.0 -> 3.0
pull_requests: +24319
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/25603

___
Python tracker 

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



[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.11

2021-04-25 Thread miss-islington


miss-islington  added the comment:


New changeset f84f1b5c638eeb6e13c287fe5ebf3a7d2fdb60e9 by Saiyang Gou in branch 
'master':
bpo-38605: Update __future__ module doc as `annotations` is now "mandatory in 
3.11" (GH-25602)
https://github.com/python/cpython/commit/f84f1b5c638eeb6e13c287fe5ebf3a7d2fdb60e9


--

___
Python tracker 

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



[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.11

2021-04-25 Thread Saiyang Gou


Change by Saiyang Gou :


--
pull_requests: +24318
pull_request: https://github.com/python/cpython/pull/25602

___
Python tracker 

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



[issue43908] array.array should remain immutable

2021-04-25 Thread Guido van Rossum


Guido van Rossum  added the comment:

Let's post the list here and post a brief mention of this issue on
python-dev.

--

___
Python tracker 

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



[issue43908] array.array should remain immutable

2021-04-25 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Thanks for the background info, Guido! I'll prepare a list. Should we continue 
the discussion on Discourse or python-dev?

--

___
Python tracker 

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



[issue43908] array.array should remain immutable

2021-04-25 Thread Guido van Rossum


Guido van Rossum  added the comment:

My main concern is that types that were immutable in previous Python versions 
shouldn't become mutable as a surprise side effect of making them heap types. I 
don't know which types have become mutable this way though.

My other concern is that the language design *intentionally* disallowed 
mutating built-in types (unlike some other languages that allow it, e.g. Ruby). 
Mutating built-in types is one of those "attractive nuisance" anti-patterns 
where at a small scale this often appears to be the quickest way to solve a 
problem, but it tends to break unrelated things in larger-scale  applications 
(when different libraries using such tricks collide).

(There's also a concern about mutating types that are shared between multiple 
interpreters, but IIUC heap types are not shared, so this shouldn't be a 
problem.)

Presumably we should review the list of heap types that you are proposing to 
make immutable (in a form more easily digestible by humans than a diff) and 
reach agreement on that. And perhaps the list should include information on 
when a type became a heap type. (Types that were always heap types probably 
needn't be changed.)

--

___
Python tracker 

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



[issue29732] Heap out of bounds read in tok_nextc()

2021-04-25 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> out of date
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue31055] All Sphinx generated pages could have a new "Edit This Page" link adjacent to the existing "Show Source"

2021-04-25 Thread Irit Katriel


Irit Katriel  added the comment:

Another option is to just add a link to https://devguide.python.org/docquality/

--
nosy: +iritkatriel
versions: +Python 3.11 -Python 2.7

___
Python tracker 

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



[issue27420] Docs for os.link - say what happens if link already exists

2021-04-25 Thread Irit Katriel


Irit Katriel  added the comment:

There is a general note at the top of the module:

"Note: All functions in this module raise OSError (or subclasses thereof) in 
the case of invalid or inaccessible file names and paths, or other arguments 
that have the correct type, but are not accepted by the operating system."


So there seems to have been a decision not state this separately for each 
function in the module.

--
nosy: +iritkatriel
resolution:  -> wont fix
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



[issue26810] inconsistent garbage collector behavior across platforms when using ctypes data-structures

2021-04-25 Thread Irit Katriel


Irit Katriel  added the comment:

I don't think GC is even guaranteed to do exactly the same thing in two 
different runs on the same platform. If objects are hashed by id (memory 
address) and then traversed then couldn't the order in which unrelated objects 
are deleted be non-deterministic?

In any case, 2.7 is no longer maintained. If you can provide a simple repro 
script for 3.9+, a GC expert may look at it. Open a new issue if you do that.

--
nosy: +iritkatriel
resolution:  -> not a bug
stage: test needed -> 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



[issue32822] finally block doesn't re-raise exception if return statement exists inside

2021-04-25 Thread robertohueso


Change by robertohueso :


--
keywords: +patch
nosy: +robertohueso
nosy_count: 4.0 -> 5.0
pull_requests: +24317
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/25600

___
Python tracker 

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



[issue43939] Deadlock in logging

2021-04-25 Thread DaRoee

New submission from DaRoee :

I've recently encountered a weird bug. To make a long story short, I’ve been 
using an external package to make sure my threads stop working in time, and 
appearently it’s been using ctypes.pythonapi.PyThreadState_SetAsyncExc.
There is a slight chance, that this code that is literally injecting an 
exception in the thread, will throw an exception in the handle function of the 
logger, right after the acquire. This will make the whole process deadlocked 
(only the thread with the exception will be able to continue logging) once the 
other threads try to log.

While I totally understand that this is not a casual use case, I think that the 
logger should be able to handle situations such as this...
The good news is that I’ve created a test (attached) that once you run it with 
pytest it’ll reproduce constantly (even though it’s a statistical bug), and the 
solution for this is relatively easy. Once we change the lock to use context 
manager the whole action is much more atomic, making the test pass constantly.

I’d be happy to help solve it, and replace locks to context manager usage 
throughout the file (or whatever the maintainers see fit for this).

--
components: Library (Lib)
files: reproduction_test.py
messages: 391862
nosy: DaRoee
priority: normal
severity: normal
status: open
title: Deadlock in logging
type: behavior
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file49983/reproduction_test.py

___
Python tracker 

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



[issue43938] Document that dataclasses.FrozenInstanceError derives from AttributeError

2021-04-25 Thread Eric V. Smith


New submission from Eric V. Smith :

This is a newcomer friendly issue. The documentation just needs a sentence that 
FrozenInstanceError is derived from AttributeError.

--
assignee: docs@python
components: Documentation
keywords: easy, newcomer friendly
messages: 391861
nosy: docs@python, eric.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: Document that dataclasses.FrozenInstanceError derives from AttributeError
versions: Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

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



[issue24026] Python hangs forever in wait() of threading.py

2021-04-25 Thread Irit Katriel


Irit Katriel  added the comment:

Python 2.7 is no longer maintained. If this is still a problem in python 3.8+, 
and you manage to produce a repro script, please open a new issue for it.

--
nosy: +iritkatriel
resolution:  -> third party
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



[issue35676] unittest assert helper methods have incorrect signature in docs

2021-04-25 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.7, Python 
3.8

___
Python tracker 

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



[issue8579] Add missing tests for FlushKey, LoadKey, and SaveKey in winreg

2021-04-25 Thread Irit Katriel


Change by Irit Katriel :


--
components: +Tests
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4

___
Python tracker 

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



[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.11

2021-04-25 Thread Anthony Sottile


Change by Anthony Sottile :


--
nosy: +Anthony Sottile
nosy_count: 14.0 -> 15.0
pull_requests: +24316
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/25596

___
Python tracker 

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



[issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs.

2021-04-25 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

I have added a PR to remove ascii newlines and tabs from URL input. It is as 
per the WHATWG spec.


However, I still like to research more and find out if this isn't introducing 
behavior that will break existing systems. It should also be aligned the 
decisions we have made with previous related bug reports. 

Please review.

--
stage: patch review -> needs patch

___
Python tracker 

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



[issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs.

2021-04-25 Thread Senthil Kumaran


Change by Senthil Kumaran :


--
keywords: +patch
pull_requests: +24315
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/25595

___
Python tracker 

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



[issue43534] turtle.textinput window is not transient

2021-04-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24314
pull_request: https://github.com/python/cpython/pull/25594

___
Python tracker 

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



[issue43534] turtle.textinput window is not transient

2021-04-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24313
pull_request: https://github.com/python/cpython/pull/25593

___
Python tracker 

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



[issue43534] turtle.textinput window is not transient

2021-04-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 8af929fc76f21fb123f6a47cb3ebcf4e5b758dea by Serhiy Storchaka in 
branch 'master':
bpo-43534: Fix the turtle module working with multiple root windows (GH-25591)
https://github.com/python/cpython/commit/8af929fc76f21fb123f6a47cb3ebcf4e5b758dea


--

___
Python tracker 

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



[issue38490] statistics: add covariance, Pearson's correlation, and simple linear regression

2021-04-25 Thread Tal Einat


Tal Einat  added the comment:

Thanks for the suggestion, PR, and great heaps of patience and perseverance, 
Tymek!

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



[issue38490] statistics: add covariance, Pearson's correlation, and simple linear regression

2021-04-25 Thread Tal Einat

Tal Einat  added the comment:


New changeset 09aa6f914dc313875ff18474770a0a7c13ea8dea by Tymoteusz Wołodźko in 
branch 'master':
bpo-38490: statistics: Add covariance, Pearson's correlation, and simple linear 
regression (#16813)
https://github.com/python/cpython/commit/09aa6f914dc313875ff18474770a0a7c13ea8dea


--

___
Python tracker 

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



[issue43655] Tkinter: make X window & macOS recognize dialogs as such

2021-04-25 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



[issue43655] Tkinter: make X window & macOS recognize dialogs as such

2021-04-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 6077efa2b2be17e736d061fe74f933dc616c64b2 by Miss Islington (bot) 
in branch '3.8':
[3.9] bpo-43655: Tkinter and IDLE dialog windows are now recognized as dialogs 
by window managers on macOS and X Window (GH-25187). (GH-25588) (GH-25592)
https://github.com/python/cpython/commit/6077efa2b2be17e736d061fe74f933dc616c64b2


--

___
Python tracker 

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



[issue43914] Highlight invalid ranges in SyntaxErrors

2021-04-25 Thread Andre Roberge


Change by Andre Roberge :


--
nosy: +aroberge

___
Python tracker 

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



[issue43655] Tkinter: make X window & macOS recognize dialogs as such

2021-04-25 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +24312
pull_request: https://github.com/python/cpython/pull/25592

___
Python tracker 

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



[issue43655] Tkinter: make X window & macOS recognize dialogs as such

2021-04-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 9a165399aec930f27639dd173426ccc33586662b by Serhiy Storchaka in 
branch '3.9':
[3.9] bpo-43655: Tkinter and IDLE dialog windows are now recognized as dialogs 
by window managers on macOS and X Window (GH-25187). (GH-25588)
https://github.com/python/cpython/commit/9a165399aec930f27639dd173426ccc33586662b


--

___
Python tracker 

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



[issue43534] turtle.textinput window is not transient

2021-04-25 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



[issue43534] turtle.textinput window is not transient

2021-04-25 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests:  -24310

___
Python tracker 

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



[issue43937] Turtle uses the default root window

2021-04-25 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue43534] turtle.textinput window is not transient

2021-04-25 Thread miss-islington


miss-islington  added the comment:


New changeset c70f268523cb3213693710e14c0fcae81fd3fa7a by Miss Islington (bot) 
in branch '3.8':
bpo-43534: Make dialogs in turtle.textinput() and turtle.numinput() transitient 
again (GH-24923)
https://github.com/python/cpython/commit/c70f268523cb3213693710e14c0fcae81fd3fa7a


--

___
Python tracker 

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



[issue43664] Compiling long expression leads to segfault (again)

2021-04-25 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Eval with too high string multiplication crashes newer Python 
versions

___
Python tracker 

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



[issue43534] turtle.textinput window is not transient

2021-04-25 Thread miss-islington


miss-islington  added the comment:


New changeset 7248ce30bb84f2d5af855a867cc4e3cc40a07fb5 by Miss Islington (bot) 
in branch '3.9':
bpo-43534: Make dialogs in turtle.textinput() and turtle.numinput() transitient 
again (GH-24923)
https://github.com/python/cpython/commit/7248ce30bb84f2d5af855a867cc4e3cc40a07fb5


--

___
Python tracker 

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



[issue39529] Deprecate get_event_loop()

2021-04-25 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> enhancement
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



[issue39529] Deprecate get_event_loop()

2021-04-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 172c0f2752d8708b6dda7b42e6c5a3519420a4e8 by Serhiy Storchaka in 
branch 'master':
bpo-39529: Deprecate creating new event loop in asyncio.get_event_loop() 
(GH-23554)
https://github.com/python/cpython/commit/172c0f2752d8708b6dda7b42e6c5a3519420a4e8


--

___
Python tracker 

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



[issue42609] Eval with too high string multiplication crashes newer Python versions

2021-04-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset face87c94e67ad9c72b9a3724f112fd76c1002b9 by Serhiy Storchaka in 
branch 'master':
bpo-42609: Check recursion depth in the AST validator and optimizer (GH-23744)
https://github.com/python/cpython/commit/face87c94e67ad9c72b9a3724f112fd76c1002b9


--

___
Python tracker 

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



[issue43534] turtle.textinput window is not transient

2021-04-25 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +24310
pull_request: https://github.com/python/cpython/pull/25591

___
Python tracker 

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



[issue43937] Turtle uses the default root window

2021-04-25 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Some of methods in the turtle module implicitly use the default root window: 
call global mainloop() and create PhotoImage without specifying the master 
window. It can cause a problem if multiple root windows are used.

--
components: Library (Lib)
messages: 391849
nosy: gregorlingl, serhiy.storchaka, willingc
priority: normal
severity: normal
status: open
title: Turtle uses the default root window
type: behavior
versions: Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

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



[issue43534] turtle.textinput window is not transient

2021-04-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset b5adc8a7e5c13d175b4d3e53b37bc61de35b1457 by Serhiy Storchaka in 
branch 'master':
bpo-43534: Make dialogs in turtle.textinput() and turtle.numinput() transitient 
again (GH-24923)
https://github.com/python/cpython/commit/b5adc8a7e5c13d175b4d3e53b37bc61de35b1457


--

___
Python tracker 

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



[issue43534] turtle.textinput window is not transient

2021-04-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24309
pull_request: https://github.com/python/cpython/pull/25590

___
Python tracker 

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



[issue43534] turtle.textinput window is not transient

2021-04-25 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +24308
pull_request: https://github.com/python/cpython/pull/25589

___
Python tracker 

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



[issue43655] Tkinter: make X window & macOS recognize dialogs as such

2021-04-25 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +24307
pull_request: https://github.com/python/cpython/pull/25588

___
Python tracker 

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



[issue43655] Tkinter: make X window & macOS recognize dialogs as such

2021-04-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 3bb3fb3be09d472a43cdc3d9d9578bd49f3dfb8c by Serhiy Storchaka in 
branch 'master':
bpo-43655: Tkinter and IDLE dialog windows are now recognized as dialogs by 
window managers on macOS and X Window (#25187)
https://github.com/python/cpython/commit/3bb3fb3be09d472a43cdc3d9d9578bd49f3dfb8c


--

___
Python tracker 

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



[issue43466] ssl/hashlib: Add configure option to set or auto-detect rpath to OpenSSL libs

2021-04-25 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +24306
pull_request: https://github.com/python/cpython/pull/25587

___
Python tracker 

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



[issue43908] array.array should remain immutable

2021-04-25 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

The more I read about these issues, the more I feel reluctant to apply PR 
25520. Why change the behaviour/traits of heap types without a proper 
discussion (or PEP)? Applying this PR feels like an arbitrary change. All the 
related issues and mailing list discussions seems to end without consensus, and 
fundamental questions (what is an immutable type? which types should be 
immutable? why is it a problem that a type is mutable?) seems to be avoided all 
the time.

And, as Victor points out in msg391596 (and which has also been pointed out by 
others in other discussions):
> Currently, the limitation of not being able to modify a built-in type is 
> arbitrary, it's not a technical limitation

FWIW #1, in pypy3, datetime.timedelta.foo = 1 is ok; in python3 (3.7-3.10) it's 
not.

FWIW #2, in Python 3.9, functools.partialmethod is implemented in Python, and 
functools.partial is implemented in C as a static type:
$ python3.9
>>> import functools
>>> functools.partial.foo = 1  # is this a problem?
Traceback (most recent call last):
  File "", line 1, in 
TypeError: can't set attributes of built-in/extension type 'functools.partial'
>>> functools.partialmethod.foo = 1  # is this a problem?


If I'm only bringing noise into the discussion, feel free to remove me from the 
nosy list.

--

___
Python tracker 

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



[issue43892] Make match patterns explicit in the AST

2021-04-25 Thread Nick Coghlan


Nick Coghlan  added the comment:

PR against the main repo is now up: https://github.com/python/cpython/pull/25585

A couple of things in the unparser tripped me up (ast_unparse.c only handles 
annotation expressions, the way ast._Unparser.visit() is defined means 
NodeVisitor.generic_visit can't be used), so the PR also includes some 
clarifying comments for future editors.

--

___
Python tracker 

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



[issue43892] Make match patterns explicit in the AST

2021-04-25 Thread Nick Coghlan


Change by Nick Coghlan :


--
pull_requests: +24305
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/25585

___
Python tracker 

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



[issue43892] Make match patterns explicit in the AST

2021-04-25 Thread Nick Coghlan


Nick Coghlan  added the comment:

Working on the unparser picked up an inconsistency I had previously missed: 
aside from named expressions, "target" attributes in the AST are generally full 
expression subnodes, rather than identifier attributes. Identifier attributes 
on nodes are typically called "name", including in the originally implemented 
MatchAs node.

Accordingly, I've switched both MatchStar and MatchAs over to having "name" 
attributes instead of "target" attributes.

--

___
Python tracker 

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



[issue11354] argparse: nargs could accept range of options count

2021-04-25 Thread paul j3


paul j3  added the comment:

Post parsing testing for the correct number of strings is the easy part.

It's the auto-generate usage that's harder to do right, especially if we wanted 
to enable the metavar tuple option.  Clean usage for '+' is messy enough.

--

___
Python tracker 

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



[issue43892] Make match patterns explicit in the AST

2021-04-25 Thread Nick Coghlan


Nick Coghlan  added the comment:

Interesting idea - I had missed that you were suggested "identifier*" for the 
cls node. It's simple enough to check for Name-or-Attribute in the AST 
validator though, and sticking with a standard expr_ty node means getting a lot 
of standard handling in the rest of the compiler and the unparser.

My commitments today finished earlier than I expected, so I'm about to tackle 
the unparser now.

--

___
Python tracker 

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



[issue43876] argparse documentation contrasting nargs '*' vs. '+' is misleading

2021-04-25 Thread paul j3


paul j3  added the comment:

Let's see if I can clarify somethings.  But first, I should say that I've 
worked with this code for so long, that I may miss things that could confuse a 
beginner.

A basic distinction is between "optionals" and "positionals".  I put those in 
quotes because that's not the same as "required or not".  Talk about "options" 
in commandline arguments goes way back (see getopt, and optparse).

An "optional" is identified by a flag string, such as "-f" or "--foo", short or 
long, single or double dash.  I prefer to call these "flagged arguments".  
"optionals" can occur in any order, and even repeatedly.

A "postional" is identified by position, without any sort of flag string.  In 
earlier parsers, these where the extras, the strings that weren't handled by 
"options".  These can only occur in the defined order.  

Conventionally, optionals come first, and positionals at the end.  That's how 
most "help/usage" messages display them.  But argparse tries to handle them in 
any order.

Both kinds can take a "nargs" parameter.  This specifies how many arguments (or 
strings) are required, either following the flag string, or as part of 
position.  Obviously if you don't specify the flag, you don't have to provide 
its arguments either.  

There's another point of confusion.  "parse.add_argument" creates an "Action", 
also called an "argument".  And each "action" has a 'nargs' that specifies how 
many "arguments" go along with it.  Sorry.


The default "nargs" value is "None", which means 1 string.  "?" means zro or 
one (optional, but in a different sense than flagged).  "*" means any number.  
"+" means one or more.  nargs could also be a number, e.g. "2".  There isn't 
anything that specifies "2 or more" or "2 or 3" (though that has been 
requested).  "?+*" are used in basically the same sense as in regex/re patterns.

There's another parameter, "action", which also controls the number of required 
strings.  With "store_true" no string is allowed after the flag, effectively 
"nargs=0" (this action makes no sense for positionals).  It's actually of 
subclass of "store_const", with a default "False" and const "True".

With a flagged argument, you may also specify a "required" parameter.  That's 
convenient, but does lead to confusing terminology.  "optionals" may be 
"required", and a "positional" with "?" is optional/not-required.  

Since "+" and "*" allow many strings, something has to define the end of that 
list.  That end is either the end of the input, or the next flag string. If you 
are just using flagged arguments this isn't a problem.  But with "positionals", 
it is hard to handle more than one open-end nargs.  Or to use such a 
"positional" after an open-ended "optional".  As with regex, these nargs are 
"greedy".  

In some ways, the documentation is more complicated than the code itself.  The 
code is well written, with different methods and classes handling different 
issues.  The code itself does not have a lot of complicated rules and 
conditions.  The complexity comes from how the different pieces interact.

"flagged vs positional", nargs, and "required" are separate specifications, 
though they do have significant interactions.


In your example:

parser.add_argument("outdata", help="Path to output data file")
parser.add_argument("plotTimes", nargs='*', help="Times to plot")
parser.add_argument("outplot", help="Path to output plot file")

"outdata" takes one string.  "outplot" takes another.  "plotTimes" then gets 
anything left over in between.  An empty list of strings satisfies its "nargs". 
 The strings are actually allocated with a regex expression.

With `arg_argument('--foo', nargs='+')`,

--foo one
--foo one two three

are both allowed.  With "*",

 --foo

is also allowed.  For a "positional" omit the "--foo".  That means that a 
"positional" with "*" is always seen (which can require some special edge case 
handling).

--
nosy: +paul.j3

___
Python tracker 

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



[issue41486] Add _BlocksOutputBuffer for bz2/lzma/zlib module

2021-04-25 Thread Ma Lin


Ma Lin  added the comment:

> The defines of BOB_BUFFER_TYPE/BOB_SIZE_TYPE/BOB_SIZE_MAX are ugly. If put 
> the core code together, these defines can be put in a thin wrapper in 
> _bz2module.c/_lzmamodule.c/zlibmodule.c files.

I tried, it looks well.
I will updated the PR within one or two days.
The code is more concise, and the burden of review is not big.

--

___
Python tracker 

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