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

Alas, the celebration was premature. Shortly after posting msg405488 above, I 
installed the updated 3.10.0 on yet another macOS system and, on this one, I 
observed a problem: under some circumstances at least, the Save dialog window 
becomes orphaned and does not disappear until IDLE terminates. Here is one 
sequence of commands I've used:
- launch IDLE -> IDLE opens an IDLE shell window
- press CMD-N to open a new IDLE edit window
- type Python text into the window with a syntax error:
   x = $1
   print(x)
- press CMD-S to save the text into a file -> file Save window opens
- enter a file name and click on Save -> file is saved and IDLE edit window 
regains focus
- press F5 to run the script -> "Invalid syntax" popup appears
- click on OK to dismiss popup -> the popup disappears and the edit window 
regains focus. BUT sometimes (and not always) the Save window reappears behind 
the edit window and does not respond to Cancel or Save buttons, remaining 
orphaned until IDLE is exited.

This happens on both Monterey and Big Sur, I haven't tried earlier systems. So, 
while the current fix does make IDLE file dialogs usable on Monterey, it 
introduces an orphaned (though seemingly harmless) window on presumably all 
systems.

The big question is why didn't we see this during earlier testing? In my case, 
the answer is that on all the systems I tested with, the Save dialog window was 
in its default "compact" form and thus was completely hidden by the IDLE 
windows. Plus it doesn't seem to always happen if you vary the sequence of 
events slightly, not surprisingly. I only noticed the orphaned Save window now 
because on this latest system the Save window defaulted to the fully expanded 
version (with the side bar etc) and that Save window was wide enough to not be 
fully hidden behind the other IDLE windows. Sigh!

Until we can resolve this, I have reverted the changes to the website so that 
the default macOS download is again the original 3.10.0 installer.  The patched 
installer is still downloadable for testing at 
https://www.python.org/ftp/python/3.10.0/python-3.10.0post1-macos11.pkg.

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

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


Change by Terry J. Reedy :


--
assignee: terry.reedy -> 
components: +Tkinter, macOS -IDLE
status: open -> closed

___
Python tracker 

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



[issue45687] Infinite recursion in Pickler.persistent_id

2021-11-02 Thread Michał Bartoszkiewicz

New submission from Michał Bartoszkiewicz :

The following code, which seems reasonable:
import io
import pickle

class Pickler(pickle.Pickler):
  def persistent_id(self, obj):
return super().persistent_id(obj)

Pickler(io.BytesIO()).dump(42)

crashes with:
RecursionError: maximum recursion depth exceeded while calling a Python object

It works perfectly when inheriting from pickle._Pickler (the Python 
implementation).

--
components: Library (Lib)
files: pickle-bug.py
messages: 405494
nosy: embe-navalgo
priority: normal
severity: normal
status: open
title: Infinite recursion in Pickler.persistent_id
type: behavior
versions: Python 3.10, Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file50418/pickle-bug.py

___
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 Christian Heimes


New submission from Christian Heimes :

stdlib_module_names.h is missing the macOS specific module _scproxy. 
Guido ran into the problem in PR https://github.com/python/cpython/pull/29118

--
components: Build
messages: 405495
nosy: christian.heimes, eric.snow, gvanrossum, vstinner
priority: normal
severity: normal
status: open
title: stdlib_module_names.h is missing _scproxy
type: behavior
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



[issue45688] stdlib_module_names.h is missing _scproxy

2021-11-02 Thread Christian Heimes


Change by Christian Heimes :


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

___
Python tracker 

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



[issue45689] Custom Name for ThreadPoolExecutor

2021-11-02 Thread Tangellapalli Sai Hanuma Rahul


New submission from Tangellapalli Sai Hanuma Rahul :

Feature Request:

Where we can use custom Names for separate threads submitted in 
ThreadPoolExecutor. 

It achieves by sending the name string to _work_queue of ThreadPoolExecutor and 
then in _worker function modifies the name of the current thread (through name 
property).

--
components: Library (Lib)
files: test.py
hgrepos: 409
messages: 405496
nosy: RahulARanger
priority: normal
severity: normal
status: open
title: Custom Name for ThreadPoolExecutor
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 
3.9
Added file: https://bugs.python.org/file50419/test.py

___
Python tracker 

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



[issue45687] Infinite recursion in Pickler.persistent_id

2021-11-02 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
components: +Interpreter Core
nosy: +serhiy.storchaka
versions: +Python 3.11 -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



[issue2628] ftplib Persistent data connection

2021-11-02 Thread mike mcleod


mike mcleod  added the comment:

You're welcome.
Regards,
Mike

On Tue, 2 Nov 2021 at 05:52, Ethan Furman  wrote:

>
> Ethan Furman  added the comment:
>
> Ah.  Well, in that case closing seems like the best idea.
>
> Thank you, Jonathan, for getting the CLA signed and providing perspective.
>
> Thank you, Mike, for moving this issue forward.
>
> --
> resolution:  -> rejected
> stage: patch review -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue45689] Custom Name for ThreadPoolExecutor

