[issue45546] Unable to pickle enum with nested frozen dataclass?

2021-11-03 Thread Ethan Furman


Change by Ethan Furman :


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

___
Python tracker 

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



[issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved

2021-11-03 Thread miss-islington


miss-islington  added the comment:


New changeset e813dd4d7bb0ecfabc7dae75e13f58164bcf8da6 by Miss Islington (bot) 
in branch '3.9':
bpo-45680: ``typing`` docs: improve links to docs on 
``GenericAlias``/``__class_getitem__`` (GH-29387)
https://github.com/python/cpython/commit/e813dd4d7bb0ecfabc7dae75e13f58164bcf8da6


--

___
Python tracker 

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



[issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved

2021-11-03 Thread miss-islington


miss-islington  added the comment:


New changeset c10896696f47a8348e6d9ea3c1d96fa6ba131a31 by Miss Islington (bot) 
in branch '3.10':
bpo-45680: ``typing`` docs: improve links to docs on 
``GenericAlias``/``__class_getitem__`` (GH-29387)
https://github.com/python/cpython/commit/c10896696f47a8348e6d9ea3c1d96fa6ba131a31


--

___
Python tracker 

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



[issue45707] Variable reassginment triggers incorrect behaviors of locals()

2021-11-03 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

This is a documented feature of locals() (it's definitionally impossible to 
auto-vivify *real* locals, because real locals are statically assigned to 
specific indices in a fixed size array at function compile time, and the 
locals() function is returning a copy of said bindings, not a live view of 
them).

--
nosy: +josh.r
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



[issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved

2021-11-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27659
pull_request: https://github.com/python/cpython/pull/29400

___
Python tracker 

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



[issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved

2021-11-03 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved

2021-11-03 Thread Ken Jin


Ken Jin  added the comment:


New changeset e03e50377d6f8f212af60fed4ae405ebeb73237d by Alex Waygood in 
branch 'main':
bpo-45680: ``typing`` docs: improve links to docs on 
``GenericAlias``/``__class_getitem__`` (GH-29387)
https://github.com/python/cpython/commit/e03e50377d6f8f212af60fed4ae405ebeb73237d


--

___
Python tracker 

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



[issue45707] Variable reassginment triggers incorrect behaviors of locals()

2021-11-03 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

>From https://docs.python.org/3/library/functions.html#exec :

"modifications to the default locals dictionary should not be attempted. Pass 
an explicit locals dictionary if you need to see effects of the code on locals 
after function exec() returns."

There was also some discussion about potentially clarifying the locals() 
semantics in this PEP: https://www.python.org/dev/peps/pep-0558/

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue45707] Variable reassginment triggers incorrect behaviors of locals()

2021-11-03 Thread Xinmeng Xia


New submission from Xinmeng Xia :

Normally after executing a piece of code in a function, locals() should contain 
the local variables and these variables can be reassigned next. In the 
following code, "attr" should be found in locals(). Actually, it can not be 
found in either locals() or globals() after executing code "attr = 1". This 
program triggers a keyError. I think something wrong during handling locals().


def foo():
exec("attr = 1")
a = locals()['attr']
attr = 2 
foo()


Reported Error:
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 3, in foo
KeyError: 'attr'


Expected output:
This test program should work well. The value of a is 1 and the value of attr 
is 2 after execution. No error is reported.

Python version: python3.10, Ubuntu 16.04

--
components: Interpreter Core
messages: 405660
nosy: xxm
priority: normal
severity: normal
status: open
title: Variable reassginment triggers incorrect behaviors of locals()
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



[issue45706] Add IMAP4.login_plain to imaplib

2021-11-03 Thread Prem Buczkowski


Change by Prem Buczkowski :


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

___
Python tracker 

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



[issue43652] Upgrade Windows tcl/tk to 8.6.11

2021-11-03 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +27655
pull_request: https://github.com/python/cpython/pull/29397

___
Python tracker 

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



[issue45706] Add IMAP4.login_plain to imaplib

2021-11-03 Thread Prem Buczkowski


Change by Prem Buczkowski :


--
type:  -> enhancement

___
Python tracker 

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



[issue45706] Add IMAP4.login_plain to imaplib

2021-11-03 Thread Prem Buczkowski


New submission from Prem Buczkowski :

Hi everyone and nice to meet you!

I would like to propose adding a method login_plain to Python IMAP4 standard 
library client.

Currently, one can use login, login_cram_md5 or add their own authentication 
method using authenticate. While login works great for plain text 
authentication for English users, it does not support characters out of ASCII, 
causing errors for users with non-ASCII passwords. 

I personally hit that with radicale-imap. It has been reported in issue34577, 
and its SMTP counterpart in issue29750.

RFC6855 recommends using AUTHENTICATE for such cases, and so this patch adds 
login_plain in a manner similar to login_cram_md5. Adding this to a standard 
library will improve the experience for non-English users not only when 
programming but also when using other programs written in Python. AUTHENTICATE 
PLAIN is on by default in Dovecot and most e-mail providers, like Gmail and 
Outlook, making it more common than, already supported, AUTHENTICATE CRAM-MD5.

Since this is my first patch, let me know if I could change something up - I 
did my best to RTFM!

--
components: Library (Lib), email
files: 0107-Add-imaplib.IMAP4.login_plain.patch
keywords: patch
messages: 405659
nosy: barry, przemub, r.david.murray
priority: normal
severity: normal
status: open
title: Add IMAP4.login_plain to imaplib
Added file: 
https://bugs.python.org/file50424/0107-Add-imaplib.IMAP4.login_plain.patch

___
Python tracker 

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



[issue45582] Rewrite getpath.c in Python

2021-11-03 Thread Steve Dower


Steve Dower  added the comment:

Unsurprisingly, it was a bad edit that I made to the Makefile myself. The 
commit that undoes it is 
https://github.com/python/cpython/pull/29041/commits/aedebcc45a638f5cf65d17046ae09b5cac97cebf
 but since I made the initial change as part of this PR, it was never merged in.

Now to find out why the old getpath could somehow locate the stdlib but new 
getpath cannot... (I'm guessing it is finding the "original" stdlib rather than 
the fresh clone, since AFAICT there's no reference at all to the original 
source dir)

--

___
Python tracker 

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



[issue45220] Windows builds sometimes fail on Azure and GitHub Action: fatal error RC1116: RC terminating after preprocessor errors

2021-11-03 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +27654
pull_request: https://github.com/python/cpython/pull/29396

___
Python tracker 

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



[issue44828] tkinter.filedialog linked with Tk 8.6.11 crashes on macOS 12 Monterey, breaking IDLE saves

2021-11-03 Thread Zack McCauley


Zack McCauley  added the comment:

Awesome, thanks for the clear update reason. Makes more sense now. I was
able to get our software to patch around.

An API to get the installer urls would be super helpful.

Thanks Ned!

On Wed, Nov 3, 2021 at 4:19 PM Ned Deily  wrote:

>
> Ned Deily  added the comment:
>
> After I posted the previous reply, I saw that there have been other users
> affected by this, so I have now also made the updated installer available
> under the old URL.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue44828] tkinter.filedialog linked with Tk 8.6.11 crashes on macOS 12 Monterey, breaking IDLE saves

2021-11-03 Thread Ned Deily


Ned Deily  added the comment:

After I posted the previous reply, I saw that there have been other users 
affected by this, so I have now also made the updated installer available under 
the old URL.

--

___
Python tracker 

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



[issue45705] |= set update scoping

2021-11-03 Thread Steven D'Aprano


Change by Steven D'Aprano :


--
stage:  -> resolved

___
Python tracker 

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



[issue44828] tkinter.filedialog linked with Tk 8.6.11 crashes on macOS 12 Monterey, breaking IDLE saves

2021-11-03 Thread Ned Deily


Ned Deily  added the comment:

> Could this be bumped to a version update to like 3.10.1 or just replace the 
> old package with this updated one?

I'm sorry that this caused problems for you. We rarely update the artifacts for 
a release but, in this case, 3.10.1 was not scheduled for release until the 
beginning of December (the normal 2-month release cycle) and there have been no 
problems identified so far with 3.10.0 that warrant expediting 3.10.1, 
something that would affect all platforms and downstream users and suppliers. 
On the other hand, this issue was a critical one but only for IDLE and tkinter 
users of the python.org macOS installer who have upgraded to macOS 12 Monterey, 
a very much smaller group and there was no easy workaround for those users. 
Simply replacing the installer without changing the URL file name, a so-called 
stealth update, is, in general, a very bad practice; it leads to even more 
confusion and we also want to make sure that the obsoleted installer is no 
longer being downloaded. As far as I know, we have never made any guarantees 
about the format of the URL of our download files; and, in fact, the fil
 e name format for the default python.org macOS installers *has* changed over 
the years as we have introduced new installer variants, stopped producing old 
ones, and changed the default variant, something that is planned to happen 
again in the upcoming 3.9.8 release. So the only reliable way to automatically 
find file names is from one of the python.org web pages, like for the release 
or for the platform (i.e. https://www.python.org/downloads/macos/). It would be 
better to fully support a REST API to provide access to release file data. 
There is an open website issue about that: 
https://github.com/python/pythondotorg/issues/1352

--

___
Python tracker 

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



[issue45697] PyType_IsSubtype is doing excessive work in the common case

2021-11-03 Thread Itamar Ostricher


Itamar Ostricher  added the comment:

thanks for the feedback Serhiy!

repeating my response from the PR here as well (not sure what's the proper 
etiquette.. :-) )

note that this code path is not for creating new types (which is slow as you 
say), but for creating new instances (which is quite fast).

I ran some synthetic benchmarks with this change and without it (on an opt 
build with PGO and LTO), and the gain is measurable:

build from main (commit acc89db9233abf4d903af9a7595a2ed7478fe7d3 which is the 
base commit for this PR):

```
>for _ in {1..10}; do ./main-opt/python -m timeit -n 1 -s 'class Spam: 
>pass' -- 'ten_k_spams = [Spam() for _ in range(1)]'; done
1 loops, best of 5: 896 usec per loop
1 loops, best of 5: 887 usec per loop
1 loops, best of 5: 857 usec per loop
1 loops, best of 5: 838 usec per loop
1 loops, best of 5: 847 usec per loop
1 loops, best of 5: 863 usec per loop
1 loops, best of 5: 845 usec per loop
1 loops, best of 5: 902 usec per loop
1 loops, best of 5: 890 usec per loop
1 loops, best of 5: 875 usec per loop
```

build with this change applied (commit 
2362bf67e8acee49c6f97ea754d59dfd8982e07c):

```
>for _ in {1..10}; do ./test-opt/python -m timeit -n 1 -s 'class Spam: 
>pass' -- 'ten_k_spams = [Spam() for _ in range(1)]'; done
1 loops, best of 5: 833 usec per loop
1 loops, best of 5: 885 usec per loop
1 loops, best of 5: 845 usec per loop
1 loops, best of 5: 838 usec per loop
1 loops, best of 5: 833 usec per loop
1 loops, best of 5: 827 usec per loop
1 loops, best of 5: 858 usec per loop
1 loops, best of 5: 811 usec per loop
1 loops, best of 5: 843 usec per loop
1 loops, best of 5: 845 usec per loop
```

also worth noting that the previous approach (GH-29380) was implemented on the 
Instagram Server production workload in Meta/Facebook/Instagram (choose your 
favorite) and resulted measurable perf gain of around 0.2%

--

___
Python tracker 

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



[issue45582] Rewrite getpath.c in Python

2021-11-03 Thread Steve Dower


Steve Dower  added the comment:

I'm betting the out-of-tree (actually just deeper within the same tree) bit is 
related, but I just can't see how. Modules/getbuildinfo.c takes extra 
parameters and they seem to be being used, so I can't tell why getpath.c's are 
not (those rules are listed right next to each other, but well above the .c.o 
rule).

--

___
Python tracker 

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



[issue45615] Missing test for type of error when printing traceback for non-exception

2021-11-03 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue45614] traceback of exception with non-unicode __module__

2021-11-03 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue45694] Limit the number of chained exceptions included in formatted traceback

