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

2021-11-02 Thread Itamar Ostricher


Itamar Ostricher  added the comment:

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

sure, that would preempt the `PyType_IsSubtype` calls coming from these 
specific callsites, but the early return in `PyType_IsSubtype` would cover 
those as well as any other path, wouldn't it?

--

___
Python tracker 

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



[issue45598] setup.py grep_headers_for() is broken by design

2021-11-02 Thread Ned Deily


Ned Deily  added the comment:

> Ned, what about USING_APPLE_OS_LIBFFI? Is it still relevant?

It was just added a year ago as part of the support for macOS 11 Big Sur and 
Apple Silicon systems.

--

___
Python tracker 

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



[issue45641] Error In opening a file through tkinter on macOS Monterey

2021-11-02 Thread Ned Deily


Ned Deily  added the comment:

An update: we believe that the problem with the Save dialog window not closing 
has been fixed in a revised updated macOS installer for 3.10.0 which is now 
available as the default download from python.org. See Issue44828 for more 
details.

--

___
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-02 Thread Ned Deily


Ned Deily  added the comment:

OK, thanks to Marc's quick response, it looks like we have conquered the 
elusive zombie dialog window. So let's try again. Note that the download file 
name has changed to avoid any confusion:

As of 2021-11-03, the macOS installer file on python.org for the 3.10.0 release 
has been updated to include an updated Tk library that includes this fix. All 
other files installed by the installer are the same as in the original 3.10.0 
installer, other than the Tk libraries and the installer ReadMe file. This 
updated installer pkg, at 
https://www.python.org/ftp/python/3.10.0/python-3.10.0post2-macos11.pkg, is now 
the default download for macOS from python.org and appears on the 3.10.0 
release page (https://www.python.org/downloads/release/python-3100/). If you 
have already installed the original 3.10.0 universal2 installer pkg from 
python.org and are encountering this problem with file dialog windows on macOS 
12 Monterey, you can download and run the updated installer pkg to obtain the 
updated Tk libraries.

The updated Tk will also be included in the macOS installers provided with the 
next Python releases: 3.9.8 (expected to be released this week) and 3.10.1 
(planned for 2021-12-06), as well as the 3.11.0a2 development preview.

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

___
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-02 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Interesting. It seems like several call sites already check the equality case:

 setobject.h: 
#define PyFrozenSet_Check(ob) \
(Py_IS_TYPE(ob, _Type) || \
  PyType_IsSubtype(Py_TYPE(ob), _Type))

 object.h: 
static inline int _PyObject_TypeCheck(PyObject *ob, PyTypeObject *type) {
return Py_IS_TYPE(ob, type) || PyType_IsSubtype(Py_TYPE(ob), type);
}
#define PyObject_TypeCheck(ob, type) _PyObject_TypeCheck(_PyObject_CAST(ob), 
type)