2021-11-02 Thread Tangellapalli Sai Hanuma Rahul


Change by Tangellapalli Sai Hanuma Rahul :


--
hgrepos: +410
keywords: +patch
pull_requests: +27619
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29359

___
Python tracker 

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



[issue45689] Custom Name for ThreadPoolExecutor

2021-11-02 Thread Tangellapalli Sai Hanuma Rahul


Change by Tangellapalli Sai Hanuma Rahul :


--
hgrepos:  -410

___
Python tracker 

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



[issue45625] Add support for top-level await

2021-11-02 Thread Fred


Fred  added the comment:

I don't care what async framework is used, nor do I care if its a x86 or ARM, 
or if its Windows or Linux.

I don't want to have to setup an async runner because it is boilerplate code, 
and it brings concern into my application which is outside of the domain of my 
application.

In JavaScript, I can just call await fetch() or any other asynchronous function 
without having to pick and configure a async runtime.

On .NET it is also very easy, just await a function at the top-level without 
declare any runtime either. 
https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/tutorials/top-level-statements

Python is suppose to be a high-level language. Programmers should focus on 
their domain, not underlying things such as which runtime to use, which garbage 
collector to use, etc.

--

___
Python tracker 

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



[issue25024] Allow passing "delete=False" to TemporaryDirectory

2021-11-02 Thread Maksim Beliaev


Maksim Beliaev  added the comment:

just want to correct code that Nils post in the last comment to really take 
args and kwargs

~~~
def mkdtemp_persistent(*args, persistent=True, **kwargs):
if persistent:
@contextmanager
def normal_mkdtemp():
yield tempfile.mkdtemp(*args, **kwargs)
return normal_mkdtemp()
else:
return tempfile.TemporaryDirectory(*args, **kwargs)

with mkdtemp_persistent(persistent=False) as dir:
...
~~~

--
nosy: +beliaev-maksim

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


Change by za :


--
nosy: +za
nosy_count: 3.0 -> 4.0
pull_requests: +27620
pull_request: https://github.com/python/cpython/pull/29360

___
Python tracker 

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



[issue45625] Add support for top-level await

2021-11-02 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

As people write above, Python supports multiple async frameworks, asyncio is 
not the single choice.

You should select and maybe configure the async framework before executing your 
first `await` statement.

That's why the proposal doesn't work in Python.

Both javascript and C# are designed slightly differently: they have the only 
async subsystem that is deeply built into the language. It allows *implicit* 
async engine initialization and starting.

Sorry, should close the issue.

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

___
Python tracker 

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



[issue45625] Add support for top-level await

2021-11-02 Thread Fred


Fred  added the comment:

Yeah, those other languages such as C# and JavaScript and others make async 
much more easier, approachable, reduces boilerplate code and lowers the bar for 
entry!

--

___
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 Christian Heimes


Christian Heimes  added the comment:


New changeset 34098991289cb3e8eec012fa0243f30b9709666f by Christian Heimes in 
branch 'main':
bpo-45688: Add _scproxy to sys.stdlib_module_names (GH-29358)
https://github.com/python/cpython/commit/34098991289cb3e8eec012fa0243f30b9709666f


--

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


Change by miss-islington :


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

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


New changeset 77a1f8d94c29da7bda4bd43e5a9c2233573d46ee by Christian Heimes in 
branch 'main':
bpo-43158: Use configure values for building _uuid extension (GH-29353)
https://github.com/python/cpython/commit/77a1f8d94c29da7bda4bd43e5a9c2233573d46ee


--

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


Change by miss-islington :


--
pull_requests: +27623
pull_request: https://github.com/python/cpython/pull/29363

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


Change by miss-islington :


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

___
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 Christian Heimes


Christian Heimes  added the comment:


New changeset b2ae63161926527e31b9a9071b38836ad88e9a92 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-45688: Add _scproxy to sys.stdlib_module_names (GH-29358) (GH-29361)
https://github.com/python/cpython/commit/b2ae63161926527e31b9a9071b38836ad88e9a92


--

___
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 Christian Heimes


Change by Christian Heimes :


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



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


New changeset b71bc052454803aa8bd3e7edd2044e2d5e962243 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-43158: Use configure values for building _uuid extension (GH-29353) 
(GH-29362)
https://github.com/python/cpython/commit/b71bc052454803aa8bd3e7edd2044e2d5e962243


--

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


New changeset 91a51c5ffc3bd9da28a550530f6f2bcc25a2 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-43158: Use configure values for building _uuid extension (GH-29353) 
(GH-29363)
https://github.com/python/cpython/commit/91a51c5ffc3bd9da28a550530f6f2bcc25a2


--

___
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



[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



[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



[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



[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



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



[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



[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



[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



[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



[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



[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



[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



[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



[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



[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



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



[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



[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



[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



[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



[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



[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



[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



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



[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



[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



[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


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



[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



[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



[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



[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



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

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



[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



[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



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

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



[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



[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



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



[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



[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: +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: +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



[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


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



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



[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



[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



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



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

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



[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



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



[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



[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



[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



[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



  1   2   >