[issue46005] [doc] replace 'distutils' examples with 'setuptools'

2022-02-01 Thread Elmir


Elmir  added the comment:

I agree that documenting third-party tools in CPython docs is a bit weird. I 
guess this is more an issue with setuptools docs. IMHO here is no clear 
explanation on how to build extension modules there.

As a temporary work around, I wrote an example of building extension module 
with setuptools here:

https://elmjag.github.io/setuptools.html

--

___
Python tracker 

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



[issue45173] Remove configparser deprecations

2022-02-01 Thread Hugo van Kemenade


Hugo van Kemenade  added the comment:

Sure, please see https://bugs.python.org/issue46607.

I've rebased GH-30927 to use the new issue number.

--

___
Python tracker 

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



[issue45173] Remove configparser deprecations

2022-02-01 Thread Hugo van Kemenade


Change by Hugo van Kemenade :


--
pull_requests:  -29106

___
Python tracker 

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



[issue46607] Add DeprecationWarning to configparser's LegacyInterpolation

2022-02-01 Thread Hugo van Kemenade


Change by Hugo van Kemenade :


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

___
Python tracker 

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



[issue46607] Add DeprecationWarning to configparser's LegacyInterpolation

2022-02-01 Thread Hugo van Kemenade


New submission from Hugo van Kemenade :

The LegacyInterpolation class of configparser has been deprecated in docs since 
3.2, but without raising a DeprecationWarning.

The 3.2 HISTORY file says:

> - configparser: the SafeConfigParser class has been renamed to ConfigParser.
> The legacy ConfigParser class has been removed but its interpolation 
> mechanism is still available as LegacyInterpolation.

Searching the top 5,000 PyPI sdists, there's very little (if any "real") use of 
LegacyInterpolation. Details: https://bugs.python.org/issue45173#msg409685

Other configparser deprecations were added in 3.2, but with DeprecationWarnings.

Let's add a DeprecationWarning for a couple of releases before removal.

--
components: Library (Lib)
messages: 412339
nosy: hugovk
priority: normal
severity: normal
status: open
title: Add DeprecationWarning to configparser's LegacyInterpolation
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



[issue40077] Convert static types to heap types: use PyType_FromSpec()

2022-02-01 Thread Kumar Aditya


Kumar Aditya  added the comment:

On Windows PC/winreg.c has PyHKEY_Type static type which isn't cleared at exit 
too.

--
nosy: +kumaraditya303

___
Python tracker 

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



[issue46180] Button clicked failed when mouse hover tooltip and tooltip destroyed

2022-02-01 Thread Jason Yang


Jason Yang  added the comment:

The platform is WIN10 which shown at last line in first message.
I don't have other platforms to test if ok or not.

--

___
Python tracker 

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



[issue46606] Large C stack usage of os.getgroups() and os.setgroups()

2022-02-01 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue46600] Python built with clang -O0 allocates 10x more stack memory than clang -O3 on a Python function call

2022-02-01 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue46606] Large C stack usage of os.getgroups() and os.setgroups()

2022-02-01 Thread Inada Naoki


Change by Inada Naoki :


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

___
Python tracker 

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



[issue46602] Subtle trouble with heredoc append in configure.

2022-02-01 Thread Nathan Howard


Nathan Howard  added the comment:

Ok.  Let me know if something changes to justify the backport churn.
I can regen.

On 2/1/22, Ned Deily  wrote:
>
> Ned Deily  added the comment:
>
> Merged for release in 3.11.0a5. We *could* backport it to 3.10 and 3.9 but
> that involves regenerating configure again for each. It's probably not high
> enough priority to justify the churn for bugfix releases.
>
> --
> resolution:  -> fixed
> stage: patch review -> resolved
> status: open -> closed
> versions: +Python 3.11
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue46606] Large C stack usage of os.getgroups() and os.setgroups()

2022-02-01 Thread Inada Naoki


New submission from Inada Naoki :

I checked stack usage for bpo-46600 and found this two functions use a lot of 
stack.

os_setgroups: 262200 bytes
os_getgroups_impl: 262184 bytes

Both function has local variable like this:

gid_t grouplist[MAX_GROUPS];

MAX_GROUPS is defined as:

```
#ifdef NGROUPS_MAX
#define MAX_GROUPS NGROUPS_MAX
#else
/* defined to be 16 on Solaris7, so this should be a small number */
#define MAX_GROUPS 64
#endif
```

NGROUPS_MAX is 65536 and sizeof(gid_t) is 4 on Ubuntu 20.04, so grouplist is 
262144bytes.

It seems this grouplist is just for avoid allocation:

```
} else if (n <= MAX_GROUPS) {
/* groups will fit in existing array */
alt_grouplist = grouplist;
} else {
alt_grouplist = PyMem_New(gid_t, n);
if (alt_grouplist == NULL) {
return PyErr_NoMemory();
}
```

How about just using `#define MAX_GROUPS 64`?
Or should we remove this grouplist because os.grouplist() is not called so 
frequently?

--
components: Library (Lib)
messages: 412335
nosy: methane
priority: normal
severity: normal
status: open
title: Large C stack usage of os.getgroups() and os.setgroups()
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



[issue42205] Add image/webp to list of non-standard mimetypes

2022-02-01 Thread Éric Araujo

Change by Éric Araujo :


--
superseder: image/webp support in mimetypes -> Support webp and avif image 
formats in mimetypes

___
Python tracker 

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



[issue42049] Add image/webp to list of media types in mimetypes.py

2022-02-01 Thread Éric Araujo

Change by Éric Araujo :


--
superseder: image/webp support in mimetypes -> Support webp and avif image 
formats in mimetypes

___
Python tracker 

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



[issue38902] image/webp support in mimetypes

2022-02-01 Thread Éric Araujo

Change by Éric Araujo :


--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Support webp and avif image formats in mimetypes
versions: +Python 3.11 -Python 3.10

___
Python tracker 

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



[issue45639] Support webp and avif image formats in mimetypes

2022-02-01 Thread Éric Araujo

Change by Éric Araujo :


--
title: Support webp and aivf image formats in mimetypes -> Support webp and 
avif image formats in mimetypes

___
Python tracker 

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



[issue46600] Python built with clang -O0 allocates 10x more stack memory than clang -O3 on a Python function call

2022-02-01 Thread Inada Naoki


Inada Naoki  added the comment:

FWIW, it seems -O0 don't merge local variables in different path or lifetime.

For example, see _Py_abspath

```
if (path[0] == '\0' || !wcscmp(path, L".")) {
   wchar_t cwd[MAXPATHLEN + 1];
   //(snip)
}
//(snip)
wchar_t cwd[MAXPATHLEN + 1];
```

wchar_t is 4bytes and MAXPATHLEN is 4096 on Linux. So each cwd is 16388bytes.
-Og allocates 32856 bytes for it and -Og allocates 16440 bytes for it.

I don't know what is the specific optimization flag in -Og do merge local 
variable, but I think -Og is very important for _PyEval_EvalFrameDefault() 
since it has many local variables in huge switch-case statements.
-Og allocates 312 bytes for it and -O0 allocates 8280 bytes for it.

By the way, clang 13 has `-fstack-usage` option like gcc, but clang 12 don't 
have it.
Since Ubuntu 20.04 have only clang 12, I use `-fstack-size-segment` and 
https://github.com/mvanotti/stack-sizes to get stack size.