2021-11-03 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue45635] Tidy up error handling in traceback.c / python run.c

2021-11-03 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue45678] `functools.singledispatchmethod` is missing tests (and is buggy in 3.9)

2021-11-03 Thread Alex Waygood


Alex Waygood  added the comment:

Backporting these tests to 3.9 revealed a bug in the 3.9 branch; PR 29394 is an 
attempt at fixing this bug.

--

___
Python tracker 

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



[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-03 Thread Jim Crist-Harif


Jim Crist-Harif  added the comment:

> Is tornado the only example or you are aware of other libraries with such 
> behavior?

A quick survey of other language network stacks didn't turn anything up, *But* 
I also didn't find any implementations (other than asyncio & tornado) that bind 
multiple sockets with a single api call (as `create_server` does).

I think part of the issue here is that dual IPV6 & IPV4 support is 
intentionally disabled in asyncio (and tornado), so two sockets are needed (one 
to support each interface). Other TCP implementations (e.g. both go and rust) 
don't disable this, so one listener == one socket. This makes comparing API 
designs across stacks harder - with e.g. Go it's straightforward to listen on a 
random port on IPV4 & IPV6 with a single TCPListener, since both can be handled 
by a single socket. Since this is disabled (by default) in asyncio we end up 
using 2 sockets and run into the issue described above.

Also note that this issue will trigger for any address that resolves to 
multiple interfaces (not just `host=""`). For example, on osx `localhost` will 
resolve to `::1` and `127.0.0.1` by default, meaning that the following fairly 
straightforward asyncio code has a bug in it:

```python
# Start a server on localhost with a random port
server = await loop.create_server(
EchoServerProtocol,
host="localhost",
port=0
)

# Retrieve and log the port
port = server.sockets[0].getsockname()[1]
print(f"listening at tcp://localhost:{port}")
```

As written, this looks correct enough, but on systems where localhost resolves 
to multiple interfaces this will accidentally listen on multiple ports (instead 
of one). This can be fixed with some additional logic external to asyncio, but 
it makes for a much less straightforward asyncio example.

--

___
Python tracker 

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



[issue45613] [sqlite3] set threadsafety attribute based on default SQLite threaded mode

2021-11-03 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


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



[issue44257] typo and verbous grammar in the grammar spec

2021-11-03 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue44257] typo and verbous grammar in the grammar spec