Perhaps it would be better to use PyObject_TypeCheck where applicable (such as 
in the type_call function you mention, and in abstract.c's binary_op1()).

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows

2021-11-02 Thread swgmma


Change by swgmma :


--
versions: +Python 3.11 -Python 3.8

___
Python tracker 

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



[issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows

2021-11-02 Thread swgmma


swgmma  added the comment:

Anything else left to do?

--

___
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-02 Thread Itamar Ostricher


Change by Itamar Ostricher :


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

___
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-02 Thread Itamar Ostricher


New submission from Itamar Ostricher :

Based on real world profiling data we collected, a vast amount of 
`PyType_IsSubtype` calls are coming from `type_call`, when it decides whether 
`__init__` should run or not.

In the common case, the arguments to this call are identical, but the 
implementation still walks the MRO.

By returning early for identical types, the common case can be optimized with a 
non-trivial performance gain.

--
components: Interpreter Core
messages: 405575
nosy: itamaro
priority: normal
severity: normal
status: open
title: PyType_IsSubtype is doing excessive work in the common case
type: performance
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



[issue45646] Star expression in comprehension wrongly indicates to use or_expression after the star

2021-11-02 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Feel free to use anything I wrote in a PR and make any revisions/edits you want.

--

___
Python tracker 

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



[issue45696] "Deep-freeze": skip the marshal step by generating C code

2021-11-02 Thread Eric Snow


Change by Eric Snow :


--
nosy: +eric.snow

___
Python tracker 

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



[issue45695] Out-of-tree builds are not tested.

2021-11-02 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
assignee:  -> gregory.p.smith

___
Python tracker 

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



[issue45695] Out-of-tree builds are not tested.

2021-11-02 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I always do out of tree builds _(I find people who build anything in tree to be 
very weird - it makes a mess)_.

I intend to look into making sure a Linux buildbot runs this way but don't let 
that stop anyone else from doing so.

--

___
Python tracker 

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



[issue45695] Out-of-tree builds are not tested.

2021-11-02 Thread Steve Dower


Steve Dower  added the comment:

FTR, I used to run all Windows builds out of tree on Azure Pipelines, but too 
many tests broke so I reverted it: 
https://github.com/python/cpython/blob/456e27ac0ac6bc1cfd6da0191bd7802d8667457b/.azure-pipelines/windows-steps.yml#L7-L10

Setting $env:Py_OutDir before building is the easiest way to change it. You can 
also pass "/p:Py_OutDir=" to build.bat, but you'll run into quoting 
issues almost immediately.

--

___
Python tracker 

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



[issue45646] Star expression in comprehension wrongly indicates to use or_expression after the star

2021-11-02 Thread Arthur Milchior


Arthur Milchior  added the comment:

Thank you very much Dennis. For two reasons.

First, because I like a lot what you wrote. I suspect that it would have saved 
me time and make things less confusing. 
That's not certain, because at the time I was reading the documentation of 
or_expr, I may have skipped or forgotten the part about BNF.
A solution - that would require a bigger change - is that the various blocks 
containing rules have a small link back to the text you wrote, so that if a 
reader reads the rule directly, they can find out the meta information they 
need to know about rules.

I guess that it's technically possible to do it with an extra sphinx rule, but 
may not be trivial to do, and it's not clear how such a link and text should 
look like in practice, as it must be noticeable the first time and easy to 
ignore next time.


Thanks also because I'm happy, and slightly relieved, that my concerns are 
taken seriously. I admit that I feared that I would get as answer something 
such as:
> actually, if you knew BNF, it should be clear that the actual meaning of 
> or_expr is 

And the fact that the answer I got tries to actually clarify the documentation 
for people wanting to learn or review Python without being expert in 
programming language theory is really great.

Do you open a PR with your suggested test or do I update mine?

--

___
Python tracker 

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



[issue45696] "Deep-freeze": skip the marshal step by generating C code

2021-11-02 Thread Guido van Rossum


Change by Guido van Rossum :


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

___
Python tracker 

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



[issue45696] "Deep-freeze": skip the marshal step by generating C code

2021-11-02 Thread Guido van Rossum


New submission from Guido van Rossum :

See https://github.com/faster-cpython/ideas/issues/84

This appears to improve startup time by another 10% or more compared to main.

--
assignee: gvanrossum
components: Interpreter Core
messages: 405570
nosy: gvanrossum
priority: normal
severity: normal
status: open
title: "Deep-freeze": skip the marshal step by generating C code
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



[issue24139] Use sqlite3 extended error codes

2021-11-02 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



[issue24139] Use sqlite3 extended error codes

2021-11-02 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 456e27ac0ac6bc1cfd6da0191bd7802d8667457b by Erlend Egeberg 
Aasland in branch 'main':
bpo-24139: Add support for SQLite extended result codes (GH-28076)
https://github.com/python/cpython/commit/456e27ac0ac6bc1cfd6da0191bd7802d8667457b


--
nosy: +pablogsal

___
Python tracker 

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



[issue45695] Out-of-tree builds are not tested.

2021-11-02 Thread Eric Snow


New submission from Eric Snow :

Currently we don't test builds done outside the source tree, neither on GitHub 
nor the buildbots. [1]  As a result, such builds get broken occasionally.  I've 
certainly broken then a couple times, inadvertently.  It would be helpful if we 
tested out-of-tree builds on GitHub, or at least on a stable buildbot.

FTR, to do an out-of-tree build locally and test it:

mkdir ../build
cd ../build
../cpython/configure
make
./python -m test


[1] Actually I recently added 
test.test_tools.test_freeze.TestFreeze.test_freeze_simple_script which happens 
to do an out-of-tree build incidentally.  However, we should be testing 
out-of-tree builds explicitly.

--
components: Build
messages: 405568
nosy: christian.heimes, eric.snow, gregory.p.smith, gvanrossum, steve.dower
priority: normal
severity: normal
stage: test needed
status: open
title: Out-of-tree builds are not tested.
versions: Python 3.10, Python 3.11

___
Python tracker 

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



[issue45406] inspect.getouterframes() tracebacks when $CWD does not exists

2021-11-02 Thread Irit Katriel


Irit Katriel  added the comment:

Thanks Lukasz.

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



[issue45243] [sqlite3] add support for changing connection limits

2021-11-02 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Steve, do you think it is worth it adding an audit hook for setting connection 
limits?

Most of the limits are harmless, but limits that control recursion are more 
interesting.

SQLITE_LIMIT_EXPR_DEPTH:

Maximum Depth Of An Expression Tree

SQLite parses expressions into a tree for processing. During code
generation, SQLite walks this tree recursively. The depth of expression
trees is therefore limited in order to avoid using too much stack space.
[...] If the value is 0, then no limit is enforced.

SQLITE_LIMIT_TRIGGER_DEPTH:

Maximum Depth Of Trigger Recursion

SQLite limits the depth of recursion of triggers in order to prevent a
statement involving recursive triggers from using an unbounded amount of
memory.

Note also, how the SQLite docs talk about SQLITE_LIMIT_LENGTH:

Maximum length of a string or BLOB

[...] In security-sensitive applications it is best not to try to increase
the maximum string and blob length. In fact, you might do well to lower
the maximum string and blob length to something more in the range of a few
million if that is possible.

--
nosy: +steve.dower

___
Python tracker 

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



[issue45406] inspect.getouterframes() tracebacks when $CWD does not exists

2021-11-02 Thread miss-islington


miss-islington  added the comment:


New changeset cfdd7d26a72e7ae523039e40c11001c2d7ef36ba by Miss Islington (bot) 
in branch '3.10':
bpo-45406: make inspect.getmodule() return None when getabsfile() raises 
FileNotFoundError (GH-28824)
https://github.com/python/cpython/commit/cfdd7d26a72e7ae523039e40c11001c2d7ef36ba


--

___
Python tracker 

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



[issue45673] argparse error with option with optional value

2021-11-02 Thread paul j3


paul j3  added the comment:

Put the required positional first

$ myapp myfile -s

or one of the store_true arguments

$ myapp -s -j myfile

I think

$ myapp -s -- myfile

will work as well, but that needs to be tested.  

The '-s' has to be followed by something won't be confused for an argument, 
such as nothing, or a flag.

--

___
Python tracker 

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



[issue45406] inspect.getouterframes() tracebacks when $CWD does not exists

2021-11-02 Thread miss-islington


miss-islington  added the comment:


New changeset 5f527caf15c52acc3f6e865721cdf781209f11ca by Miss Islington (bot) 
in branch '3.9':
bpo-45406: make inspect.getmodule() return None when getabsfile() raises 
FileNotFoundError (GH-28824)
https://github.com/python/cpython/commit/5f527caf15c52acc3f6e865721cdf781209f11ca


--

___
Python tracker 

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



[issue45673] argparse error with option with optional value

2021-11-02 Thread Paolo Benvenuto


Paolo Benvenuto  added the comment:

> As a general rule, don't use `nargs` like this where there's ambiguity as to 
> how many values will be allocated to the argument.

What could I use instead of nargs?

--

___
Python tracker 

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



[issue45673] argparse error with option with optional value

2021-11-02 Thread paul j3


paul j3  added the comment:

https://bugs.python.org/issue9338
argparse optionals with nargs='?', '*' or '+' can't be followed by positionals

As you can see this is an old issue, but still too big for a quick fix.

As a general rule, don't use `nargs` like this where there's ambiguity as to 
how many values will be allocated to the argument.

--

___
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-02 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
nosy: +erlendaasland

___
Python tracker 

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



[issue45406] inspect.getouterframes() tracebacks when $CWD does not exists

2021-11-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27636
pull_request: https://github.com/python/cpython/pull/29378

___
Python tracker 

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



[issue45406] inspect.getouterframes() tracebacks when $CWD does not exists

2021-11-02 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue45406] inspect.getouterframes() tracebacks when $CWD does not exists

2021-11-02 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset a459a81530de700b3d3faeb827b22ed1c9985812 by Irit Katriel in 
branch 'main':
bpo-45406: make inspect.getmodule() return None when getabsfile() raises 
FileNotFoundError (GH-28824)
https://github.com/python/cpython/commit/a459a81530de700b3d3faeb827b22ed1c9985812


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue45457] Documentation for ssl.load_default_certs is outdated