--
nosy: +methane

___
Python tracker 

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



[issue45639] Support webp and aivf image formats in mimetypes

2022-02-01 Thread Éric Araujo

Change by Éric Araujo :


--
title: Support modern image formats in MIME types -> Support webp and aivf 
image formats in mimetypes

___
Python tracker 

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



[issue46414] Add typing.reveal_type

2022-02-01 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset abcc3d75f6e570519cb37c62130a2295c6928bff by Jelle Zijlstra in 
branch 'main':
bpo-46414: Add typing.reveal_type (#30646)
https://github.com/python/cpython/commit/abcc3d75f6e570519cb37c62130a2295c6928bff


--

___
Python tracker 

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



[issue46602] Subtle trouble with heredoc append in configure.

2022-02-01 Thread Ned Deily


Ned Deily  added the comment:

Merged for release in 3.11.0a5. We *could* backport it to 3.10 and 3.9 but that 
involves regenerating configure again for each. It's probably not high enough 
priority to justify the churn for bugfix releases.

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



[issue46602] Subtle trouble with heredoc append in configure.

2022-02-01 Thread Ned Deily


Ned Deily  added the comment:


New changeset b1288964e31069bdf81abe560c82874f6f620928 by adanhawth in branch 
'main':
bpo-46602: Do not append conftest.c (GH-31062)
https://github.com/python/cpython/commit/b1288964e31069bdf81abe560c82874f6f620928


--
nosy: +ned.deily

___
Python tracker 

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



[issue44359] test_ftplib.test_makeport() fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched

2022-02-01 Thread miss-islington


miss-islington  added the comment:


New changeset 0371e5d7f1248abb0712fc98c3135d01d265cec8 by Miss Islington (bot) 
in branch '3.9':
bpo-44359: Fix test_ftplib unhandled thread exceptions (GH-31069)
https://github.com/python/cpython/commit/0371e5d7f1248abb0712fc98c3135d01d265cec8


--

___
Python tracker 

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



[issue44359] test_ftplib.test_makeport() fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched

2022-02-01 Thread miss-islington


miss-islington  added the comment:


New changeset 85b421fbff23ff41c52fa5bde191920b3701f0d0 by Miss Islington (bot) 
in branch '3.10':
bpo-44359: Fix test_ftplib unhandled thread exceptions (GH-31069)
https://github.com/python/cpython/commit/85b421fbff23ff41c52fa5bde191920b3701f0d0


--

___
Python tracker 

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



[issue45173] Remove configparser deprecations

2022-02-01 Thread STINNER Victor


STINNER Victor  added the comment:

Currently, the issue title is "Remove configparser deprecations".

GH-30927 doesn't remove deprecated functions, but adds new warnings. It's 
really confusing to make this change as part of this issue.

Can you please create a new issue for GH-30927 "bpo-45173: Add 
DeprecationWarning to LegacyInterpolation"? If it's removed, it's not going to 
be removed before Python 3.13, so it's not directly related to this issue. By 
the way, it would be nice explain the rationale for removing it.

--

___
Python tracker 

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



[issue45173] Remove configparser deprecations

2022-02-01 Thread STINNER Victor


STINNER Victor  added the comment:

> Searching 4,764 sdists from the top 5,000 PyPI packages, these 13 contain 
> "LegacyInterpolation"

Other removed symbols are causing troubles, like SafeConfigParser.

Example of Fedora bz #2025600: mom fails to build with Python 3.11: 
AttributeError: module 'configparser' has no attribute 'SafeConfigParser'.

=> https://bugzilla.redhat.com/show_bug.cgi?id=2025600

Another example: python-iniparse fails to build with Python 3.11: 
AttributeError: 'RawConfigParser' object has no attribute 'readfp'

https://bugzilla.redhat.com/show_bug.cgi?id=2019017

You can try to unfold 
https://bugzilla.redhat.com/buglist.cgi?bug_id=2016048_id_type=anddependson=tvp
 and search for "configparser".

--
nosy: +vstinner

___
Python tracker 

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



[issue46591] Make About IDLE links clickable

2022-02-01 Thread miss-islington


miss-islington  added the comment:


New changeset 7dee93c2d223a080f410f6901987e9d363743471 by Miss Islington (bot) 
in branch '3.10':
bpo-46591: Make About IDLE doc link label clickable (GH-30251)
https://github.com/python/cpython/commit/7dee93c2d223a080f410f6901987e9d363743471


--

___
Python tracker 

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



[issue44359] test_ftplib.test_makeport() fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched

2022-02-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29256
pull_request: https://github.com/python/cpython/pull/31071

___
Python tracker 

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



[issue44359] test_ftplib.test_makeport() fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched

2022-02-01 Thread miss-islington


Change by miss-islington :


--
message_count: 9.0 -> 10.0
nosy: +miss-islington
nosy_count: 9.0 -> 10.0
pull_requests: +29255
pull_request: https://github.com/python/cpython/pull/31070

___
Python tracker 

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



[issue44359] test_ftplib.test_makeport() fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched

2022-02-01 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 0611eafc709cbe8a2a0bdde082d25df0c5034de7 by Victor Stinner in 
branch 'main':
bpo-44359: Fix test_ftplib unhandled thread exceptions (GH-31069)
https://github.com/python/cpython/commit/0611eafc709cbe8a2a0bdde082d25df0c5034de7


--

___
Python tracker 

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



[issue46591] Make About IDLE links clickable

2022-02-01 Thread miss-islington


miss-islington  added the comment:


New changeset a1869e385b17bfdfe8d9850047f5b2dbb88e58fa by Miss Islington (bot) 
in branch '3.9':
bpo-46591: Make About IDLE doc link label clickable (GH-30251)
https://github.com/python/cpython/commit/a1869e385b17bfdfe8d9850047f5b2dbb88e58fa


--

___
Python tracker 

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



[issue44359] test_ftplib.test_makeport() fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched

2022-02-01 Thread STINNER Victor


STINNER Victor  added the comment:

GH-31069 simply silently ignore all socket errors.

I tried to write a smart fix which only ignores socket errors when tests are 
done, in tearDown(). But than I got issues in makepasv() tests which creates a 
socket and immediately closes it. The server also logs an error in this case.

IMO it's not worth it trying to write the perfect error handling for 
test_ftplib.

--
versions: +Python 3.9

___
Python tracker 

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



[issue44359] test_ftplib.test_makeport() fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched

2022-02-01 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29254
pull_request: https://github.com/python/cpython/pull/31069

___
Python tracker 

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



[issue46591] Make About IDLE links clickable

2022-02-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29253
pull_request: https://github.com/python/cpython/pull/31068

___
Python tracker 

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



[issue46591] Make About IDLE links clickable

2022-02-01 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +29252
pull_request: https://github.com/python/cpython/pull/31067

___
Python tracker 

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



[issue46591] Make About IDLE links clickable

2022-02-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 53c78080573b3bae4c4e782b9f47dce48aac9688 by Wes in branch 'main':
bpo-46591: Make About IDLE doc link label clickable (GH-30251)
https://github.com/python/cpython/commit/53c78080573b3bae4c4e782b9f47dce48aac9688


--

___
Python tracker 

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



[issue44359] test_ftplib.test_makeport() fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched

2022-02-01 Thread STINNER Victor


STINNER Victor  added the comment:

On Fedora Rawhide x64-64, I can reproduce the test_ftplib test_makeport() issue 
in reliable way.

On Python 3.9, the test also logs the exception but the test is marked as a 
success:
---
$ ./python -m test -u all test_ftplib -v -m test_makeport
(...)
test_makeport (test.test_ftplib.TestFTPClass) ... ok
test_makeport (test.test_ftplib.TestIPv6Environment) ... ok
test_makeport (test.test_ftplib.TestTLS_FTPClassMixin) ... Exception in thread 
Thread-3:
Traceback (most recent call last):
  File "/home/vstinner/python/3.9/Lib/asyncore.py", line 83, in read
obj.handle_read_event()
  File "/home/vstinner/python/3.9/Lib/test/test_ftplib.py", line 377, in 
handle_read_event
self._do_ssl_handshake()
  File "/home/vstinner/python/3.9/Lib/test/test_ftplib.py", line 338, in 
_do_ssl_handshake
self.socket.do_handshake()
  File "/home/vstinner/python/3.9/Lib/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLZeroReturnError: TLS/SSL connection has been closed (EOF) (_ssl.c:1129)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/vstinner/python/3.9/Lib/threading.py", line 973, in 
_bootstrap_inner
self.run()
  File "/home/vstinner/python/3.9/Lib/test/test_ftplib.py", line 291, in run
asyncore.loop(timeout=0.1, count=1)
  File "/home/vstinner/python/3.9/Lib/asyncore.py", line 207, in loop
poll_fun(timeout, map)
  File "/home/vstinner/python/3.9/Lib/asyncore.py", line 150, in poll
read(obj)
  File "/home/vstinner/python/3.9/Lib/asyncore.py", line 87, in read
obj.handle_error()
  File "/home/vstinner/python/3.9/Lib/test/test_ftplib.py", line 414, in 
handle_error
raise Exception
Exception
ok
(...)
Tests result: SUCCESS
---

make buildbottest uses -W option which hides the test output unless the test 
failed.

In this case, the unhandled threading exception is siently ignored:
---
$ ./python -m test -u all test_ftplib -W -m test_makeport -j1
(...)
0:00:00 load avg: 0.75 [1/1] test_ftplib passed
(...)
Tests result: SUCCESS
---

On Python 3.10 and newer, libregrtest sets a threading excepthook to (1) log 
the exception (2) mark that the note "altered the environmen": mark the test as 
"ENV CHANGED". I did that to detect unhandled exceptions like this one.

In this case, unhandled exceptions come from the four handle_error() method of 
test_ftplib dispatcher classes, like SSLConnection, which are implemented as:

def handle_error(self):
raise Exception

test_ftplib closes sockets in TestFTPClass.tearDown() method:

def tearDown(self):
self.client.close()
self.server.stop()
# Explicitly clear the attribute to prevent dangling thread
self.server = None
asyncore.close_all(ignore_all=True)

The problem is that the code doesn't implement any kind of error handling. If 
asyncore gets a socket exception, it calls handle_error() which raises an a new 
Exception instance. That's it.

IMO it's not worth it to bother with handling socket errors in test_ftplib. The 
server is implemented with asyncore which is deprecated since Python 3.6. The 
FTP protocol itself is legacy.

Attached PR simply ignores socket erors rather than logging unhandled threading 
exceptions.

--

___
Python tracker 

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



[issue42369] Reading ZipFile not thread-safe

2022-02-01 Thread Matthew Davis


Matthew Davis  added the comment:

In addition to fixing any unexpected behavior, can we update the documentation 
[1] to state what the expected behavior is in terms of thread safety?

[1] https://docs.python.org/3/library/zipfile.html

--
nosy: +mdavis-xyz

___
Python tracker 

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



[issue46594] Windows "Edit with IDLE >" only has one selection

2022-02-01 Thread Eryk Sun


Eryk Sun  added the comment:

> the Open With entries may not be being merged.

That would probably be a bug in the Windows shell API. The HKCU and HKLM 
subkeys of "Software\Classes\Python.File\Shell\editwithidle\shell" are merged 
in the HKCR view. The same key path can exist in both hives, for which the view 
contains the union, with precedence for HKCU.

For example, with "Software\Classes\spam":

import winreg

hkm = winreg.CreateKey(winreg.HKEY_LOCAL_MACHINE, r'Software\Classes\spam')
winreg.SetValueEx(hkm, 'eggs', 0, winreg.REG_SZ, 'hklm')
winreg.SetValueEx(hkm, 'baz', 0, winreg.REG_SZ, 'hklm')

hku = winreg.CreateKey(winreg.HKEY_CURRENT_USER, r'Software\Classes\spam')
winreg.SetValueEx(hku, 'eggs', 0, winreg.REG_SZ, 'hkcu')
winreg.SetValueEx(hku, 'bam', 0, winreg.REG_SZ, 'hkcu')

hkr = winreg.OpenKey(winreg.HKEY_CLASSES_ROOT, 'spam')

>>> winreg.EnumValue(hkr, 0)
('bam', 'hkcu', 1)
>>> winreg.EnumValue(hkr, 1)
('baz', 'hklm', 1)
>>> winreg.EnumValue(hkr, 2)
('eggs', 'hkcu', 1)

>>> winreg.EnumValue(hkr, 3)
Traceback (most recent call last):
  File "", line 1, in 
OSError: [WinError 259] No more data is available

--

___
Python tracker 

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



[issue45773] Compiler hangs during jump elimination

2022-02-01 Thread Brandt Bucher


Change by Brandt Bucher :


--
pull_requests: +29251
pull_request: https://github.com/python/cpython/pull/31066

___
Python tracker 

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



[issue45773] Compiler hangs during jump elimination

2022-02-01 Thread Brandt Bucher


Brandt Bucher  added the comment:

My fix for this seems to have erroneously added two invalid new jump threads:

POP_JUMP_IF_FALSE(a) to JUMP_IF_FALSE_OR_POP(b) is folded into 
POP_JUMP_IF_FALSE(b)
POP_JUMP_IF_TRUE(a) to JUMP_IF_TRUE_OR_POP(b) is folded into POP_JUMP_IF_TRUE(b)

The good news is that I can't get the compiler to actually emit these 
particular jump sequences. It still needs to be fixed ASAP, though.

--
nosy: +pablogsal
priority: high -> release blocker
resolution: fixed -> 
stage: resolved -> patch review
status: closed -> open
type: crash -> behavior

___
Python tracker 

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



[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2022-02-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29250
pull_request: https://github.com/python/cpython/pull/31065

___
Python tracker 

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



[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2022-02-01 Thread miss-islington


miss-islington  added the comment:


New changeset 89b13042fcfc95bae21a49806a205ef62f1cdd73 by Paul m. p. P in 
branch 'main':
bpo-14916: use specified tokenizer fd for file input (GH-31006)
https://github.com/python/cpython/commit/89b13042fcfc95bae21a49806a205ef62f1cdd73


--
nosy: +miss-islington

___
Python tracker 

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



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-02-01 Thread da-woods


da-woods  added the comment:

Just a quick comment on Cython and these changes:

Cython 0.29 can build itself on Python 3.11a4 with 
`CFLAGS="-DCYTHON_FAST_THREAD_STATE=0 -DCYTHON_USE_EXC_INFO_STACK=0" python3.11 
setup.py build_ext`.

I think there's some coroutine code left that isn't fixed by those flags, but a 
large chunk of Cython libraries won't use coroutines and so will work fine with 
these flags. Hopefully that unblocks some stuff for you.

--
nosy: +da-woods

___
Python tracker 

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



[issue46605] Py_XDECREF() module on fail in Py_mod_exec

2022-02-01 Thread ov2k


New submission from ov2k :

In some of the xx modules, a Py_mod_exec function steals a reference to the 
module argument when an error occurs (Py_XDECREF(m) after goto fail).  It's a 
bit pernicious given the modules' stated intent to be used as a template, 
although I'm not sure how often this has actually happened.  At the very least, 
I haven't noticed this outside the xx modules.

For Python <= 3.9, this affects xx_exec() in xxmodule.c and xx_modexec() in 
xxlimited.c.  For Python >= 3.10, this affects xx_exec() in xxmodule.c and 
xx_modexec() in xxlimited_35.c.

--
components: Extension Modules
messages: 412315
nosy: ov2k
priority: normal
severity: normal
status: open
title: Py_XDECREF() module on fail in Py_mod_exec
type: behavior
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue46528] Simplify the VM's stack manipulations

2022-02-01 Thread Brandt Bucher


Brandt Bucher  added the comment:


New changeset a0e55a571cf01885fd5826266c37abaee307c309 by Brandt Bucher in 
branch 'main':
bpo-46528: Simplify BUILD_TUPLE/UNPACK_SEQUENCE folding (GH-31039)
https://github.com/python/cpython/commit/a0e55a571cf01885fd5826266c37abaee307c309


--

___
Python tracker 

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



[issue46604] Documentation fix in ssl module

2022-02-01 Thread Kossi GLOKPOR


Change by Kossi GLOKPOR :


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

___
Python tracker 

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



[issue46604] Documentation fix in ssl module

2022-02-01 Thread Kossi GLOKPOR


Change by Kossi GLOKPOR :


--
assignee: docs@python
components: Documentation
nosy: docs@python, glk0
priority: normal
severity: normal
status: open
title: Documentation fix in ssl module
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue46594] Windows "Edit with IDLE >" only has one selection

2022-02-01 Thread Steve Dower


Steve Dower  added the comment:

I wonder if you've managed to install the launcher a second time? If the second 
one is for current user but the first is for local machine, the Open With 
entries may not be being merged.

In theory, the installer is supposed to detect a previous launcher and match 
its setting, but the default did change recently, so maybe the detection is not 
working.

Not sure when I'll get a chance to check it out, so if someone else wants to 
check and confirm that would be helpful.

--

___
Python tracker 

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



[issue46573] Python modules such as pyglet or pygame crash Python when tkinter message boxes are opened on MacOS.

2022-02-01 Thread Ned Deily


Ned Deily  added the comment:

> If I interpret the information I posted earlier correctly this is a bug in 
> Tkinter [...]

Tkinter? Or Tk itself?

--

___
Python tracker 

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



[issue46573] Python modules such as pyglet or pygame crash Python when tkinter message boxes are opened on MacOS.

2022-02-01 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

If I interpret the information I posted earlier correctly this is a bug in 
Tkinter, it calls a non-existing Objecive-C method (``-[NSApplication 
macOSVersion]``) and that results in an uncaught Objective-C exception and 
hence an abort().

BTW. All of this is using python 3.10.2 using the installer on python.org.

--
components: +Tkinter

___
Python tracker 

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



[issue46603] `typing._strip_annotations` is not fully covered

2022-02-01 Thread Nikita Sobolev


Change by Nikita Sobolev :


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

___
Python tracker 

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



[issue46573] Python modules such as pyglet or pygame crash Python when tkinter message boxes are opened on MacOS.

2022-02-01 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

The last bit of the call stack according to lldb:

* thread #2, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x00018b3419b8 libsystem_kernel.dylib`__pthread_kill + 8
frame #1: 0x00018b374eb0 libsystem_pthread.dylib`pthread_kill + 288
frame #2: 0x00018b2b2314 libsystem_c.dylib`abort + 164
frame #3: 0x00018b331b50 libc++abi.dylib`abort_message + 132
frame #4: 0x00018b322f64 libc++abi.dylib`demangling_terminate_handler() 
+ 332
frame #5: 0x00018b21a140 libobjc.A.dylib`_objc_terminate() + 144
frame #6: 0x00018b330ee4 libc++abi.dylib`std::__terminate(void (*)()) + 
20
  * frame #7: 0x00018b333c5c 
libc++abi.dylib`__cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) + 36
frame #8: 0x00018b333c08 libc++abi.dylib`__cxa_throw + 140
frame #9: 0x00018b2118dc libobjc.A.dylib`objc_exception_throw + 352
frame #10: 0x00018b5531a0 CoreFoundation`-[NSObject(NSObject) 
doesNotRecognizeSelector:] + 144
frame #11: 0x00018b420360 CoreFoundation`___forwarding___ + 1728
frame #12: 0x00018b41fbe0 CoreFoundation`_CF_forwarding_prep_0 + 96
frame #13: 0x000102388a1c libtk8.6.dylib`GetRGBA + 64
frame #14: 0x0001023884a8 libtk8.6.dylib`SetCGColorComponents + 140
frame #15: 0x0001023888e0 libtk8.6.dylib`TkpGetColor + 544
frame #16: 0x0001022ea454 libtk8.6.dylib`Tk_GetColor + 220
frame #17: 0x0001022ddaa0 libtk8.6.dylib`Tk_Get3DBorder + 204
frame #18: 0x0001022dd8ac libtk8.6.dylib`Tk_Alloc3DBorderFromObj + 144
frame #19: 0x0001022eb810 libtk8.6.dylib`DoObjConfig + 832
frame #20: 0x0001022eb3cc libtk8.6.dylib`Tk_InitOptions + 348
frame #21: 0x0001022eb2c8 libtk8.6.dylib`Tk_InitOptions + 88
frame #22: 0x000102312cf0 libtk8.6.dylib`CreateFrame + 1448
frame #23: 0x000102312fe8 libtk8.6.dylib`TkListCreateFrame + 156
frame #24: 0x00010230bec0 libtk8.6.dylib`Initialize + 1848
frame #25: 0x00010026a2d4 _tkinter.cpython-310-darwin.so`Tcl_AppInit + 
92
frame #26: 0x000100269f6c _tkinter.cpython-310-darwin.so`Tkapp_New + 548
frame #27: 0x000100269d44 
_tkinter.cpython-310-darwin.so`_tkinter_create_impl + 268
frame #28: 0x00010026997c 
_tkinter.cpython-310-darwin.so`_tkinter_create + 240
frame #29: 0x000100bf71f0 Python`cfunction_vectorcall_FASTCALL + 88