2021-11-03 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +27653
pull_request: https://github.com/python/cpython/pull/29395

___
Python tracker 

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



[issue45546] Unable to pickle enum with nested frozen dataclass?

2021-11-03 Thread Ethan Furman


Ethan Furman  added the comment:

Eric, I'm already aware of the nested class issue; what I was hoping for was 
your actual use-case?  You're pickling and sending an entire enum (and all its 
members) to another system/process?

--

___
Python tracker 

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



[issue45613] [sqlite3] set threadsafety attribute based on default SQLite threaded mode

2021-11-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset c2739867113a2b650db300c03ef06cf18dcee3f4 by Erlend Egeberg 
Aasland in branch 'main':
bpo-45613: Set `sqlite3.threadsafety` dynamically (GH-29227)
https://github.com/python/cpython/commit/c2739867113a2b650db300c03ef06cf18dcee3f4


--
nosy: +pablogsal

___
Python tracker 

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



[issue44257] typo and verbous grammar in the grammar spec

2021-11-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 762173c6709f5cf3b59cbbe47d4e6fafbfe7ec2a by wim glenn in branch 
'main':
bpo-44257: fix "assigment_expr" typo + regenerate the grammar, and remove 
unused imports (GH-29393)
https://github.com/python/cpython/commit/762173c6709f5cf3b59cbbe47d4e6fafbfe7ec2a


--
nosy: +pablogsal

___
Python tracker 

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