2021-11-02 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks, Lincoln! ✨  ✨

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



[issue22449] SSLContext.load_verify_locations behavior on Windows and OSX

2021-11-02 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 4ab6e524abd2d7f21c2d7a6eaee5be1f93baf140 by Miss Islington (bot) 
in branch '3.9':
bpo-45457: Minor fix to documentation for SSLContext.load_default_certs. 
(GH-28947) (GH-29374)
https://github.com/python/cpython/commit/4ab6e524abd2d7f21c2d7a6eaee5be1f93baf140


--

___
Python tracker 

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



[issue45457] Documentation for ssl.load_default_certs is outdated

2021-11-02 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 4ab6e524abd2d7f21c2d7a6eaee5be1f93baf140 by Miss Islington (bot) 
in branch '3.9':
bpo-45457: Minor fix to documentation for SSLContext.load_default_certs. 
(GH-28947) (GH-29374)
https://github.com/python/cpython/commit/4ab6e524abd2d7f21c2d7a6eaee5be1f93baf140


--

___
Python tracker 

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



[issue45457] Documentation for ssl.load_default_certs is outdated

2021-11-02 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 71f602b54c9c5346d22a542e186746b06cccfc8e by Miss Islington (bot) 
in branch '3.10':
bpo-45457: Minor fix to documentation for SSLContext.load_default_certs. 
(GH-28947) (GH-29373)
https://github.com/python/cpython/commit/71f602b54c9c5346d22a542e186746b06cccfc8e


--

___
Python tracker 

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



[issue22449] SSLContext.load_verify_locations behavior on Windows and OSX

2021-11-02 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 71f602b54c9c5346d22a542e186746b06cccfc8e by Miss Islington (bot) 
in branch '3.10':
bpo-45457: Minor fix to documentation for SSLContext.load_default_certs. 
(GH-28947) (GH-29373)
https://github.com/python/cpython/commit/71f602b54c9c5346d22a542e186746b06cccfc8e


--

___
Python tracker 

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



[issue45457] Documentation for ssl.load_default_certs is outdated

2021-11-02 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 3551bf16ee5c25b6349209dd30e032f0f3b9ace3 by LincolnPuzey in 
branch 'main':
bpo-45457: Minor fix to documentation for SSLContext.load_default_certs. 
(GH-28947)
https://github.com/python/cpython/commit/3551bf16ee5c25b6349209dd30e032f0f3b9ace3


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue22449] SSLContext.load_verify_locations behavior on Windows and OSX

2021-11-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27634
pull_request: https://github.com/python/cpython/pull/29374

___
Python tracker 

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



[issue45457] Documentation for ssl.load_default_certs is outdated

2021-11-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27633
pull_request: https://github.com/python/cpython/pull/29374

___
Python tracker 

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



[issue45457] Documentation for ssl.load_default_certs is outdated

2021-11-02 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue22449] SSLContext.load_verify_locations behavior on Windows and OSX

2021-11-02 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 3551bf16ee5c25b6349209dd30e032f0f3b9ace3 by LincolnPuzey in 
branch 'main':
bpo-45457: Minor fix to documentation for SSLContext.load_default_certs. 
(GH-28947)
https://github.com/python/cpython/commit/3551bf16ee5c25b6349209dd30e032f0f3b9ace3


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue22449] SSLContext.load_verify_locations behavior on Windows and OSX

2021-11-02 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 11.0 -> 12.0
pull_requests: +27632
pull_request: https://github.com/python/cpython/pull/29373

___
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-02 Thread Ned Deily


Ned Deily  added the comment:


New changeset d53d9e7f4f1656a13b030b17baca743455e511fd by Ned Deily in branch 
'3.9':
bpo-44828: Avoid leaving a zombie Save panel. (GH-29371)
https://github.com/python/cpython/commit/d53d9e7f4f1656a13b030b17baca743455e511fd


--

___
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-02 Thread Fahim Faisal


Change by Fahim Faisal :


--
nosy:  -i3p9

___
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-02 Thread Ned Deily


Ned Deily  added the comment:


New changeset 6681a77c52df41636feb213d63ba27a759c7e5f4 by Ned Deily in branch 
'3.10':
bpo-44828: Avoid leaving a zombie Save panel. (GH-29369)
https://github.com/python/cpython/commit/6681a77c52df41636feb213d63ba27a759c7e5f4


--

___
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-02 Thread Marc Culler