--

___
Python tracker 

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



[issue46573] Python modules such as pyglet or pygame crash Python when tkinter message boxes are opened on MacOS.

2022-02-01 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Error output when running the script:

2022-02-01 22:15:32.213 Python[5468:5726153] ApplePersistenceIgnoreState: 
Existing state will not be touched. New state will be written to 
/var/folders/d3/rc5nx4v12y96knh2px3bpqscgn/T/org.python.python.savedState
2022-02-01 22:15:32.362 Python[5468:5726153] -[NSApplication macOSVersion]: 
unrecognized selector sent to instance 0x105624bc0
2022-02-01 22:15:32.367 Python[5468:5726153] *** Terminating app due to 
uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication 
macOSVersion]: unrecognized selector sent to instance 0x105624bc0'
*** First throw call stack:
(
0   CoreFoundation  0x00018b4c01cc 
__exceptionPreprocess + 240
1   libobjc.A.dylib 0x00018b2117b8 
objc_exception_throw + 60
2   CoreFoundation  0x00018b5531a0 
-[NSObject(NSObject) __retain_OA] + 0
3   CoreFoundation  0x00018b420360 
___forwarding___ + 1728
4   CoreFoundation  0x00018b41fbe0 
_CF_forwarding_prep_0 + 96
5   libtk8.6.dylib  0x000100940a1c GetRGBA + 64
6   libtk8.6.dylib  0x0001009404a8 
SetCGColorComponents + 140
7   libtk8.6.dylib  0x0001009408e0 TkpGetColor 
+ 544
8   libtk8.6.dylib  0x0001008a2454 Tk_GetColor 
+ 220
9   libtk8.6.dylib  0x000100895aa0 
Tk_Get3DBorder + 204
10  libtk8.6.dylib  0x0001008958ac 
Tk_Alloc3DBorderFromObj + 144
11  libtk8.6.dylib  0x0001008a3810 DoObjConfig 
+ 832
12  libtk8.6.dylib  0x0001008a33cc 
Tk_InitOptions + 348
13  libtk8.6.dylib  0x0001008a32c8 
Tk_InitOptions + 88
14  libtk8.6.dylib  0x0001008cacf0 CreateFrame 
+ 1448
15  libtk8.6.dylib  0x0001008cafe8 
TkListCreateFrame + 156
16  libtk8.6.dylib  0x0001008c3ec0 Initialize + 
1848
17  _tkinter.cpython-310-darwin.so  0x0001008762d4 Tcl_AppInit 
+ 92
18  _tkinter.cpython-310-darwin.so  0x000100875f6c Tkapp_New + 
548
19  _tkinter.cpython-310-darwin.so  0x000100875d44 
_tkinter_create_impl + 268
20  _tkinter.cpython-310-darwin.so  0x00010087597c 
_tkinter_create + 240
21  Python  0x00010109b1f0 
cfunction_vectorcall_FASTCALL + 88
22  Python  0x000101169f48 
call_function + 132
23  Python  0x000101161fac 
_PyEval_EvalFrameDefault + 23072
24  Python  0x00010115ad5c 
_PyEval_Vector + 360
25  Python  0x000101033dac 
_PyObject_FastCallDictTstate + 96
26  Python  0x0001010c7cbc slot_tp_init 
+ 196
27  Python  0x0001010be950 type_call + 
312
28  Python  0x000101033af4 
_PyObject_MakeTpCall + 136
29  Python  0x00010116a040 
call_function + 380
30  Python  0x000101160a18 
_PyEval_EvalFrameDefault + 17548
31  Python  0x00010115ad5c 
_PyEval_Vector + 360
32  Python  0x000101169f48 
call_function + 132
33  Python  0x000101160a18 
_PyEval_EvalFrameDefault + 17548
34  Python  0x00010115ad5c 
_PyEval_Vector + 360
35  Python  0x000101169f48 
call_function + 132
36  Python  0x000101161404 
_PyEval_EvalFrameDefault + 20088
37  Python  0x00010115ad5c 
_PyEval_Vector + 360
38  Python  0x00010115cb3c 
_PyEval_EvalFrameDefault + 1456
39  Python  0x00010115ad5c 
_PyEval_Vector + 360
40  Python  0x000101169f48 
call_function + 132
41  Python  0x000101160a18 
_PyEval_EvalFrameDefault + 17548
42  Python  0x00010115ad5c 
_PyEval_Vector + 360
43  Python  0x00010115cb3c 
_PyEval_EvalFrameDefault + 1456
44  Python  0x00010115ad5c 
_PyEval_Vector + 360
45  Python  0x00010115cb3c 
_PyEval_EvalFrameDefault + 1456
46  Python  0x00010115ad5c 
_PyEval_Vector + 360
  

[issue46603] `typing._strip_annotations` is not fully covered

2022-02-01 Thread Nikita Sobolev


New submission from Nikita Sobolev :

Right now `coverage` says that this line is not covered at all: 
https://github.com/python/cpython/blob/bebaa95fd0f44babf8b6bcffd8f2908c73ca259e/Lib/typing.py#L1882

Considering how hard all these `types.UnionType` / `typing.Union` stuff is and 
that the logic with `reduce` and `operator.or_` is also quite complex, I think 
it is important to cover it.

It actually took me some time to reach this line, but here's the test I came up 
with:

```
def test_get_type_hints_annotated_in_union(self):
def with_union(x: int | list[Annotated[str, 'meta']]): ...

self.assertEqual(get_type_hints(with_union), {'x': int | list[str]})
self.assertEqual(
get_type_hints(with_union, include_extras=True),
{'x': int | list[Annotated[str, 'meta']]},
)
```

Note that direct `|` with `Annotated` does not work, because it triggers 
`_AnnotatedType.__or__`, which returns `typing.Union` and not `types.UnionType`.

I will send a PR with it in a minute :)