[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-03 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

PR for documentation fix is appreciated.

Random fails to bind the same port if free ports are available is kind of 
regression.

Is tornado the only example or you are aware of other libraries with such 
behavior?

--

___
Python tracker 

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



[issue45705] |= set update scoping

2021-11-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This is not a bug. You are getting an UnboundLocalError because in the scope of 
scoped_def function, scoped_dict is marked as local (because you assign to it 
in the function) but you are reading it before that. 

Please, take a look at:

https://docs.python.org/3/faq/programming.html#why-am-i-getting-an-unboundlocalerror-when-the-variable-has-a-value

and possibly at

https://docs.python.org/3.3/tutorial/classes.html#python-scopes-and-namespaces
https://docs.python.org/3/library/exceptions.html#UnboundLocalError

--
resolution:  -> not a bug
stage: resolved -> 

___
Python tracker 

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



[issue45705] |= set update scoping

2021-11-03 Thread James Bowery


James Bowery  added the comment:

My mistake.  Disregard.

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



[issue44828] tkinter.filedialog linked with Tk 8.6.11 crashes on macOS 12 Monterey, breaking IDLE saves

2021-11-03 Thread Zack McCauley


Zack McCauley  added the comment:

Could this be bumped to a version update to like 3.10.1 or just replace the old 
package with this updated one? The package name and format now break 
automations that relied on matching version names in the url. This pattern has 
worked since 2.7 releases. For example: 

https://www.python.org/ftp/python/3.10.0/python-3.10.0-macos11.pkg no longer 
works

https://www.python.org/ftp/python/3.9.7/python-3.9.7-macos11.pkg works

--
nosy: +WardsParadox
status: pending -> open

___
Python tracker 

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



[issue45705] |= set update scoping

2021-11-03 Thread James Bowery


New submission from James Bowery :

Comment out the |= line and it prints "{'b':2}" as expected.

$ cat t.py
scoped_dict = {'b':2}
def scoped_def():
print(scoped_dict)
scoped_dict |= {'a',1}
scoped_def()

$ p t.py 
Traceback (most recent call last):
  File "/home/jabowery/dev/t.py", line 5, in 
scoped_def()
  File "/home/jabowery/dev/t.py", line 3, in scoped_def
print(scoped_dict)
UnboundLocalError: local variable 'scoped_dict' referenced before assignment

$ python --version
Python 3.10.0

--
components: Parser
messages: 405643
nosy: jabowery2, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: |= set update scoping
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



[issue45697] PyType_IsSubtype is doing excessive work in the common case

2021-11-03 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Creating a new type takes microseconds, and using PyObject_TypeCheck() instead 
of PyType_IsSubtype() can save nanoseconds. So, while this replacement looks 
harmless, its effect can hardly be measured even in microbenchmarks.

--

___
Python tracker 

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



[issue45582] Rewrite getpath.c in Python

2021-11-03 Thread Eric Snow


Eric Snow  added the comment:

On Wed, Nov 3, 2021 at 1:21 PM Steve Dower  wrote:
> Last remaining test failure is one that I can't figure out on my own - the 
> freeze test is rerunning a CPython build (on Linux) and is apparently 
> building getpath.c with the ".c.o" rule rather than the "Modules/getpath.o" 
> rule.
>
> Any tips as to what I should be looking at to figure this one out?

That test does an out-of-tree build.  Might that be related?

--

___
Python tracker 

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



[issue45678] `functools.singledispatchmethod` is missing tests (and is buggy in 3.9)

2021-11-03 Thread Alex Waygood


Change by Alex Waygood :


--
components: +Library (Lib)
title: `functools.singledispatchmethod` is missing tests -> 
`functools.singledispatchmethod` is missing tests (and is buggy in 3.9)

___
Python tracker 

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



[issue45678] `functools.singledispatchmethod` is missing tests

2021-11-03 Thread Alex Waygood


Change by Alex Waygood :


--
pull_requests: +27652
pull_request: https://github.com/python/cpython/pull/29394

___
Python tracker 

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



[issue45582] Rewrite getpath.c in Python

2021-11-03 Thread Steve Dower


Steve Dower  added the comment:

Last remaining test failure is one that I can't figure out on my own - the 
freeze test is rerunning a CPython build (on Linux) and is apparently building 
getpath.c with the ".c.o" rule rather than the "Modules/getpath.o" rule.

Any tips as to what I should be looking at to figure this one out?

--

___
Python tracker 

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



[issue44257] typo and verbous grammar in the grammar spec

2021-11-03 Thread wim glenn


Change by wim glenn :


--
nosy: +wim.glenn
nosy_count: 2.0 -> 3.0
pull_requests: +27651
pull_request: https://github.com/python/cpython/pull/29393

___
Python tracker 

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



[issue41105] Add some extra content check in configure process for some empty header file who has been deprecated by glibc

2021-11-03 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Rather of using AC_COMPILE_IFELSE() in configure.ac, would not be easier to use 
#ifdef in the C file?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue45700] Got SEGV in compilation python3.6 with GCC-11, and please renewal python3.6.

2021-11-03 Thread Ned Deily


Ned Deily  added the comment:

As you note, Python 3.6 is almost at end-of-life, in fewer than two months from 
now. And, in any case, it is in the security-fix-only phase of its life cycle 
so changes just to support OS platform or build tool updates are out-of-scope 
in general, not to mention anything that might cause an ABI or API change. 
Thanks for the suggestion and documenting workarounds, though!

--
nosy: +ned.deily
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



[issue41105] Add some extra content check in configure process for some empty header file who has been deprecated by glibc

2021-11-03 Thread Christian Heimes


Christian Heimes  added the comment:

The configure script is auto-generated from configure.ac. Any chance must be 
applied to configure.ac.

We could replace the AC_CHECK_HEADERS() for stropt.h with a more elaborate 
AC_COMPILE_IFELSE() block that checks for presence of I_PUSH.

Could you please report the issue to your Linux vendor, too? The empty file 
seems to break Open Group Unix 98 standard.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue45704] string.Formatter.parse does not handle auto-numbered positional fields

2021-11-03 Thread Sascha Desch


Sascha Desch  added the comment:

Another thing that occurred to me is the question of what `.parse()` should do 
when a mix of auto-numbered and manually numbered fields is supplied e.g. 
`{}{1}`. As of now `.parse()` happily processes such inputs and some other 
piece of code deals with this and ultimately raises an exception that mixing 
manual with automatic numbering is not allowed. If `.parse()` supported 
automatic numbering it would have to be aware of this too I guess?

--

___
Python tracker 

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



[issue41105] Add some extra content check in configure process for some empty header file who has been deprecated by glibc

2021-11-03 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

I think adding this code in the `configure` script may fix it:

as_ac_Header=`$as_echo "ac_cv_header_stropts.h" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "stropts.h" "$as_ac_Header" 
"$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes" && [ -s stropts.h ]; then :
  cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_stropts.h" | $as_tr_cpp` 1
_ACEOF
fi