Marc Culler  added the comment:

A (hypothetical) explanation: I think that each NSWindow maintains a queue of 
attached sheets.  Failing to call the [parent endSheet] method left the file 
dialogue NSPanel in the queue, although it had been ordered offscreen and so 
was not visible. Opening the NSAlert added it to the top of the queue.  Closing 
the alert caused it to be removed from the queue. But, since the queue was not 
empty, the window manager was supposed to orderFront the next sheet in the 
queue. That sheet was the file dialog, which had not been destroyed since 
adding it to the queue had incremented its reference count, and failing to 
remove it had not decremented its reference count.  But the separate process 
that handles events for the file dialog had exited long ago.  So that made the 
newly re-opened file dialog NSPanel into a zombie.

--

___
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-02 Thread Ned Deily


Ned Deily  added the comment:


New changeset 4a8b4051734fd2ce46e15e6369811132ac3a5697 by Ned Deily in branch 
'main':
bpo-44828: macOS installer: avoid leaving a zombie Save panel in Tk 8.6.12rc1 
(GH-29367)
https://github.com/python/cpython/commit/4a8b4051734fd2ce46e15e6369811132ac3a5697


--

___
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-02 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

hyperparser.py, line 13, _ASCII_ID_CHARS
line 15, _ASCII_ID_FIRST_CHARS, frozenset(string.ascii_letters + "_")

Only used on line 18 and 21 to create 128 item lookup tables.  The point is to 
be fast as hyperparser scans multiple chars when invoked.  The expandword fix 
and c.isidentifier() could replace the lookup.  But would they bog down 
response time?  We need to look at hyperparser use cases and do some testing.

--

___
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-02 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +27630
pull_request: https://github.com/python/cpython/pull/29367

___
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-02 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +27629
pull_request: https://github.com/python/cpython/pull/29372

___
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-02 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +27628
pull_request: https://github.com/python/cpython/pull/29371

___
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-02 Thread Ned Deily


Change by Ned Deily :


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

___
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-02 Thread Jim Crist-Harif


Jim Crist-Harif  added the comment:

Hmmm, I'd find that situation a bit surprising, but I suppose it could happen. 
Looks like tornado just errors, and that seems to work fine for them in 
practice 
(https://github.com/tornadoweb/tornado/blob/790715ae0f0a30b9ee830bfee75bb7fa4c4ec2f6/tornado/netutil.py#L153-L182).
 Binding IPv4 first might help reduce the chance of a collision, since I 
suspect there are more IPv4-only applications than IPv6-only.

--

___
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-02 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

editor.py, line 809, IDENTCHARS

Used in the immediately following def colorize_syntax_error on line 814.
if char and char in self.IDENTCHARS:
text.tag_add("ERROR", pos + " wordstart", pos)
I believe the intent is to color the part of an identifier that precedes the 
character marked.  At the moment, I cannot think of how to trigger such a 
situation.  I would have to add some console prints to investigate.  Maybe this 
should get the autoexpand fix, but maybe it is dead code.

--

___
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-02 Thread Eric V. Smith


Eric V. Smith  added the comment:

What do you do if a port is bound for IPv4, but is in use for IPv6?

--

___
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-02 Thread Jim Crist-Harif


Jim Crist-Harif  added the comment:

> Is there an OS interface to ensure the same port on both stacks?

I don't think this is needed? Right now the code processes as:

- Expand host + port + family + flags into a list of one or more tuples of 
socket options 
(https://github.com/python/cpython/blob/401272e6e660445d6556d5cd4db88ed4267a50b3/Lib/asyncio/base_events.py#L1432-L1436)
- Iterate through this list, creating a new socket for each option tuple, and 
bind to the corresponding host + port 
(https://github.com/python/cpython/blob/401272e6e660445d6556d5cd4db88ed4267a50b3/Lib/asyncio/base_events.py#L1441-L1464)

In this case, each call to `socket.bind` gets a 0 port, thus binding to a new 
random open port number each time.

What I'm asking for is that if the user passes in `port=0`, then the port is 
extracted in the first call to `socket.bind` when looping and used for all 
subsequent `socket.bind` calls in the loop. This way we only ever choose a 
single random open port rather than 1 for each interface. FWIW, this is also 
what tornado does when `port=0` is provided.

--

___
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-02 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

undo.py, line 254, alphanumeric

Used in immediately following lines to classify chars as 'alphanumeric', 
'newline', or 'punctuation' (the default).  I believe I have only ever looked 
at this module to add the test code at the bottom.  In any case, I don't know 
the effect of calling non-ascii chars punctuation, but suspect it is not the 
best thing.  So I suspect that the autoexpand fix would be the best.

The classify method is only used on line 248 in the merge method above.
  self.classify(self.chars[-1]) != self.classify(cmd.chars)
merge() is only used on l.124 in addcmd.  

To figure out more, I would experiment identifiers without and with non-ascii 
and undo and redo and see what difference there is.

--

___
Python tracker 

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



[issue45656] argparse bug: prefix_chars argument to add_argument_group doesn't really work

2021-11-02 Thread paul j3


paul j3  added the comment:

prefix_chars is a parameter of the parent _ActionsContainer

class _ActionsContainer(object):

def __init__(self,
 description,
 prefix_chars,
 argument_default,
 conflict_handler):
super(_ActionsContainer, self).__init__()

self.description = description
self.argument_default = argument_default
self.prefix_chars = prefix_chars
self.conflict_handler = conflict_handler

add_argument is also a method in this class.  It uses its own prefix_chars to 
categorize arguments as optional/positional

chars = self.prefix_chars
if not args or len(args) == 1 and args[0][0] not in chars: 

see also _get_optional_kwargs method.

class _ArgumentGroup(_ActionsContainer):

inherits from _ActionsContainer, and usually gets the prefix_chars from its 
container (the parser)

update('prefix_chars', container.prefix_chars)

The parser is created with

class ArgumentParser(_AttributeHolder, _ActionsContainer):

and documents the use of prefix_chars.

In addition to passing prefix_chars to its Super, it uses

default_prefix = '-' if '-' in prefix_chars else prefix_chars[0]

to define the -h help argument.

Early in parsing, args strings are categorized as 'O' or 'A'.  That is done in, 
which uses:

def _parse_optional(self, arg_string):

# if it doesn't start with a prefix, it was meant to be positional
if not arg_string[0] in self.prefix_chars:
return None

def _get_option_tuples(self, option_string):

also uses the parser's own prefix_chars.

During parsing (several layers down)

def consume_optional(start_index):

# if the action is a single-dash option and takes no
# arguments, try to parse more single-dash options out
# of the tail of the option string
chars = self.prefix_chars
if arg_count == 0 and option_string[1] not in chars:

Here, the parser's own prefix_chars is used to handle the chained short-dash 
options.


---

In sum, while Argument_Group can have its own prefix_chars, that is only used 
for help formatting.  It's the parser's prefix_chars that is used when parsing. 
 The group's chars is ignored.

The _ArgumentGroup__init__  suggests something more than simple inheritance may 
have been intended for prefix_chars, but in practice all it affects is the 
help.  

I haven't seen this issue raised before, and since this group parameter is  not 
documented, I think it's safe to ignore it.  

An alternative is to have add_argument_group (or _ArgumentGroup__init__) 
explicitly reject the prefix_chars parameter.

--

___
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-02 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

autocomplete.py, line 33, ID_CHARS is only used on line 137 to find the prefix 
of an identifier when completions have been explicitly requested.

while i and (curline[i-1] in ID_CHARS or ord(curline[i-1]) > 127):
i -= 1
comp_start = curline[i:j]

The completion is for a name or attribute depending on whether the preceding 
char, if any, is '.'.  Here, the unicode fix was to accept all non-ascii as 
possible id chars.  There is no harm as the completion box only has valid 
completions, and if the prefix given does not match anything, nothing is 
highlighted.

ID_CHARS could be moved to utils if the same ascii string is used in another 
module.

--

___
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-02 Thread Eric V. Smith


Eric V. Smith  added the comment:

Is there an OS interface to ensure the same port on both stacks? I don't know 
of one (although of course one might exist), in which case I don't know how 
you'd ensure they're both the same.

--
nosy: +eric.smith

___
Python tracker 

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



[issue45589] webbrowser does not handle opens under Windows WSL properly

2021-11-02 Thread Guido F

Guido F  added the comment:

Understood, my mistake.

I wonder if explorer.exe or any other general purpose open command is
guaranteed to be available in all WSL distros. There’s also a consideration
to be made on WSL1 vs WSL2 (only v2 ships an actual Linux kernel).

For detection, there’re some other projects that have done this for some
time. Not sure they’re up to python-core standards, but I put an example
for the fish shell in my original description.

Might be worth looking into.

On Tue, Nov 2, 2021 at 3:28 PM Steve Dower  wrote:

>
> Steve Dower  added the comment:
>
> FWIW, I don't have wslview in the Debian distro I'm currently using. It
> does have wslpath though.
>
> Consistent detection and integration throughout CPython's standard
> library (unless we believe we need special build options too) is
> probably worth a python-dev discussion.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
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-02 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

autoexpand.py, line 20, wordchars

'wordchars' is correct here since words beginning with digits can be expanded.

>>> s = '0x4f334'
>>> 0x4f334  # Hit alt-/ after 0 and enter
324404

Used in line 89 in method getprevword

while i > 0 and line[i-1] in self.wordchars:
i = i-1

Proposed replacement seems to work.

>>> i = len(s)
... while i > 0 and (c := s[i-1] or c == '_'):
... i -= 1
... 
>>> i,c
(0, '0')

--

___
Python tracker 

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



[issue45589] webbrowser does not handle opens under Windows WSL properly

2021-11-02 Thread Steve Dower


Steve Dower  added the comment:

FWIW, I don't have wslview in the Debian distro I'm currently using. It 
does have wslpath though.

Consistent detection and integration throughout CPython's standard 
library (unless we believe we need special build options too) is 
probably worth a python-dev discussion.

--

___
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-02 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

There have been occasional discussions about IDLE not being properly unicode 
aware in some of its functions.  Discussions have foundered on these facts and 
no fix made.  

1. The direct replacement string, your 'identcontchars', seems too big. We have 
always assumed that O(n) linear scans would be too slow.
2. A frozen set should give O(1) lookup, like fast enough, but would be even 
bigger.
3. The string methods operate on and scan through multiple chars, whereas IDLE 
wants to test 1 char at a time.
4. Even if the O(n*n) behavior of multiple calls is acceptible, there is no 
function for unicode continuation chars.  s.idchars requires that the first 
character be a start char, which is to say, not a digit.  s.alnum is false for 
'_'.  (Otherwise, it would work.)

I would like to better this time.  Possible responses to the blockers:

1. Correct; reject.

2. Maybe adding an elephant is better than keeping multiple IDLE features 
disabled for non-ascii users.  How big?

>>> import sys
>>> fz = frozenset(c for c in map(chr, range(0x11)) if ('a'+c).isidentifier)
>>> sys.getsizeof(fz)
33554648

Whoops, each 2 or 4 byte slice of the underlying array becomes 76 bytes + 8 
bytes * size of hash array.  Not practical either.

3. For at least some of the uses, the repeated calls may be fast enough.

4. We can synthesize s.isidcontinue with "c.isalnum() or c == '_'".   
"c.isidentifier() or c.isdigit()" would also work but should be slower.

Any other ideas?  I will look at the use cases next.

--

___
Python tracker 

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



[issue45589] webbrowser does not handle opens under Windows WSL properly

2021-11-02 Thread Guido F

Guido F  added the comment:

My code patch uses ‘wslview’, which is a binary that is injected into every
WSL distro and forwards file open commands to windows.

I detect WSL inspecting the kernel version, which includes WSL tagging.

On Tue, Nov 2, 2021 at 3:05 PM Steve Dower  wrote:

>
> Steve Dower  added the comment:
>
> We don't formally support it yet. We probably need somebody to develop
> expertise in the emulation layer so that they can work with the Linux
> distro experts to make sure their distros are doing things properly.
>
> It has no relation at all to our Windows support (right now) - all
> versions of Python running in WSL 100% believe they are running on
> whichever Linux distro the user is running.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue45589] webbrowser does not handle opens under Windows WSL properly

2021-11-02 Thread Steve Dower


Steve Dower  added the comment:

We don't formally support it yet. We probably need somebody to develop 
expertise in the emulation layer so that they can work with the Linux distro 
experts to make sure their distros are doing things properly.

It has no relation at all to our Windows support (right now) - all versions of 
Python running in WSL 100% believe they are running on whichever Linux distro 
the user is running.

--

___
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-02 Thread Irit Katriel


New submission from Irit Katriel :

There is currently a limit on the number of frames in each traceback, but not 
on the number of chained exceptions displayed. This is why traceback.py avoids 
recursion (making the code more complex). A limit should probably be added.

--
components: Interpreter Core, Library (Lib)
messages: 405533
nosy: iritkatriel
priority: normal
severity: normal
status: open
title: Limit the number of chained exceptions included in formatted traceback
type: enhancement
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



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

2021-11-02 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I checked for other possible ascii only problems and only found

config_key.py: 14: ALPHANUM_KEYS = tuple(string.ascii_lowercase + string.digits)
config_key.py: 39: if 'Shift' in modifiers and key in 
string.ascii_lowercase:
config_key.py: 15: PUNCTUATION_KEYS = tuple('~!@#%^&*()_-+={}[]|;:,.<>/?')
config_key.py: 20: AVAILABLE_KEYS = (ALPHANUM_KEYS + PUNCTUATION_KEYS + 
FUNCTION_KEYS +

--

___
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-02 Thread Jim Crist-Harif


Change by Jim Crist-Harif :


--
versions: +Python 3.10, Python 3.8

___
Python tracker 

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



[issue45690] Argparse exclusive group inside required exclusive group displays incorrectly

2021-11-02 Thread paul j3


paul j3  added the comment:

https://bugs.python.org/issue29553
Argparser does not display closing parentheses in nested mutex groups

supposedly fixed the parentheses for nested groups.  You can read its 
discussion and patches to see why it does not handle your case.

I don't see any examples have required groups.  [] is used for un-required, () 
for required.  This patch did not change how the usage was generated.  It just 
refined how excess [()] were removed.

Proper handling of groups requires a major rewrite of the usage formatter.

--

___
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-02 Thread Jim Crist-Harif


New submission from Jim Crist-Harif :

To create a new server with `loop.create_server` that listens on all interfaces 
and a random port, I'd expect passing in `host=""`, `port=0` to work (per the 
documentation). However, as written this results in 2 different ports being 
used - one for ipv4 and one for ipv6. Instead I'd expect a single random port 
be determined once, and reused for all other interfaces.

Running the example test code (attached) results in:

```
$ python test.py
listening on 0.0.0.0:38023
listening on :::40899
Traceback (most recent call last):
  File "/home/jcristharif/Code/distributed/test.py", line 36, in 
asyncio.run(main())
  File 
"/home/jcristharif/miniconda3/envs/dask/lib/python3.9/asyncio/runners.py", line 
44, in run
return loop.run_until_complete(main)
  File 
"/home/jcristharif/miniconda3/envs/dask/lib/python3.9/asyncio/base_events.py", 
line 642, in run_until_complete
return future.result()
  File "/home/jcristharif/Code/distributed/test.py", line 30, in main
assert len(ports) == 1, "Only 1 port expected!"
AssertionError: Only 1 port expected!
```

This behavior can be worked around by manually handling `port=0` outside of 
asyncio, but as it stands naive use can result in accidentally listening on 
multiple ports.

--
components: asyncio
files: test.py
messages: 405530
nosy: asvetlov, jcristharif, yselivanov
priority: normal
severity: normal
status: open
title: `loop.create_server` with port=0 uses different ports for ipv4 & ipv6
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file50421/test.py

___
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-02 Thread Marc Culler


Marc Culler  added the comment:

OK.  Shift-Command-S works.  I will attach the fossil diff which
should have enough context to indicate where to add the one new line.
Then I will merge this change into the 8.6.12 release candidate

--
Added file: https://bugs.python.org/file50420/endsheet.patch

___
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-02 Thread Ned Deily


Ned Deily  added the comment:

> When you press Command-S on a non-new edit window you do see the flash
of the Save menu, so it would appear that a dialog was meant to appear,
and there is no indication of why it did not.

Yes, that is long-standing behavior of IDLE on macOS; I just verified that the 
Save menu flash also happens with the legacy 8.6.8 Tk. I have never noticed it 
as a problem before and I'm not aware of any user reports of it so I think we 
can live with that :)

--

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



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

2021-11-02 Thread Marc Culler


Marc Culler  added the comment:

Yes that is what I meant.  So I guess everything may be OK now.  I did
verify that the Tk demo can repeatedly open file save dialogs.


When you press Command-S on a non-new edit window you do see the flash
of the Save menu, so it would appear that a dialog was meant to appear,
and there is no indication of why it did not.  But that is an IDLE UX
issue and in any case it sounds like Tk is not doing anything wrong.

--

___
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-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This in an interesting problem. I am going to work on it at the next weekends.

--

___
Python tracker 

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



[issue45656] argparse bug: prefix_chars argument to add_argument_group doesn't really work

2021-11-02 Thread paul j3


paul j3  added the comment:

Use of 'prefix_chars' as a argument_group parameter is not documented, nor 
intended.  

If it does appear to work in the help formatting, it is probably the result of 
inheritance, since both ArgumentParser and Argument_group subclass a 
_Actions_Container class.  I'd have to examine the code to see what's 
happening.  Argument_groups are used only for help formatting, not for parsing.

In any case, I don't think anything needs to be changed or fixed.

--
nosy: +paul.j3

___
Python tracker 

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



[issue45444] test.test_concurrent_futures fail in x86_ 64 architecture

2021-11-02 Thread Hai Shi


Hai Shi  added the comment:

> I use the Linux operating system (openeuler), kernel version 4.19.90, GCC 
> version 7.3.0. I directly run the following statement in the virtual machine

Hm. I haven't openeuler system, but I get docker container of the euler system.
The tests have passed in my docker containers(x86_64/aarch64).
My aarch64 systeminfo: Linux version 
4.19.36-vhulk1907.1.0.h1088.eulerosv2r8.aarch64 (abuild@szxrtosci1) (gcc 
version 7.3.0 (GCC)) #1 SMP Fri Aug 6 17:40:05 UTC 2021
build cmd: ./configure && make -j

and the output of `./python -m test.pythoninfo`:
test_socket.HAVE_SOCKET_ALG: True
test_socket.HAVE_SOCKET_BLUETOOTH: False
test_socket.HAVE_SOCKET_CAN: True
test_socket.HAVE_SOCKET_CAN_ISOTP: False
test_socket.HAVE_SOCKET_CAN_J1939: False
test_socket.HAVE_SOCKET_QIPCRTR: False
test_socket.HAVE_SOCKET_RDS: False
test_socket.HAVE_SOCKET_UDPLITE: True
test_socket.HAVE_SOCKET_VSOCK: False
test_support._is_gui_available: False

I checked the `test_socket.HAVE_SOCKET_QIPCRTR` and haven't find the 
correlation with test_concurrent_futures.py.

--

___
Python tracker 

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



[issue45673] argparse error with option with optional value

2021-11-02 Thread paul j3


paul j3  added the comment:

This is too big of an example for this board; I think it should have been asked 
on StackOverFlow.  Or maybe trimmed do to a more compact example.

But in any case, this is normal behavior for argparse.  Type checking, here 
'int', is done after the string is allocated to the '-s' argument.

Reserving that string for the required positional requires a form of look ahead 
that argparse does not currently do.  I think there's an old bug/issue on the 
topic, but the fix was, if I remember correctly, too complex to simply drop in.

I may look that up later.

--
nosy: +paul.j3

___
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-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Complete sets of characters which can be used in identifiers are too large:

>>> allchars = ''.join(map(chr, range(0x11)))
>>> identstartchars = ''.join(c for c in allchars if c.isidentifier())
>>> identcontchars = ''.join(c for c in allchars if ('a' + c).isidentifier())
>>> len(identstartchars), len(identcontchars)
(131975, 135053)

--

___
Python tracker 

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



[issue45690] Argparse exclusive group inside required exclusive group displays incorrectly

2021-11-02 Thread paul j3


paul j3  added the comment:

There was a bug/issue that addressed problems with nested 
mutually_exclusive_groups.  It should be easy to find.

The problem is that the usage formatter is brittle, building a string and then 
striping out "unnecessary" characters.  I assume the fix handled the default 
case (not required), but apparently it missed this variation.

I wasn't too involved with that, since in my opinion nesting these groups is 
useless, and should be avoided.  You might as well use one union group.  Test 
the parsing for yourself.

--
nosy: +paul.j3

___
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-02 Thread Ned Deily


Ned Deily  added the comment:

> Subsequent Command-S presses do not cause the file dialog to reappear.

Do you mean Command-S after modifying an IDLE edit window that has already been 
Save (or was Opened, not New)? In that case, the file dialog shouldn't appear: 
it saves to the existing file. To change the file, you'd need to do a Save As 
... (Shift-Command-S). Or perhaps I'm misunderstanding?

--

___
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-02 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This set is mostly outdated. In Python 2 it was a set of characters composing 
identifiers, but in Python 3 identifiers can contain non-ASCII characters.

--
nosy: +serhiy.storchaka

___
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-02 Thread Marc Culler


Marc Culler  added the comment:

I found the cause of the zombie dialog window.  I was supposed to call
[parent endSheet] after calling [parent beginSheet].  Adding that stops
the window from reappearing.  But it does not solve the whole problem.
Subsequent Command-S presses do not cause the file dialog to reappear.
In fact, they do not even generate a call to showOpenSavePanel, which
is supposed to present the dialog, and is also the function where all
of the changes have been made.  So this would seem to be a different bug.

I see that if I open a new editor with Command-N and enter some text
then Command-S works for the new editor.

--

___
Python tracker 

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



[issue45669] An 'ascii_alphanumerics' variable is missing in the 'strings' lib

2021-11-02 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Serhiy, thanks for the list. I can see it as either justifying or refuting the 
proposal.  So +-1 for the moment.

(I opened #45692 to eliminate the duplication in idlelib.)

--
nosy: +terry.reedy

___
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-02 Thread Terry J. Reedy


New submission from Terry J. Reedy :

IDLE currently defines the same set of chars in 5 places with 5 names. (Listed 
by Serhiy Storchaka in #45669.)
Lib/idlelib/autoexpand.py:20:wordchars = string.ascii_letters + 
string.digits + "_"
Lib/idlelib/undo.py:254:alphanumeric = string.ascii_letters + string.digits 
+ "_"
Lib/idlelib/editor.py:809:IDENTCHARS = string.ascii_letters + string.digits 
+ "_"
Lib/idlelib/hyperparser.py:13:_ASCII_ID_CHARS = frozenset(string.ascii_letters 
+ string.digits + "_")
Lib/idlelib/autocomplete.py:33:ID_CHARS = string.ascii_letters + string.digits 
+ "_"

I suspect that either a string or frozenset would work everywhere (check).  I 
will pick a name after checking this.  The single definition would go in the 
proposed utils.py, which is part of another issue and PR.

(Note: the utility tk index functions should also go there.)

--
assignee: terry.reedy
components: IDLE
messages: 405516
nosy: terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE: define word/id chars in one place.
type: enhancement
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



[issue45647] "expression" is erroneous in the doc

2021-11-02 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions:  -Python 3.6, 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



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

2021-11-02 Thread Mark Shannon


Change by Mark Shannon :


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

___
Python tracker 

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



[issue45646] Star expression in comprehension wrongly indicates to use or_expression after the star

2021-11-02 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
versions:  -Python 3.6, 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



[issue45638] Does ccbench still require 2.6 compatibility?

2021-11-02 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

By 'it' I meant the comment and 2.6 compatibility you asked about.

--

___
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-02 Thread Mark Shannon


New submission from Mark Shannon :

We currently have an unstable state in the VM where some core objects are 
static and some are per-interpreter.

For example, smalls ints are allocated per-interpreter, but many classes are 
allocated statically.
This means that if any int is reachable from a class, then references to 
per-interpreter objects can be left dangling, or be out of date.

E.g. consider this sequence:
1. Create an interpreter
2. Destroy it.
3. Create a new interpreter

`sys.float_info.n_unnamed_fields` causes a memory violation if the 
per-interpreter allocated 0 held by sys.float_info.n_unnamed_fields is freed.
If it is not freed, then `sys.float_info.n_unnamed_fields is 0` is False, 
meaning that there are two zeros present.

The above is just an example. Classes have many references to ints, floats, 
code  objects, etc. Any of those could have the same issue.

All objects that form the core object graph must either be entirely static, or 
entirely per-interpreter.

We cannot change from static to per-interpreter in a piecemeal fashion. It must 
be done all at once.

--
components: Interpreter Core
messages: 405514
nosy: Mark.Shannon, eric.snow, vstinner
priority: normal
severity: normal
status: open
title: Partial moving of core objects to interpreter state is incorrect at 
best, unsafe at worse.
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



[issue45567] Support TLS Encrypted ClientHello (ECH)

2021-11-02 Thread Hans-Christoph Steiner


Hans-Christoph Steiner  added the comment:

I agree with all you say, but I think it is important to not rule out handling 
HTTPS/SVCB DNS here.  It can happen at a later stage though.  What you propose 
works great for the first step.

If handling the DNS is punted to some external library, that means that each 
client app will have to implement this itself, and its non-trivial.  In that 
scenario, very few clients will implement it.  This makes me believe that this 
should be implemented in the core.  Granted, its an open question whether the 
ssl module is the right place.  For example, it could makes more sense to 
handle HTTPS/SVCB DNS in the HTTP libs (urllib, requests, etc), but that means 
non-HTTP uses (XMPP, Matrix, etc) will be disadvantaged.

--

___
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-02 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset 401272e6e660445d6556d5cd4db88ed4267a50b3 by Erlend Egeberg 
Aasland in branch 'main':
bpo-42064: Adapt `sqlite3` to multi-phase init (PEP 489) (GH-29234)
https://github.com/python/cpython/commit/401272e6e660445d6556d5cd4db88ed4267a50b3


--

___
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-02 Thread Ken Jin


Ken Jin  added the comment:


New changeset 454cdb99abcda37413b15167cda564091fec2572 by Dmitry Smirnov in 
branch 'main':
bpo-45633: Fix newtypes doc typo (GH-29318)
https://github.com/python/cpython/commit/454cdb99abcda37413b15167cda564091fec2572


--
nosy: +kj

___
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-02 Thread miss-islington


Change by miss-islington :


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

___
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-02 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27625
pull_request: https://github.com/python/cpython/pull/29365

___
Python tracker 

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



[issue45688] stdlib_module_names.h is missing _scproxy

2021-11-02 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks!

--

___
Python tracker 

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



[issue45690] Argparse exclusive group inside required exclusive group displays incorrectly

2021-11-02 Thread andrew cooke


New submission from andrew cooke :

The code below, when invoked with -h, prints:

(.env) [andrew@localhost py]$ python -m tests_sa.argparse_bug -h
usage: argparse_bug.py [-h] (-a A | [-b B | -c C)]

options:
  -h, --help  show this help message and exit
  -a A
  -b B
  -c C

where the final two characters in the usage line are swapped.  It should be

usage: argparse_bug.py [-h] (-a A | [-b B | -c C])

or maybe even

usage: argparse_bug.py [-h] (-a A | (-b B | -c C))



from argparse import ArgumentParser

def main():
parser = ArgumentParser()
outer = parser.add_mutually_exclusive_group(required=True)
outer.add_argument('-a')
inner = outer.add_mutually_exclusive_group()
inner.add_argument('-b')
inner.add_argument('-c')
parser.parse_args()


if __name__ == '__main__':
main()

--
components: Library (Lib)
messages: 405509
nosy: acooke
priority: normal
severity: normal
status: open
title: Argparse exclusive group inside required exclusive group displays 
incorrectly
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



[issue45638] Does ccbench still require 2.6 compatibility?

2021-11-02 Thread Skip Montanaro


Skip Montanaro  added the comment:

CCbench was mentioned recently in the discussion about Sam Gross's nogil branch:

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

I'm not convinced that deleting it is a no-brainer. Maybe if it landed 
somewhere generally useful (pyperformance?).

--

___
Python tracker 

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



[issue43158] uuid won't build when libuuid is installed in a non-standard place

2021-11-02 Thread Christian Heimes


Christian Heimes  added the comment:

The problem should be fixed now.

--
stage: patch review -> commit review
status: open -> pending

___
Python tracker 

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



  1   2   >