Any feedback is welcome!

--
components: Library (Lib)
messages: 412308
nosy: AlexWaygood, gvanrossum, kj, sobolevn
priority: normal
severity: normal
status: open
title: `typing._strip_annotations` is not fully covered
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue46540] dylibs not loading properly from NFS mounts

2022-02-01 Thread Ned Deily


Ned Deily  added the comment:

> I currently do not have access to a more up-to-date Mac OS but once I do I
will test and report anything unusual back.

Good luck! Since there's a good chance that this issue will languish in our 
open backlog, I am going to mark it as closed for now. But please re-open this 
issue if you find anything that appears to be an issue with Python rather than 
just macOS. Two other suggestions for debugging:
1. You've probably already done this but double-check file and directory access 
permissions on the NFS-mounted file system up to root. We have seen other 
issues with relative paths on 10.15+ with the introduction of the read-only 
system volume and related file system layout complications.
2. You might try using install_name_tool to alter copies of those third-party 
.so(s) and dylib(s) that use @rpath and instead use an absolute path to their 
installed location(s). That would eliminate one variable.

--
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue46540] dylibs not loading properly from NFS mounts

2022-02-01 Thread embassy_vfx


embassy_vfx  added the comment:

Hi Ned,

Thanks for the reply. I figured that this may be the case but wanted to
report it anyway.