here: 
https://github.com/akulakov/cpython/blob/8f24b7dbcbd83311dad510863d8cb41f0e91b464/configure#L8144

.. but I wasn't able to test it. I have a MacOS system and for me even with a 
non-empty stropts.h, configure does not pick it up.

--
nosy: +andrei.avk

___
Python tracker 

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



[issue45404] Undefined I_* macros of stropts.h when building Python 3.10 on Ubuntu: fail to build the fcntl module

2021-11-03 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Duplicate of #41105 , where two more people ran into this issue.

--
nosy: +andrei.avk

___
Python tracker 

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



[issue45697] PyType_IsSubtype is doing excessive work in the common case

2021-11-03 Thread Itamar Ostricher


Itamar Ostricher  added the comment:

thanks for the feedback & discussion, I submitted a new PR

--

___
Python tracker 

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



[issue45506] Out of source tree builds failing on main - test_importlib others unreliable

2021-11-03 Thread Eric Snow


Eric Snow  added the comment:


New changeset 7b438282d39e742b2628a32e7c6699a140ff4cfb by Eric Snow in branch 
'main':
bpo-45506: Stop skipping test_embed. (gh-29300)
https://github.com/python/cpython/commit/7b438282d39e742b2628a32e7c6699a140ff4cfb


--

___
Python tracker 

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



[issue45697] PyType_IsSubtype is doing excessive work in the common case

2021-11-03 Thread Itamar Ostricher


Change by Itamar Ostricher :


--
pull_requests: +27650
pull_request: https://github.com/python/cpython/pull/29392

___
Python tracker 

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



[issue45578] Missing tests for the dis module

2021-11-03 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 8198617bcce885c280ba5f8acd066c71b311b1ac by Łukasz Langa in 
branch '3.9':
[3.9] bpo-45578: add tests for `dis.distb` (GH-29332) (#29386)
https://github.com/python/cpython/commit/8198617bcce885c280ba5f8acd066c71b311b1ac


--

___
Python tracker 

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



[issue45678] `functools.singledispatchmethod` is missing tests

2021-11-03 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset f1918385cccf3ef51d339dfa1f3654005508f307 by Miss Islington (bot) 
in branch '3.10':
bpo-45678: Add ``functools.singledispatchmethod`` tests (GH-29328) (GH-29390)
https://github.com/python/cpython/commit/f1918385cccf3ef51d339dfa1f3654005508f307


--

___
Python tracker 

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



[issue45672] Mutation tests results of typing.py

2021-11-03 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

What is the problem actually?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue45691] Partial moving of core objects to interpreter state is incorrect at best, unsafe at worse.

2021-11-03 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset acc89db9233abf4d903af9a7595a2ed7478fe7d3 by Mark Shannon in 
branch 'main':
bpo-45691: Make array of small ints static to fix use-after-free error. 
(GH-29366)
https://github.com/python/cpython/commit/acc89db9233abf4d903af9a7595a2ed7478fe7d3


--

___
Python tracker 

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



[issue45704] string.Formatter.parse does not handle auto-numbered positional fields

2021-11-03 Thread Eric V. Smith


Eric V. Smith  added the comment:

> Side note: It's a somewhat weird that `.get_field` expects a string while 
> `.get_value` expects an int for positional arguments.

.parse is just concerned with parsing, so it works on and returns strings. 
.get_field takes strings because it is the thing that's trying to determine 
whether or not a field name looks like an integer or not. At least that's how I 
remember it.

--

___
Python tracker 

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



[issue45678] `functools.singledispatchmethod` is missing tests

2021-11-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27649
pull_request: https://github.com/python/cpython/pull/29391

___
Python tracker 

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



[issue45678] `functools.singledispatchmethod` is missing tests

2021-11-03 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +27648
pull_request: https://github.com/python/cpython/pull/29390

___
Python tracker 

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



[issue45678] `functools.singledispatchmethod` is missing tests

2021-11-03 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 5a14929a6e4fab672e2f83a86773618e973b22a6 by Alex Waygood in 
branch 'main':
bpo-45678: Add ``functools.singledispatchmethod`` tests (GH-29328)
https://github.com/python/cpython/commit/5a14929a6e4fab672e2f83a86773618e973b22a6


--

___
Python tracker 

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



[issue45578] Missing tests for the dis module

2021-11-03 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset fd6b70d6b715c2403a194a2b3eae3210e2e81742 by Łukasz Langa in 
branch '3.10':
[3.10] bpo-45578: add tests for `dis.distb` (GH-29332) (GH-29385)
https://github.com/python/cpython/commit/fd6b70d6b715c2403a194a2b3eae3210e2e81742


--

___
Python tracker 

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



[issue45704] string.Formatter.parse does not handle auto-numbered positional fields

2021-11-03 Thread Sascha Desch


Sascha Desch  added the comment:

Yes it should return a string containing the index of the positional argument 
i.e. `"0"` so that it is compatible with `.get_field()`. Side note: It's a 
somewhat weird that `.get_field` expects a string while `.get_value` expects an 
int for positional arguments.

--

___
Python tracker 

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



[issue45702] Python/dtoa.c requires 53 bit hardware rounding unavalable on x64

2021-11-03 Thread Oleg Iarygin


Oleg Iarygin  added the comment:

When I first saw "default rounding precision of 64 bits", I've thought it's 
about "64 bit precision", aka binary64, aka double. So I suggested that the 
code expects some hardly known Intel FPU-specific binary56 instead. Now, after 
a second paragraph of your reply I see that in reality it's about significand 
precision (so rounding precision of 64 bits is for binary80, and 53 is for 
binary64).

> at 53-bit precision (not 56-bit)

You're right. That was a typo.

Thank you for clarification, I'm closing the issue as not-a-bug.

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



[issue45578] Missing tests for the dis module