I currently do not have access to a more up-to-date Mac OS but once I do I
will test and report anything unusual back. I also have not tested other
file systems but will most likely do that as well. Thanks again for your
time here.

Kenny

On Sun, Jan 30, 2022 at 5:48 PM Ned Deily  wrote:

>
> Ned Deily  added the comment:
>
> Thanks for the report but there are a lot of variables here that make this
> very difficult to act on. First, there have been many changes in macOS
> 10.15 regarding file permissions and file system layouts (with APFS et al)
> and further changes in the more recent versions of macOS, 11 Big Sur and
> now 12 Monterey. Further, Python 3.7 is now in the security-fix-only phase
> of its life cycle which means we no longer produce binary installers for
> macOS or Windows for 3.7. 3.7.9 was released prior to the official release
> of macOS 11 and so, as noted on the changelog for 3.7.9, macOS 11+ is not
> fully supported by 3.7.x. We have also learned more about these operating
> systems since then and there are changes in Python and in how we
> manufacture python.org macOS installers that are reflected in current
> releases of Python 3.9.x and 3.10.x. Beyond that, AFAIK, we do not do any
> testing of macOS NFS clients or servers and have no setup for that at hand.
> And throwing in a third-party extension module (shiboken2.abi3.so) plus
> use of @rpath on top of all that adds even more variability.
>
> My suggestion is to try to reproduce this with a current, fully-supported
> python.org macOS installer download (i.e. the 3.10.2 universal2
> installer) and preferably on a current version of macOS, currently 12.2 or
> possibly 11.6.3, and also check "System Preferences" -> "Security &
> Privacy" -> "Privacy settings" like "Full Disk Access" and "Files and
> Folders"; if problems persist, try doing some dynamic loader debugging
> using the DYLD_* environment variables documented in the macOS dyld man
> page (man dyld). Otherwise, as your issue stands now, it seems unlikely
> that anyone here would be willing to invest the significant time to try to
> reproduce and debug what seems to be an unusual macOS configuration with
> out-of-date OS and Python versions.
>
> Perhaps a simpler option is to just avoid use of NFS file systems on macOS
> for this purpose.
>
> Sorry I don't have a more positive answer for you.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue44359] test_ftplib.test_makeport() fails as "env changes" if a socket operation times out in a thread: TimeoutError is not catched

2022-02-01 Thread Guido van Rossum


Guido van Rossum  added the comment:

Maybe it's time to actually try to fix this test rather than just complaining 
about it? Surely *somebody* here has an idea? Else maybe we need to just 
disable it.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue46602] Subtle trouble with heredoc append in configure.

2022-02-01 Thread Nathan Howard


Change by Nathan Howard :


--
components: +Build -Installation
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



[issue46602] Subtle trouble with heredoc append in configure.

2022-02-01 Thread Nathan Howard


Change by Nathan Howard :


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

___
Python tracker 

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



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-02-01 Thread Irit Katriel


Irit Katriel  added the comment:

> GH-30531 proposes adding PyErr_GetActiveException() function which has no 
> parameter, but Cython __Pyx_PyErr_GetTopmostException() has a tstate 
> parameter.


I've now updated it to follow the pattern of other functions, where the is a 
private function that takes tstate and the public function calls it.

So it adds in Include/pyerrors.h 

PyAPI_FUNC(PyObject*) PyErr_GetActiveException(void);
PyAPI_FUNC(void) PyErr_SetActiveException(PyObject *);

and in Include/cpython/pyerrors.h

PyAPI_FUNC(PyObject*) _PyErr_GetActiveException(PyThreadState *);
PyAPI_FUNC(void) _PyErr_SetActiveException(PyThreadState *, PyObject *);

--

___
Python tracker 

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



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-02-01 Thread Irit Katriel


Irit Katriel  added the comment:

This is a backport of @scoder's patch to 0.29.x. (I don't know if this is 
helpful).

https://github.com/cython/cython/compare/master...iritkatriel:exc_info?expand=1

--

___
Python tracker 

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



[issue45413] Add install scheme for virtual environments

2022-02-01 Thread Miro Hrončok

Miro Hrončok  added the comment:

The PR is now ready for review.

--

___
Python tracker 

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



[issue46487] `_SSLProtocolTransport` doesn't have the `get_write_buffer_limits` implementation.

2022-02-01 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Done, thanks!

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

___
Python tracker 

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



[issue46487] `_SSLProtocolTransport` doesn't have the `get_write_buffer_limits` implementation.

2022-02-01 Thread miss-islington


miss-islington  added the comment:


New changeset e5e1441d41907f92cc3bb5de675a2c519068173d by Miss Islington (bot) 
in branch '3.10':
bpo-46487: Add `get_write_buffer_limits` to Write and _SSLProtocol transports 
(GH-30958)
https://github.com/python/cpython/commit/e5e1441d41907f92cc3bb5de675a2c519068173d


--

___
Python tracker 

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



[issue46487] `_SSLProtocolTransport` doesn't have the `get_write_buffer_limits` implementation.

2022-02-01 Thread miss-islington


miss-islington  added the comment:


New changeset e4a6e549027b33bbe87f49fcfccc880243e49834 by Miss Islington (bot) 
in branch '3.9':
bpo-46487: Add `get_write_buffer_limits` to Write and _SSLProtocol transports 
(GH-30958)
https://github.com/python/cpython/commit/e4a6e549027b33bbe87f49fcfccc880243e49834


--

___
Python tracker 

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



[issue46602] Subtle trouble with heredoc append in configure.

2022-02-01 Thread Nathan Howard


New submission from Nathan Howard :

TODO: (see PR)

--
components: Installation
messages: 412298
nosy: adanhawth
priority: normal
severity: normal
status: open
title: Subtle trouble with heredoc append in configure.
type: compile error
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



[issue46364] asyncio subprocess cannot read from /dev/stdin

2022-02-01 Thread xoph


xoph  added the comment:

Created a PR: https://github.com/python/cpython/pull/30596

It's ready for review. Happy about any feedback!

--

___
Python tracker 

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



[issue46601] macOS installer "Install Certificates.command" fails if pip is not installed

2022-02-01 Thread Chris Drake


Chris Drake  added the comment:

So it looks like a dependency error in the installer then?

It obviously makes no sense for pip to required before the python installer can 
work - chicken-and-egg issue - the installer should install what it needs of 
course, which I guess includes pip if that's really needed at this stage...

--

___
Python tracker 

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



[issue45925] Upgrade macOS and Windows installers to use SQLite 3.37.2

2022-02-01 Thread Ned Deily


Change by Ned Deily :


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



[issue45925] Upgrade macOS and Windows installers to use SQLite 3.37.2

2022-02-01 Thread Ned Deily


Ned Deily  added the comment:


New changeset a22dd00f2da4f6ff96f58fd8d551f16bdb870c8d by Miss Islington (bot) 
in branch '3.9':
bpo-45925: Update macOS installer to SQLite 3.37.2 (GH-30921) (GH-31057) 
(GH-31059)
https://github.com/python/cpython/commit/a22dd00f2da4f6ff96f58fd8d551f16bdb870c8d


--

___
Python tracker 

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



[issue46600] Python built with clang -O0 allocates 10x more stack memory than clang -O3 on a Python function call

2022-02-01 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset bebaa95fd0f44babf8b6bcffd8f2908c73ca259e by Victor Stinner in 
branch 'main':
bpo-46600: Fix test_gdb.test_pycfunction() for clang -Og (GH-31058)
https://github.com/python/cpython/commit/bebaa95fd0f44babf8b6bcffd8f2908c73ca259e


--

___
Python tracker 

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



[issue46601] macOS installer "Install Certificates.command" fails if pip is not installed

2022-02-01 Thread Ned Deily


Ned Deily  added the comment:

Thanks for opening the issue. From the pythondotorg issue, the output from the 
failed command:

Last login: Sat May 8 17:08:01 on ttys005
/Applications/Python\ 3.9/Install\ Certificates.command ; exit;
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = (unset),
LC_CTYPE = "en_AU.UTF-8.UTF-8",
LANG = "en_AU.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
[cnd@mac ~]$ /Applications/Python\ 3.9/Install\ Certificates.command ; exit;
-- pip install --upgrade certifi
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9: No module 
named pip
Traceback (most recent call last):
File "", line 44, in 
File "", line 24, in main
File 
"/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py",
 line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 
'['/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9', '-E', 
'-s', '-m', 'pip', 'install', '--upgrade', 'certifi']' returned non-zero exit 
status 1.
logout

[Process completed]

So the failure is due to pip not being installed. Install Certificates assumes 
pip will be available but that may not necessarily be the case, for instance, 
if a custom install of Python was selected and the "Install or upgrade pip" 
package is deselected. Install Certificates should protect itself, if nothing 
else, by providing a useful message.

(For the record, the "perl warnings" at the start of the terminal session are 
presumably coming from one of the shell startup scripts that are run 
automatically at the beginning of a terminal session. Install Certificates does 
not use perl.)

--
assignee:  -> ned.deily
stage:  -> needs patch
title: Instructions do not work -> macOS installer "Install 
Certificates.command" fails if pip is not installed
versions: +Python 3.10, Python 3.9

___
Python tracker 

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



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-02-01 Thread STINNER Victor


STINNER Victor  added the comment:

> __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)

Python provides a *private* _PyErr_GetTopmostException(tstate) function, but 
Cython reimplements its own function. I'm not sure why.

GH-30531 proposes adding PyErr_GetActiveException() function which has no 
parameter, but Cython __Pyx_PyErr_GetTopmostException() has a tstate parameter.

Simplified example numpy/random/_mt19937.c code:

static CYTHON_INLINE void
__Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type,
 PyObject **value, PyObject **tb)
{
_PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
*type = exc_info->exc_type;
*value = exc_info->exc_value;
*tb = exc_info->exc_traceback;
Py_XINCREF(*type);
Py_XINCREF(*value);
Py_XINCREF(*tb);
}

static CYTHON_INLINE void
__Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type,
  PyObject *value, PyObject *tb)
{
PyObject *tmp_type, *tmp_value, *tmp_tb;
_PyErr_StackItem *exc_info = tstate->exc_info;
tmp_type = exc_info->exc_type;
tmp_value = exc_info->exc_value;
tmp_tb = exc_info->exc_traceback;
exc_info->exc_type = type;
exc_info->exc_value = value;
exc_info->exc_traceback = tb;
Py_XDECREF(tmp_type);
Py_XDECREF(tmp_value);
Py_XDECREF(tmp_tb);
}

Cython saves/restores the current exception of tstate. Maybe we need to provide 
a high-level API for that as well?

--

___
Python tracker 

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



[issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with

2022-02-01 Thread Matt Bogosian


Change by Matt Bogosian :


--
keywords: +patch
nosy: +mbogosian
nosy_count: 4.0 -> 5.0
pull_requests: +29243
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31061

___
Python tracker 

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



[issue45953] Statically allocate interpreter states as much as possible.

2022-02-01 Thread miss-islington


miss-islington  added the comment:


New changeset f78be59c83c151d94902daef56218530c52e29e7 by Eric Snow in branch 
'main':
bpo-45953: Preserve backward compatibility on some PyThreadState field names. 
(GH-31038)
https://github.com/python/cpython/commit/f78be59c83c151d94902daef56218530c52e29e7


--
nosy: +miss-islington

___
Python tracker 

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



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-02-01 Thread Guido van Rossum


Guido van Rossum  added the comment:

Time to insist on directly communicating with the Cython team (esp. @scoder) 
and broker some kind of compromise.

--

___
Python tracker 

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



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-02-01 Thread Irit Katriel


Irit Katriel  added the comment:

If this is still the position of cython maintainers:

https://github.com/cython/cython/issues/4581#issuecomment-1016503683

then I will need to revert the change until 3.12.

--

___
Python tracker 

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



[issue46598] ElementTree: wrong XML prolog for the utf-8-sig encoding

2022-02-01 Thread Ned Deily


Change by Ned Deily :


--
nosy: +eli.bendersky, scoder
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



[issue46072] Unify handling of stats in the CPython VM

2022-02-01 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +29242
pull_request: https://github.com/python/cpython/pull/31060

___
Python tracker 

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



[issue46451] Tracing causes module globals to be mutated when calling functions from C

2022-02-01 Thread Sebastian Berg


Sebastian Berg  added the comment:

While I have a repro for Python, I think the pre release of cython already 
fixes it (and I just did not regenerated the C sources when trying, I guess.  A 
`git clean` to the rescue...).

--

___
Python tracker 

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



[issue45925] Upgrade macOS and Windows installers to use SQLite 3.37.2

2022-02-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29241
pull_request: https://github.com/python/cpython/pull/31059

___
Python tracker 

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



[issue45925] Upgrade macOS and Windows installers to use SQLite 3.37.2

2022-02-01 Thread Ned Deily


Ned Deily  added the comment:


New changeset 519eb6ad74f946a9aa7676e2d6579a3a765a8b50 by Ned Deily in branch 
'3.10':
bpo-45925: Update macOS installer to SQLite 3.37.2 (GH-30921) (GH-31057)
https://github.com/python/cpython/commit/519eb6ad74f946a9aa7676e2d6579a3a765a8b50


--

___
Python tracker 

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



[issue46600] Python built with clang -O0 allocates 10x more stack memory than clang -O3 on a Python function call

2022-02-01 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29240
pull_request: https://github.com/python/cpython/pull/31058

___
Python tracker 

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



[issue45925] Upgrade macOS and Windows installers to use SQLite 3.37.2

2022-02-01 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +29239
pull_request: https://github.com/python/cpython/pull/31057

___
Python tracker 

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



[issue46600] Python built with clang -O0 allocates 10x more stack memory than clang -O3 on a Python function call

2022-02-01 Thread STINNER Victor


STINNER Victor  added the comment:

> PR 31052 seems to have broken a bunch of buildbots. If no fix is provided in 
> 24 hours, we will need to revert :(

test_gdb fails if Python is built with clang -Og. I don't think that it's a 
regression. It's just that previously, buildbots using clang only build Python 
with -O0 or -O3.

I'm investigating the test_gdb issue: it's easy to reproduce on Linux (clang 
13.0.0). I may skip test_gdb is Python is built with clang -Og.

--

___
Python tracker 

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



[issue46487] `_SSLProtocolTransport` doesn't have the `get_write_buffer_limits` implementation.

2022-02-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29238
pull_request: https://github.com/python/cpython/pull/31056

___
Python tracker 

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



[issue46487] `_SSLProtocolTransport` doesn't have the `get_write_buffer_limits` implementation.

2022-02-01 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 64568acbd88a88d54ac9b8215447f88280448dd5 by Emiya in branch 
'main':
bpo-46487: Add `get_write_buffer_limits` to Write and _SSLProtocol transports 
(GH-30958)
https://github.com/python/cpython/commit/64568acbd88a88d54ac9b8215447f88280448dd5


--

___
Python tracker 

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



[issue46487] `_SSLProtocolTransport` doesn't have the `get_write_buffer_limits` implementation.

2022-02-01 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue45925] Upgrade macOS and Windows installers to use SQLite 3.37.2

2022-02-01 Thread Ned Deily


Ned Deily  added the comment:


New changeset 0e4bef7a7f6f25a6f39755778c73e7026901611f by Kumar Aditya in 
branch 'main':
bpo-45925: Update macOS installer to SQLite 3.37.2 (GH-30921)
https://github.com/python/cpython/commit/0e4bef7a7f6f25a6f39755778c73e7026901611f


--

___
Python tracker 

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



[issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with

2022-02-01 Thread Matt B

Matt B  added the comment:

Thanks, @kj! Fantastic education and insight! I'm sad that I needed you as an 
interpreter but very grateful you were around to provide the interpretation. 
Working on a patch now….

--

___
Python tracker 

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



[issue46599] Objects/object.c:767:24: runtime error: member access within null pointer of type 'PyObject' (aka 'struct _object')

2022-02-01 Thread Christian Heimes


Christian Heimes  added the comment:

The crash occurs inside marshal module (Python/marshal.c). The marshal module 
is unsafe and cannot safely parse malicious code. Bad marshal code is expected 
to crash the interpreter.

--
nosy: +christian.heimes
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-02-01 Thread Irit Katriel


Irit Katriel  added the comment:

That commit has significant changes in ceval.c and compile.c. They don't need 
to be reverted to unbreak cython.  I'm working on a PR for a simpler change.

Have you tried with CYTHON_USE_EXC_INFO_STACK undefined?

--

___
Python tracker 

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



[issue46451] Tracing causes module globals to be mutated when calling functions from C

2022-02-01 Thread Sebastian Berg


Sebastian Berg  added the comment:

Not reopening for now, but I will note again that (AFAIK) Cython uses 
`PyEval_EvalCodeEx`, and the docs say that it is not used internally to CPython 
anymore.

So it seems pretty plausible that the bug is in `PyEval_EvalCodeEx` and not the 
generated Cython code?

--

___
Python tracker 

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



[issue46180] Button clicked failed when mouse hover tooltip and tooltip destroyed

2022-02-01 Thread Ned Deily


Ned Deily  added the comment:

Can you say which platforms are affected by this? The OP's example appears to 
be from a Windows system. Are Unix (X11) and/or macOS versions of Tk affected, 
too?

--
nosy: +ned.deily

___
Python tracker 

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



[issue46600] Python built with clang -O0 allocates 10x more stack memory than clang -O3 on a Python function call

2022-02-01 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

PR 31052 seems to have broken a bunch of buildbots. If no fix is provided in 24 
hours, we will need to revert :(

--
nosy: +pablogsal

___
Python tracker 

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



[issue46561] Descriptor resolution should own arguments passed to descriptors

2022-02-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

If this can only be triggered from C code, it less of a concern.

The PR increases cost on a critical path, so we ought to be wary of applying it 
unless a known problem is being solved.

Note, this code path has survived two decades of deployment.  Also, the PR 
doesn't have a test to demonstrate that it fixes anything.  Those facts give 
some evidence that the PR has every user paying to solve a problem that almost 
no one actually has.

--
nosy: +rhettinger

___
Python tracker 

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



[issue46451] Tracing causes module globals to be mutated when calling functions from C

2022-02-01 Thread Sebastian Berg


Change by Sebastian Berg :


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



[issue46451] Tracing causes module globals to be mutated when calling functions from C

2022-02-01 Thread Sebastian Berg

Sebastian Berg  added the comment:

Thanks for having a look. I have confirmed this is related to Cython (no 
pandas/NumPy involved) – repro at https://github.com/seberg/bpo46451.  What 
happens under the hood in Cython is probably:

https://github.com/cython/cython/blob/master/Cython/Utility/ObjectHandling.c#L2569-L2611

Which generates `PyEval_EvalCodeEx`, and I could not repro with just a 
`PyObject_FastCallDict`, so I assume Cython is doing something wrong and will 
open an issue there, but if you have a quick tip as to what might wrong, that 
could be nice :).

Otherwise, will just close this, and may reopen if Cython hits a wall.

--

___
Python tracker 

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



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2022-02-01 Thread STINNER Victor


STINNER Victor  added the comment:

Irit Katriel:
> Reverting the whole thing would include big changes in compile.c and ceval.c, 
> so I'd rather avoid that if we can.

It was a good idea to split changes of this issue into multiple commits :-) I'm 
only proposing to revert the one which introduces the C API incompatible 
changes: the commit 396b58345f81d4c8c5a52546d2288e666a1b9b8b "bpo-45711: Remove 
type and traceback from exc_info (GH-30122)".

Maybe Cython can be quickly updated, but the situation seems to be complicated 
:-( https://github.com/cython/cython/issues/4500

--

___
Python tracker 

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



[issue46581] _typevar_types and _paramspec_tvars are missing from _GenericAlias.copy_with

2022-02-01 Thread Ken Jin


Ken Jin  added the comment:

> In short, I will do my best, but I suspect I will need patience and guidance 
> in arriving something acceptable.

Yeah no worries. typing.py is really complex for many historical reasons. I 
still don't grasp all of it and probably never will.

> what about _AnnotatedAlias, _SpecialGenericAlias, _UnionGenericAlias, or 
> _strip_annotations?

They shouldn't need modification. And there's an elegant reason why. Currently 
ParamSpec is only valid in Generic, Callable and Concatenate. We don't care 
about any other types. As long as ParamSpec appears in their __parameters__ and 
the copy_with of those 3 have the correct settings.

Well what about when they're nested? The other types blindly copy over whatever 
they see in __parameters__ of any nested types. So even if you don't pass those 
settings to their copy_with, it doesn't matter (well of course, until someone 
else uses this setting and expands its scope, then proceeds to trip over it :(. 
this seems like a potential trap affecting PEP 646's runtime.)

>>> X = Concatenate[int, ParamSpec('P')]
>>> Container[X]
typing.Container[typing.Concatenate[int, ~P]]
>>> Container[X].copy_with(X).__parameters__
(~P,)
^ Works even though this uses _SpecialGenericAlias, which doesn't properly pass 
in the settings!

> I can't find any tests that deal with copy_with directly, so I'm assuming its 
> use is stressed via higher level code paths, but it's not clear what use 
> cases that method is supposed to serve.

Yeah. If you search for "copy_with" in typing.py. You'll find that it's called 
in __getitem__. Now __getitem__ is used when we subscript an already 
subscripted type. What I mean is:

T = TypeVar('T')
X = List[T] (__class_getitem__ is called, returning a new genericalias object)
X[int] (__getitem__ is called, returning a new genericalias object)

We need copy_with because we want to create a full "copy" of all the args into 
the new GenericAlias object and not face weird problems with mutability. That 
specific use case is tested super often.

> _ConcatenateGenericAlias.copy_with, on the other hand, appears to return a 
> tuple rather than a type until it falls back to the parent implementation. 
> What does one do with that?

Frankly, I was quite lost too until I saw that it was part of bpo-44791, which 
deals with special special (undefined) cases in PEP 612 and Concatenate. 
Basically for a very weird Concatenate, the core dev there has chosen to return 
a tuple of types instead of another type. Let's just ignore those strange tuple 
paths, and only care about the path using the parent implementation.

--

___
Python tracker 

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



  1   2   >