2021-11-03 Thread Nikita Sobolev


Nikita Sobolev  added the comment:

Only `findlabels` tests are left!

--

___
Python tracker 

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



[issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved

2021-11-03 Thread Alex Waygood


Change by Alex Waygood :


--
pull_requests: +27647
pull_request: https://github.com/python/cpython/pull/29389

___
Python tracker 

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



[issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved

2021-11-03 Thread Alex Waygood


Change by Alex Waygood :


--
pull_requests: +27646
pull_request: https://github.com/python/cpython/pull/29388

___
Python tracker 

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



[issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved

2021-11-03 Thread Alex Waygood


Change by Alex Waygood :


--
pull_requests: +27645
pull_request: https://github.com/python/cpython/pull/29387

___
Python tracker 

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



[issue45702] Python/dtoa.c requires 53 bit hardware rounding unavalable on x64

2021-11-03 Thread Mark Dickinson


Mark Dickinson  added the comment:

I'm not sure I understand the problem that you're reporting - what issues are 
you seeing in practice?

x64 should be fine here. In normal circumstances, the compiled version of 
dtoa.c will be using SSE2 instructions and will already be doing floating-point 
arithmetic at 53-bit precision (not 56-bit), following IEEE 754. It's mainly 
the ancient x86/x87 hardware that's problematic. This code has been working 
well on many different x64 platforms for around a decade now.

Can you describe the issue that you're seeing in more detail?

--

___
Python tracker 

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



[issue45680] Documentation on `GenericAlias` objects and `__class_getitem__` could be improved

2021-11-03 Thread Alex Waygood


Change by Alex Waygood :


--
title: Documentation on `GenericAlias` objects could be improved -> 
Documentation on `GenericAlias` objects and `__class_getitem__` could be 
improved

___
Python tracker 

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



[issue45703] importlib.invalidate_caches() does not invalidate _NamespacePath's _last_parent_path-based cache

2021-11-03 Thread Miro Hrončok

Change by Miro Hrončok :


--
components: +Library (Lib)

___
Python tracker 

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



[issue45703] importlib.invalidate_caches() does not invalidate _NamespacePath's _last_parent_path-based cache

2021-11-03 Thread Miro Hrončok

Miro Hrončok  added the comment:

The PR is now ready for review.

--

___
Python tracker 

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



[issue45578] Missing tests for the dis module

2021-11-03 Thread Łukasz Langa

Change by Łukasz Langa :


--
pull_requests: +27644
pull_request: https://github.com/python/cpython/pull/29386

___
Python tracker 

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



[issue45578] Missing tests for the dis module

2021-11-03 Thread Łukasz Langa

Change by Łukasz Langa :


--
pull_requests: +27643
pull_request: https://github.com/python/cpython/pull/29385

___
Python tracker 

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



[issue45704] string.Formatter.parse does not handle auto-numbered positional fields

2021-11-03 Thread Eric V. Smith


Eric V. Smith  added the comment:

For reference, the documentation is at 
https://docs.python.org/3/library/string.html#custom-string-formatting

I guess in your example it should return:
[('hello ', '0', '', None)]

--
nosy: +eric.smith

___
Python tracker 

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



[issue45578] Missing tests for the dis module

2021-11-03 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset e346f196819aeb02a8a94205ce3e1536c4c2f105 by Nikita Sobolev in 
branch 'main':
bpo-45578: add tests for `dis.distb` (GH-29332)
https://github.com/python/cpython/commit/e346f196819aeb02a8a94205ce3e1536c4c2f105


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue45698] Error on importing getopt

2021-11-03 Thread Mgs M Rizqi Fadhlurrahman


Mgs M Rizqi Fadhlurrahman  added the comment:

OK, thank you for the answers. Sorry for the false alarm.

--

___
Python tracker 

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



[issue45698] Error on importing getopt

2021-11-03 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'm going to close this, since I don't think it's a bug in python, but rather 
in the user's setup.

--
resolution:  -> works for me
stage:  -> resolved
status: open -> closed
type: crash -> behavior

___
Python tracker 

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



[issue44496] string.Formatter class not allowing {.field}

2021-11-03 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think this is a dupe of issue 27307.

--

___
Python tracker 

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



[issue45698] Error on importing getopt

2021-11-03 Thread Mgs M Rizqi Fadhlurrahman


Mgs M Rizqi Fadhlurrahman  added the comment:

@eric.smith Wow you're right! Somehow the """ got deleted. (screenshot attached)

It can run normally now after I added the """ back.

More details:
I'm using Ubuntu 18.04.2.
I installed python 3.10.0 using pyenv by running: `pyenv install 3.10.0`

--
Added file: https://bugs.python.org/file50423/OnPaste.20211103-202914.png

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



[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-03 Thread Jim Crist-Harif


Jim Crist-Harif  added the comment:

If you decline that a change is needed here, at the very least the current 
behavior of `port=0` should be documented. I'd be happy to push up a fix if so.

--

___
Python tracker 

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



[issue45693] `loop.create_server` with port=0 uses different ports for ipv4 & ipv6

2021-11-03 Thread Jim Crist-Harif


Jim Crist-Harif  added the comment:

> I'm not aware of an OS API call that binds both IPv4 and IPv6 to the same 
> random port.

Sure, but `loop.create_server` is already higher-level than a single OS API 
call. 

By default `create_server` will already bind multiple sockets if `host=""`, 
`host=None`, or if `host` is a list. I'm arguing that the current behavior with 
`port=0` in these situations is unexpected. Other libraries (like tornado) have 
come to the same conclusion, and have implemented logic to handle this that 
seems to work well in practice (though can fail, as you've pointed out).

Is there a use case where the current behavior (binding to multiple random 
ports) is desired?

--

___
Python tracker 

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



[issue45698] Error on importing getopt

2021-11-03 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'm guessing the first line of getopt.py got deleted somehow.

@rizqirizqi23: what do the first 10 lines of 
/home/mgsrizqi/.pyenv/versions/3.10.0/lib/python3.10/getopt.py look like?

How did you install python?

--
nosy: +eric.smith

___
Python tracker 

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



[issue45704] string.Formatter.parse does not handle auto-numbered positional fields

2021-11-03 Thread Sascha Desch


New submission from Sascha Desch :

It appears when adding auto-numbered positional fields in python 3.1 
`Formatter.parse` was not updated to handle them and currently returns an empty 
string as the field name.

```
list(Formatter().parse('hello {}'))  # [('hello ', '', '', None)]
```

This does not align with `Formatter.get_field` which according to the docs: 
"Given field_name as returned by parse() (see above), convert it to an object 
to be formatted."

When supplying an empty string to `.get_field()` you get a KeyError

```
Formatter().get_field("", [1, 2, 3], {}). # raises KeyError
```

--
messages: 405610
nosy: SDesch
priority: normal
severity: normal
status: open
title: string.Formatter.parse does not handle auto-numbered positional fields
type: behavior
versions: Python 3.10, Python 3.11, 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



[issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489)

2021-11-03 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

> Congratulations, and thanks for your work and determination to get this done 
> :)

Thanks, and thank you for helping out, Petr :) Also a big thanks to Dong-hee, 
Berker, Serhiy, Pablo, and Victor for reviews and guidance with this "project".

--

___
Python tracker 

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



[issue45692] IDLE: define word/id chars in one place.

2021-11-03 Thread Alex Waygood


Alex Waygood  added the comment:

The PR that proposes creating a new utility.py file is mine, linked to 
https://bugs.python.org/issue45447. Would it make things easier if I split it 
into two PRs: one adding an empty util.py file, and the other making my 
proposed changes to support syntax highlighting for .pyi files?

--
nosy: +AlexWaygood

___
Python tracker 

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



[issue45703] importlib.invalidate_caches() does not invalidate _NamespacePath's _last_parent_path-based cache

2021-11-03 Thread Miro Hrončok

Change by Miro Hrončok :


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

___
Python tracker 

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



[issue45703] importlib.invalidate_caches() does not invalidate _NamespacePath's _last_parent_path-based cache

2021-11-03 Thread Miro Hrončok

Miro Hrončok  added the comment:

I have a fix in mind, will submit a draft pull request without tests shortly, 
continue with the tests later.

--

___
Python tracker 

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



[issue45703] importlib.invalidate_caches() does not invalidate _NamespacePath's _last_parent_path-based cache

2021-11-03 Thread Miro Hrončok

New submission from Miro Hrončok :

Recently, when debugging a weird problem (see 
https://bugzilla.redhat.com/show_bug.cgi?id=2018551 for details if interested, 
but not important for this issue), I've realized that the _NamespacePath class 
(from importlib/_bootstrap_external.py) has a cache that (in some cases) uses 
tuple(sys.path) as the key. I was expecting importlib.invalidate_caches() to 
invalidate this cache, but it doesn't.


Consider the following directory structure:

.
├── PATH1
│   └── namespace
│   └── sub1
│   └── __init__.py
└── PATH2
└── namespace
└── sub2
└── __init__.py

Here is a helper to create it (on Linux-ish):

$ mkdir -p PATH1/namespace/sub1
$ mkdir -p PATH2/namespace/sub2
$ touch PATH1/namespace/sub1/__init__.py
$ touch PATH2/namespace/sub2/__init__.py


Run Python with PYTHONPATH=PATH1:PATH2 (output slightly formatted for 
readability):


$ PYTHONPATH=PATH1:PATH2 python3.11
>>> import namespace
>>> namespace.__path__
_NamespacePath(['.../namespace_path_cache/PATH1/namespace',
'.../namespace_path_cache/PATH2/namespace'])
>>> import namespace.sub1  # works
>>> import namespace.sub2  # works
>>> exit()

The namespace packages seem to work as expected.


Now move PATH2/namespace out of the way:

$ mv PATH2/namespace PATH2/cant-import-this

Run Python again:


$ PYTHONPATH=PATH1:PATH2 python3.11
>>> import namespace
>>> namespace.__path__
_NamespacePath(['.../namespace_path_cache/PATH1/namespace'])
>>> ...

While this interpreter still runs, move the PATH2/namespace module back in:

$ mv PATH2/cant-import-this PATH2/namespace

>>> ...
>>> namespace.__path__
_NamespacePath(['.../namespace_path_cache/PATH1/namespace'])
>>> import namespace.sub2
Traceback (most recent call last):
  File "", line 1, in 
ModuleNotFoundError: No module named 'namespace.sub2'

>>> import importlib
>>> importlib.invalidate_caches()  # invalidate the cache, not helpful
>>> namespace.__path__
_NamespacePath(['.../namespace_path_cache/PATH1/namespace'])
>>> import namespace.sub2
Traceback (most recent call last):
  File "", line 1, in 
ModuleNotFoundError: No module named 'namespace.sub2'


>>> import sys
>>> sys.path.remove('')  # changing sys.path solves this
>>> namespace.__path__
_NamespacePath(['.../namespace_path_cache/PATH1/namespace'])
>>> import namespace.sub2
>>> namespace.__path__
_NamespacePath(['.../namespace_path_cache/PATH1/namespace',
'.../namespace_path_cache/PATH2/namespace'])



importlib.invalidate_caches() documentation says:

> This function should be called if any modules are created/installed while 
> your program is running to guarantee all finders will notice the new module’s 
> existence.

That makes me think calling importlib.invalidate_caches() should also 
invalidate the cache of _NamespacePaths.

(This also affects older Pythons, but since it is a behavior change, I've only 
marked 3.11).

--
messages: 405606
nosy: hroncok, petr.viktorin
priority: normal
severity: normal
status: open
title: importlib.invalidate_caches() does not invalidate _NamespacePath's 
_last_parent_path-based cache
type: behavior
versions: Python 3.11

___
Python tracker 

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



[issue45698] Error on importing getopt

2021-11-03 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It looks strange. The line containing "function (including the special meanings 
of arguments of the form `-'" is a part of a multiline string literal, so there 
should not be such error. And it is line 4, not line 3 as in your traceback.

--

___
Python tracker 

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



[issue45698] Error on importing getopt

2021-11-03 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

Could you please provide more details regarding the OS, whether you compiled
Python yourself and the env settings you used ?

Thanks,
-- 
Marc-Andre Lemburg
eGenix.com

--
nosy: +lemburg

___
Python tracker 

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



[issue45702] Python/dtoa.c requires 53 bit hardware rounding unavalable on x64

2021-11-03 Thread Oleg Iarygin


New submission from Oleg Iarygin :

File configure.ac:4617 states the following:

> # The short float repr introduced in Python 3.1 requires the
> # correctly-rounded string <-> double conversion functions from
> # Python/dtoa.c, which in turn require that the FPU uses 53-bit
> # rounding; this is a problem on x86, where the x87 FPU has a default
> # rounding precision of 64 bits.  For gcc/x86, we can fix this by
> # using inline assembler to get and set the x87 FPU control word.

However, x64 programs use xmm0-7 SIMD registers instead of a FPU stack, so the 
requirement of hardware 56 bit rounding gets violated. 
_Py_SET_53BIT_PRECISION_* is unable to do anything here because SSE neither 
respects the FPU control word, nor provides its own.

Considering that SSE is supported since Pentium III (1999), we can safely 
enforce its usage for x32 code via compiler flags as well, getting consistent 
behavior across builds. However, it requires revision of the requirement.

We need to decide what to do with dtoa.c that supposedly relies on the 
requirement (providing short floats? It looks like _Py_dg_dtoa just stringifies 
as many digits as specified in ndigits argument. I didn't collect enough 
courage on this stage to analyze 484 uncommented lines (2370-2854) of bit 
manipulation over two-letter variables to find and fix the dependency). By the 
way, the only place that uses _Py_dg_dtoa is Objects/floatobject.c:949 doing it 
with an argument mode=3.

I can resolve the issue, but I need some educated opinion on this 13-years old 
stuff (see git blame for configure.ac:4617) to not break things.

Note: I initially added Mark Dickinson into the notifications as a person who 
created and maintained Python/dtoa.c until 2013.

--
components: Interpreter Core
messages: 405603
nosy: arhadthedev, mark.dickinson
priority: normal
severity: normal
status: open
title: Python/dtoa.c requires 53 bit hardware rounding unavalable on x64
type: behavior
versions: Python 3.10, Python 3.11, 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



[issue45701] Add tuple tests to `functools.lru_cache`

2021-11-03 Thread Nikita Sobolev


Change by Nikita Sobolev :


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

___
Python tracker 

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



[issue45698] Error on importing getopt

2021-11-03 Thread Mgs M Rizqi Fadhlurrahman


Mgs M Rizqi Fadhlurrahman  added the comment:

Here:

```
Python 3.10.0 (default, Oct 30 2021, 15:16:25) [GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import getopt
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/mgsrizqi/.pyenv/versions/3.10.0/lib/python3.10/getopt.py", line 4
function (including the special meanings of arguments of the form `-'
^
SyntaxError: unterminated string literal (detected at line 4)
>>>
```

--

___
Python tracker 

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



[issue45701] Add tuple tests to `functools.lru_cache`

2021-11-03 Thread Nikita Sobolev


New submission from Nikita Sobolev :

Context: https://bugs.python.org/issue45679

We need to add tests that `tuple` works as expected with `functools.lru_cache`, 
including `1` / `1.0` / `True` and `0` / `0.0` / `False` special cases.

PR: https://github.com/python/cpython/pull/29339

--
components: Tests
messages: 405601
nosy: sobolevn
priority: normal
severity: normal
status: open
title: Add tuple tests to `functools.lru_cache`
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue45698] Error on importing getopt

2021-11-03 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Could you please provide an output as a text?

--

___
Python tracker 

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



[issue45698] Error on importing getopt

2021-11-03 Thread Mgs M Rizqi Fadhlurrahman


Mgs M Rizqi Fadhlurrahman  added the comment:

Screenshot attached

https://bugs.python.org/file50422/OnPaste.20211103-125049.png

--

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



[issue45679] typing.Literal[True] is implicitly converted to typing.Literal[1]

2021-11-03 Thread Ken Jin


Ken Jin  added the comment:

Closing this issue as the bug has been solved.

@Nikita could you please open a new issue for your tests PR and link to that 
instead? It seems like an enhancement over the current test suite for 
lru_cache. Thanks!

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



[issue45633] Py_GT listed twice in Doc/extending/newtypes.rst

2021-11-03 Thread Ken Jin


Ken Jin  added the comment:

@Dmitry Smirnov,

Thank you for your fix, and welcome to the CPython project!

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



[issue45697] PyType_IsSubtype is doing excessive work in the common case

2021-11-03 Thread Ken Jin


Ken Jin  added the comment:

> Dennis, you mean something like this? 
> https://github.com/itamaro/cpython/commit/92d46b260cf6ccce1a47003f539294530138e488

Not Dennis, but these changes looks good. As Serhiy mentioned, we can replace 
the hot callsites with PyObject_TypeCheck without slowing down PyType_IsSubtype.

--
nosy: +kj

___
Python tracker 

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



  1   2   >