[issue45405] configure fails on macOS with non-Apple clang version 13 which implements --print-multiarch

2022-03-15 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +29987
pull_request: https://github.com/python/cpython/pull/31889

___
Python tracker 

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



[issue45405] configure fails on macOS with non-Apple clang version 13 which implements --print-multiarch

2022-03-15 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +29988
pull_request: https://github.com/python/cpython/pull/31890

___
Python tracker 

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



[issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled.

2022-03-15 Thread Inada Naoki


Inada Naoki  added the comment:

I created another topic relating this issue.
https://discuss.python.org/t/add-legacy-text-encoding-option-to-make-utf-8-default/14281

If we add another option (e.g. legacy_text_encoding), we do not need to change 
UTF-8 mode behavior.

--

___
Python tracker 

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



[issue45405] configure fails on macOS with non-Apple clang version 13 which implements --print-multiarch

2022-03-15 Thread Ned Deily


Ned Deily  added the comment:

As of Xcode 13.3, released 2022-03-14 to support macOS 12.3 et al, the included 
Apple Clang (Apple clang version 13.1.6 (clang-1316.0.21.2)) now supports the  
--print-multiarch option and so Python 3.8 and 3.7 are now vulnerable to this 
issue when building with that version of Xcode or Apple Command Line Tools on 
macOS. While both 3.8 and 3.7 are now in the security-fix-only phase of their 
life cycles and are not fully supported on macOS 12, you should still be able 
to run ./configure without error using the current Apple Developer Tools. PR 
31889 and PR 31890 are backports of this to 3.8 and 3.7. Setting to "release 
blocker" priority for upcoming 3.8 and 3.7 releases.

--
nosy: +lukasz.langa
priority: normal -> release blocker
resolution: fixed -> 
stage: resolved -> commit review
status: closed -> open
versions: +Python 3.7, Python 3.8 -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



[issue45405] configure fails on macOS with non-Apple clang version 13 which implements --print-multiarch

2022-03-15 Thread Ned Deily


Ned Deily  added the comment:


New changeset 720bb456dc711b0776bae837d1f9a0b10c28ddf2 by Ned Deily in branch 
'3.7':
bpo-45405: Prevent internal configure error when running configure with recent 
versions of clang. (GH-28845) (GH-31890)
https://github.com/python/cpython/commit/720bb456dc711b0776bae837d1f9a0b10c28ddf2


--

___
Python tracker 

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



[issue47022] PEP 594: Document removal of asynchat, asyncore and smtpd

2022-03-15 Thread Hugo van Kemenade

New submission from Hugo van Kemenade :

PEP 594 – Removing dead batteries from the standard library

As mentioned in the SC acceptance:

> One thing we’d like to see happen while implementing it: Document the status 
> of the modules being deprecated and removed and backport those deprecation 
> updates to older CPython branch documentation (at least back to 3.9). That 
> gets the notices in front of more people who may use the docs for their 
> specific Python version.

So let's update documentation and deprecation warnings to make clear in which 
release they're to be removed.

This first one is just for the three modules (asynchat, asyncore and smtpd) 
slated for removal soonest, in 3.12:

https://peps.python.org/pep-0594/#deprecated-modules

--
components: Library (Lib)
messages: 415222
nosy: hugovk
priority: normal
severity: normal
status: open
title: PEP 594: Document removal of asynchat, asyncore and smtpd
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



[issue24224] test_msilib is inadequate

2022-03-15 Thread Irit Katriel


Irit Katriel  added the comment:

msilib is deprecated as per PEP 594, so there won't be further enhancements to 
it.

--
resolution:  -> wont fix
stage: needs patch -> 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



[issue47022] PEP 594: Document removal of asynchat, asyncore and smtpd

2022-03-15 Thread Hugo van Kemenade


Change by Hugo van Kemenade :


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

___
Python tracker 

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



[issue43253] asyncio open_connection fails when a socket is explicitly closed

2022-03-15 Thread Maximilian Hils


Change by Maximilian Hils :


--
pull_requests: +29990
pull_request: https://github.com/python/cpython/pull/31892

___
Python tracker 

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



[issue37907] speed-up PyLong_As*() for large longs

2022-03-15 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue43721] Documentation of property.{getter, setter, deleter} fails to mention that a *new* property is returned

2022-03-15 Thread Hugo van Kemenade


Change by Hugo van Kemenade :


--
nosy: +hugovk
nosy_count: 4.0 -> 5.0
pull_requests: +29991
pull_request: https://github.com/python/cpython/pull/31893

___
Python tracker 

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



[issue46996] Drop support of Tcl/Tk older than 8.5.12

2022-03-15 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
components: +Tkinter
nosy: +christian.heimes, epaine, erlendaasland

___
Python tracker 

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



[issue45979] Fix Tkinter tests with old Tk

2022-03-15 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is a great idea. I have opened issue46996 for this.

--

___
Python tracker 

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



[issue47023] re.sub shows key error on regex escape chars provided in repl param

2022-03-15 Thread Siddhesh Sathe


New submission from Siddhesh Sathe :

Python 3.9.10 (main, Jan 15 2022, 18:56:52)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> re.sub(r"{\w}", "\s", "Hello! {user}")
Traceback (most recent call last):
  File "/usr/lib/python3.9/sre_parse.py", line 1039, in parse_template
this = chr(ESCAPES[this][1])
KeyError: '\\s'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.9/re.py", line 210, in sub
return _compile(pattern, flags).sub(repl, string, count)
  File "/usr/lib/python3.9/re.py", line 327, in _subx
template = _compile_repl(template, pattern)
  File "/usr/lib/python3.9/re.py", line 318, in _compile_repl
return sre_parse.parse_template(repl, pattern)
  File "/usr/lib/python3.9/sre_parse.py", line 1042, in parse_template
raise s.error('bad escape %s' % this, len(this))
re.error: bad escape \s at position 0
>>>

--
components: Regular Expressions
messages: 415225
nosy: ezio.melotti, mrabarnett, siddheshsathe
priority: normal
severity: normal
status: open
title: re.sub shows key error on regex escape chars provided in repl param
type: enhancement
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



[issue47024] Update to OpenSSL 1.1.1n

2022-03-15 Thread Christian Heimes


New submission from Christian Heimes :

Update OpenSSL to 1.1.1n and test with OpenSSL 3.0.2. The update will become 
available later today and features a HIGH security bug, 
https://mta.openssl.org/pipermail/openssl-announce/2022-March/000216.html

$ sed -i 's/1.1.1m/1.1.1n/g' Tools/ssl/multissltests.py .azure-pipelines/pr.yml 
.azure-pipelines/ci.yml .github/workflows/build.yml PCbuild/python.props 
PCbuild/get_externals.bat Mac/BuildScript/build-installer.py
$ sed -i 's/3.0.1/3.0.2/g' Tools/ssl/multissltests.py 
.github/workflows/build.yml

--
assignee: christian.heimes
components: Build, Windows, macOS
messages: 415226
nosy: christian.heimes, lukasz.langa, ned.deily, pablogsal, paul.moore, 
ronaldoussoren, steve.dower, tim.golden, zach.ware
priority: release blocker
severity: normal
status: open
title: Update to OpenSSL 1.1.1n
type: security
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



[issue47024] Update to OpenSSL 1.1.1n

2022-03-15 Thread Christian Heimes


Change by Christian Heimes :


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

___
Python tracker 

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



[issue45979] Fix Tkinter tests with old Tk

2022-03-15 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



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

I'm removing 3.11 from the versions field:


$ python3.11 sqlite3_fatal_python_error.py
Exception ignored in: 
Traceback (most recent call last):
  File 
"/Users/erlendaasland/src/cpython-build/sqlite3_fatal_python_error.py", line 
10, in __del__
self.close()

sqlite3.ProgrammingError: SQLite objects created in a thread can only be 
used in that same thread. The object was created in thread id 123145443913728 
and this is thread id 4506211840.

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



[issue46557] Logging captured warnings with a format string unnecessarily groups warnings together

2022-03-15 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset d8066b420b888591f485d132e62979d07abfc3f4 by Michael P. Nitowski 
in branch 'main':
bpo-46557: Log captured warnings without format string (GH-30975)
https://github.com/python/cpython/commit/d8066b420b888591f485d132e62979d07abfc3f4


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue46587] datetime and time tests use non-portable "%4Y" format

2022-03-15 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 2cf7f865f099db11cc6903b334d9c376610313e8 by Christian Heimes in 
branch 'main':
bpo-46587: Skip tests if strftime does not support glibc extension (GH-31873)
https://github.com/python/cpython/commit/2cf7f865f099db11cc6903b334d9c376610313e8


--

___
Python tracker 

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



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

> A perfect repro has been attached, should be run on Linux.

FTR, the repo works on macOS 12.2.1 as well:

$ python3.10 ./sqlite3_fatal_python_error.py
Fatal Python error: PyThreadState_Get: the function must be called with the 
GIL held, but the GIL is released (the current Python thread state is NULL)
Python runtime state: initialized

Thread 0x0001126e7600 (most recent call first):
  File 
"/Users/erlendaasland/src/cpython-build/./sqlite3_fatal_python_error.py", line 
52 in 
zsh: abort  python3.10 ./sqlite3_fatal_python_error.py

--

___
Python tracker 

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



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

> My recommended fix is to call sqlite3_close() within 
> Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS, and manually Py_DECREF all 
> connection-related functions afterward.

3.11 already drops the GIL before sqlite3_close_v2(); backporting this change 
to 3.10 results in the following assertion error:

$ ./python.exe sqlite3_fatal_python_error.py  
Assertion failed: (!_PyMem_IsPtrFreed(tstate->interp)), function 
is_tstate_valid, file ceval.c, line 155.

--

___
Python tracker 

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



[issue43863] [Windows] test_distutils logs: DeprecationWarning: bdist_msi command is deprecated since Python 3.9, use bdist_wheel (wheel packages) instead

2022-03-15 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> test_distutils emits deprecation warning about distutils

___
Python tracker 

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



[issue46884] [doc] msilib.rst uses data directive to document modules

2022-03-15 Thread Irit Katriel


Irit Katriel  added the comment:

msilib is deprecated as per PEP 594, so there won't be further enhancements to 
it.

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



[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger


New submission from Thomas Grainger :

importing a module with bytes in `sys.path` fails with:

  File "", line 182, in _path_isabs
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

(see reproducer in attached demo.py)

however `sys.path` is documented as supporting bytes "Only strings and bytes 
should be added to sys.path; all other data types are ignored during import." 
https://docs.python.org/3/library/sys.html?highlight=Only%20strings%20and%20bytes#sys.path

bytes are allowed in PathFinder._find_spec 
https://github.com/python/cpython/blob/2cf7f865f099db11cc6903b334d9c376610313e8/Lib/importlib/_bootstrap_external.py#L1460-L1462
 but perhaps they should be ignored or explicitly fsdecoded ? 


see also:
https://bugs.python.org/issue32642
https://github.com/python/importlib_metadata/issues/372#issuecomment-1067799424

--
files: demo.py
messages: 415233
nosy: graingert
priority: normal
severity: normal
status: open
title: bytes do not work on sys.path
Added file: https://bugs.python.org/file50678/demo.py

___
Python tracker 

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



[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger


Change by Thomas Grainger :


--
components: +Library (Lib)
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



[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger


Change by Thomas Grainger :


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

___
Python tracker 

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



[issue47025] bytes do not work on sys.path

2022-03-15 Thread Eric V. Smith


Eric V. Smith  added the comment:

In case it helps anyone:

On Windows 3.11.0a5+ the full traceback is:

$ ./python.bat demo.py
Running Debug|x64 interpreter...
Traceback (most recent call last):
  File "...\demo.py", line 23, in 
sys.exit(main())
 ^^
  File "...\Lib\contextlib.py", line 155, in __exit__
self.gen.throw(typ, value, traceback)
^
  File "...\demo.py", line 11, in _tmp_path
yield pathlib.Path(tmp_dir)
^^^
  File "...\demo.py", line 18, in main
import module
^
  File "", line 1178, in _find_and_load
  File "", line 1140, in _find_and_load_unlocked
  File "", line 1080, in _find_spec
  File "", line 1487, in find_spec
  File "", line 1459, in _get_spec
  File "", line 1596, in find_spec
  File "", line 1656, in _fill_cache
TypeError: a bytes-like object is required, not 'str'

And on cygwin 3.8.12:

$ python demo.py
Traceback (most recent call last):
  File "", line 1346, in 
_path_importer_cache
KeyError: b'/tmp/tmprpymgive'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "demo.py", line 23, in 
sys.exit(main())
  File "demo.py", line 18, in main
import module
  File "", line 991, in _find_and_load
  File "", line 971, in _find_and_load_unlocked
  File "", line 914, in _find_spec
  File "", line 1407, in find_spec
  File "", line 1376, in _get_spec
  File "", line 1348, in 
_path_importer_cache
  File "", line 1324, in _path_hooks
  File "", line 1594, in 
path_hook_for_FileFinder
  File "", line 1469, in __init__
  File "", line 177, in _path_isabs
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

--
nosy: +eric.smith

___
Python tracker 

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



[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger


Thomas Grainger  added the comment:

this is a regression from 3.2:

```
Python 3.2.6 (default, Jan 18 2016, 19:21:14) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tempfile
>>> tempfile.TemporaryDirectory()

>>> v = _
>>> tmp_dir = str(v.__enter__())
>>> tmp_dir
'/tmp/tmpd4jzut'
>>> f = open(tmp_dir + "/module.py", "w")
>>> f.write("def function():\nreturn 1\n")
29
>>> f.close()
>>> import sys
>>> sys.path.append(tmp_dir.encode())
>>> import module
>>> module

>>> 
```

--

___
Python tracker 

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



[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger


Thomas Grainger  added the comment:

https://docs.python.org/3/reference/import.html#path-entry-finders says "The 
encoding of bytes entries is determined by the individual path entry finders." 
see 
https://github.com/python/cpython/commit/82c1c781c7ee6496bd4c404b7ba972eed5dbcb12

--

___
Python tracker 

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



[issue40280] Consider supporting emscripten/webassembly as a build target

2022-03-15 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +29994
pull_request: https://github.com/python/cpython/pull/31898

___
Python tracker 

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



[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger


Thomas Grainger  added the comment:

interestingly bytes filenames pointing to zip files on sys.path do support 
bytes (see zipfile_demo.py)

--
Added file: https://bugs.python.org/file50679/zipfile_demo.py

___
Python tracker 

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



[issue47025] bytes do not work on sys.path

2022-03-15 Thread Eryk Sun


Eryk Sun  added the comment:

> this is a regression from 3.2

In Windows, bytes paths in sys.path do not work in 3.2+. I didn't test 3.0 and 
3.1, but practically one can say that bytes paths were never supported in 
Python 3 on Windows.

--
nosy: +eryksun

___
Python tracker 

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



[issue47025] bytes do not work on sys.path

2022-03-15 Thread Thomas Grainger


Thomas Grainger  added the comment:

zipimporter.zipimporter handles non-bytes paths here: 
https://github.com/python/cpython/blob/2cf7f865f099db11cc6903b334d9c376610313e8/Lib/zipimport.py#L65-L67
 I think FileFinder should do the same

--

___
Python tracker 

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



[issue46291] [doc] First argument to raise can also be BaseException

2022-03-15 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled.

2022-03-15 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

FWIW: I don't think the "locale" encoding is a good idea. Instead of
trying to fix this to make it more usable, I'd suggest to deprecate
and remove it again.

When it comes to encodings, explicit is better than implicit.

If an application wants to work with some user defined locale settings,
it's better for the application to decide where to pick the locale
settings from, e.g. the OS, the UI, an application config setting,
etc.

There are too many ways this can be done and trying to build
magic to determine the "right" one is bound to fail in one way or
another.

--
nosy: +lemburg

___
Python tracker 

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



[issue46841] Inline bytecode caches

2022-03-15 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +29996
pull_request: https://github.com/python/cpython/pull/31901

___
Python tracker 

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



[issue47023] re.sub shows key error on regex escape chars provided in repl param

2022-03-15 Thread Eric V. Smith


Eric V. Smith  added the comment:

Isn't '\s' covered by: " Unknown escapes of ASCII letters are reserved for 
future use and treated as errors" 
(https://docs.python.org/3/library/re.html#re.sub)?

--
nosy: +eric.smith

___
Python tracker 

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



[issue31892] ssl.get_server_certificate should allow specifying certificate / key type

2022-03-15 Thread Hanno Boeck


Hanno Boeck  added the comment:

Any update? :-)

--

___
Python tracker 

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



[issue46993] Speed up bytearray creation from list and tuple

2022-03-15 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 6dfe09fc5fd5a3ddc6009d5656e635eae30c5240 by Kumar Aditya in 
branch 'main':
bpo-46993: Speed up bytearray creation from list and tuple (GH-31834)
https://github.com/python/cpython/commit/6dfe09fc5fd5a3ddc6009d5656e635eae30c5240


--
nosy: +asvetlov

___
Python tracker 

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



[issue20392] Inconsistency with uppercase file extensions in MimeTypes.guess_type

2022-03-15 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 5dd7ec52b83e7f239774cf7478106fcc7b0a36f3 by Kumar Aditya in 
branch 'main':
bpo-20392: Fix inconsistency with uppercase file extensions in 
mimetypes.guess_type (GH-30229)
https://github.com/python/cpython/commit/5dd7ec52b83e7f239774cf7478106fcc7b0a36f3


--
nosy: +asvetlov

___
Python tracker 

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



[issue47026] BytesWarning in zipimport paths on sys.path

2022-03-15 Thread Thomas Grainger


New submission from Thomas Grainger :

importing from a bytes zipimport path on sys.path results in a BytesWarning: 
Comparison between bytes and string

running the reproducer with `python -b` shows:
python -b zipfile_demo.py 
:1345: BytesWarning: Comparison between 
bytes and string

see also https://bugs.python.org/issue47025

--
components: Library (Lib)
files: zipfile_demo.py
messages: 415245
nosy: graingert
priority: normal
severity: normal
status: open
title: BytesWarning in zipimport paths on sys.path
versions: Python 3.10, Python 3.11, Python 3.9
Added file: https://bugs.python.org/file50680/zipfile_demo.py

___
Python tracker 

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



[issue8704] cgitb sends a bogus HTTP header if the app crashes before finishing headers

2022-03-15 Thread Colin 't Hart


Colin 't Hart  added the comment:

1. This module is scheduled to be removed by Python 3.13 (although I 
preseonally am of the opinion that it is a useful module and would like to see 
it brought up-to-date).
2. Is reset() even necessary anymore? Can't the same results be achieved with 
CSS since we are in the third decade of the 2000s after all?

--
nosy: +cthart

___
Python tracker 

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



[issue46985] Upgrade ensurepip bundled pip to 22.0.4

2022-03-15 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 7a315d8a0d4df01f96d82286739b86920ccebc05 by Ned Deily in branch 
'3.8':
bpo-46985: Upgrade bundled pip to 22.0.4 (GH-31819) (GH-31851)
https://github.com/python/cpython/commit/7a315d8a0d4df01f96d82286739b86920ccebc05


--

___
Python tracker 

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



[issue45405] configure fails on macOS with non-Apple clang version 13 which implements --print-multiarch

2022-03-15 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset dea270a2a80214de22afadaaca2043d0d782eb7d by Ned Deily in branch 
'3.8':
bpo-45405: Prevent internal configure error when running configure with recent 
versions of clang. (GH-28845) (GH-31889)
https://github.com/python/cpython/commit/dea270a2a80214de22afadaaca2043d0d782eb7d


--

___
Python tracker 

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



[issue45405] configure fails on macOS with non-Apple clang version 13 which implements --print-multiarch

2022-03-15 Thread Ned Deily


Change by Ned Deily :


--
priority: release blocker -> 
resolution:  -> fixed
stage: commit 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



[issue46985] Upgrade ensurepip bundled pip to 22.0.4

2022-03-15 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



[issue46993] Speed up bytearray creation from list and tuple

2022-03-15 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
resolution:  -> fixed
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



[issue20392] Inconsistency with uppercase file extensions in MimeTypes.guess_type

2022-03-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29998
pull_request: https://github.com/python/cpython/pull/31904

___
Python tracker 

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



[issue20392] Inconsistency with uppercase file extensions in MimeTypes.guess_type

2022-03-15 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +29997
pull_request: https://github.com/python/cpython/pull/31903

___
Python tracker 

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



[issue47027] subprocess.run(), subprocess.Popen() should accept file descriptor as cwd parameter

2022-03-15 Thread Yann Droneaud


New submission from Yann Droneaud :

subprocess.run() and subprocess.Popen() accepts a cwd= parameter to change 
directory before running the subprocess.

Unfortunately it's not possible to use a file descriptor to run the subprocess 
in a directory already opened.

For example:

import os
import subprocess
with os.open('/usr/bin', os.O_RDONLY) as f:
subprocess.run(["ls", "-l"], cwd=f, check=True)

fails with

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.9/subprocess.py", line 505, in run
with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1754, in _execute_child
self.pid = _posixsubprocess.fork_exec(

Using a file descriptor instead of path is useful to address TOCTOU issues.

Maybe a mean to convert a file descriptor to a Path-like object would do the 
trick.

--
components: Library (Lib)
messages: 415249
nosy: ydroneaud
priority: normal
severity: normal
status: open
title: subprocess.run(), subprocess.Popen() should accept file descriptor as 
cwd parameter
type: enhancement
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



[issue43253] asyncio open_connection fails when a socket is explicitly closed

2022-03-15 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue43253] asyncio open_connection fails when a socket is explicitly closed

2022-03-15 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 70155412f1543f100d4aa309b8691cbcabd3e0e1 by Maximilian Hils in 
branch 'main':
bpo-43253: Don't call shutdown() for invalid socket handles (GH-31892)
https://github.com/python/cpython/commit/70155412f1543f100d4aa309b8691cbcabd3e0e1


--

___
Python tracker 

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



[issue43253] asyncio open_connection fails when a socket is explicitly closed

2022-03-15 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 10.0 -> 11.0
pull_requests: +2
pull_request: https://github.com/python/cpython/pull/31905

___
Python tracker 

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



[issue43253] asyncio open_connection fails when a socket is explicitly closed

2022-03-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +3
pull_request: https://github.com/python/cpython/pull/31906

___
Python tracker 

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



[issue46907] Update Windows and MacOS installer to SQLite 3.38.1

2022-03-15 Thread Ned Deily


Ned Deily  added the comment:


New changeset ea786a882b9ed4261eafabad6011bc7ef3b5bf94 by Mariusz Felisiak in 
branch 'main':
bpo-46907: Update macOS installer to SQLite 3.38.1. (GH-31656)
https://github.com/python/cpython/commit/ea786a882b9ed4261eafabad6011bc7ef3b5bf94


--

___
Python tracker 

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



[issue20392] Inconsistency with uppercase file extensions in MimeTypes.guess_type

2022-03-15 Thread miss-islington


miss-islington  added the comment:


New changeset 3c4f24face4cca9256ae79bf6968663a04daf655 by Miss Islington (bot) 
in branch '3.10':
bpo-20392: Fix inconsistency with uppercase file extensions in 
mimetypes.guess_type (GH-30229)
https://github.com/python/cpython/commit/3c4f24face4cca9256ae79bf6968663a04daf655


--

___
Python tracker 

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



[issue46896] add support for watching writes to selected dictionaries

2022-03-15 Thread Carl Meyer


Carl Meyer  added the comment:

> There should not be much of a slowdown for this code when watching `CONST`:

How and when (and based on what data?) would the adaptive interpreter make the 
decision that for this code sample the key `CONST`, but not the key `var`, 
should be watched in the module globals dict? It's easy to contrive an example 
in which it's beneficial to watch one key but not another, but this is 
practically irrelevant unless it's also feasible for an optimizer to 
consistently make the right decision about which key(s) to watch.

The code sample also suggests that the module globals dict for a module is 
being watched while that module's own code object is being executed. In module 
body execution, writing to globals (vs reading them) is relatively much more 
common, compared to any other Python code execution context, and it's much less 
common for the same global to be read many times. Given this, how frequently 
would watching module globals dictionaries during module body execution be a 
net win at all? Certainly cases can be contrived in which it would be, but it 
seems unlikely that it would be a net win overall. And again, unless the 
optimizer can reliably (and in advance, since module bodies are executed only 
once) distinguish the cases where it's a win, it seems the example is not 
practically relevant.

> Another use of this is to add watch points in debuggers.
> To that end, it would better if the callback were a Python object.

It is easy to create a C callback that delegates to a Python callable if 
someone wants to implement this use case, so the vectorcall overhead is paid 
only when needed. The core API doesn't need to be made more complex for this, 
and there's no reason to impose any overhead at all on low-level 
interpreter-optimization use cases.

--

___
Python tracker 

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



[issue47022] PEP 594: Document removal of asynchat, asyncore and smtpd

2022-03-15 Thread Barry A. Warsaw


Change by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue43253] asyncio open_connection fails when a socket is explicitly closed

2022-03-15 Thread miss-islington


miss-islington  added the comment:


New changeset 88c243fd8d5a43282ef06bd0872e3b88c68bb856 by Miss Islington (bot) 
in branch '3.10':
bpo-43253: Don't call shutdown() for invalid socket handles (GH-31892)
https://github.com/python/cpython/commit/88c243fd8d5a43282ef06bd0872e3b88c68bb856


--

___
Python tracker 

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



[issue43253] asyncio open_connection fails when a socket is explicitly closed

2022-03-15 Thread miss-islington


miss-islington  added the comment:


New changeset 64a68c39cb508b016e5a4486ebb4052f6e65fca0 by Miss Islington (bot) 
in branch '3.9':
bpo-43253: Don't call shutdown() for invalid socket handles (GH-31892)
https://github.com/python/cpython/commit/64a68c39cb508b016e5a4486ebb4052f6e65fca0


--

___
Python tracker 

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



[issue45923] Improve performance of sys.settracing based tools.

2022-03-15 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +30001
pull_request: https://github.com/python/cpython/pull/31908

___
Python tracker 

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



[issue47028] Incorrect behaviour when zipping a bunch of maps

2022-03-15 Thread John K.


New submission from John K. :

map(f, itr) is supposed to be the lazy way to do [f(val) for val in itr]. 
However, when unpacking and zipping a list of maps, I get a different result 
from when evaluating eagerly. More precisely:

Python 3.10.2 | packaged by conda-forge | (main, Mar  8 2022, 15:53:57) [GCC 
9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> maps = [map(lambda x: x**i, range(7)) for i in range(5)]
>>> for z in zip(*maps):
... print(z)
...
(0, 0, 0, 0, 0)
(1, 1, 1, 1, 1)
(16, 16, 16, 16, 16)
(81, 81, 81, 81, 81)
(256, 256, 256, 256, 256)
(625, 625, 625, 625, 625)
(1296, 1296, 1296, 1296, 1296)
>>> lists = [[x**i for x in range(7)] for i in range(5)]
>>> for z in zip(*lists):
... print(z)
...
(1, 0, 0, 0, 0)
(1, 1, 1, 1, 1)
(1, 2, 4, 8, 16)
(1, 3, 9, 27, 81)
(1, 4, 16, 64, 256)
(1, 5, 25, 125, 625)
(1, 6, 36, 216, 1296)

--
components: Interpreter Core
messages: 415256
nosy: khoodolphin
priority: normal
severity: normal
status: open
title: Incorrect behaviour when zipping a bunch of maps
type: behavior
versions: Python 3.10

___
Python tracker 

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



[issue40280] Consider supporting emscripten/webassembly as a build target

2022-03-15 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +30002
pull_request: https://github.com/python/cpython/pull/31909

___
Python tracker 

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



[issue43253] asyncio open_connection fails when a socket is explicitly closed

2022-03-15 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Thanks!

--
resolution:  -> fixed
status:  -> closed

___
Python tracker 

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



[issue20392] Inconsistency with uppercase file extensions in MimeTypes.guess_type

2022-03-15 Thread miss-islington


miss-islington  added the comment:


New changeset 32ae9ab55f2cd97b5a28d5398c4820d8bc96f30c by Miss Islington (bot) 
in branch '3.9':
bpo-20392: Fix inconsistency with uppercase file extensions in 
mimetypes.guess_type (GH-30229)
https://github.com/python/cpython/commit/32ae9ab55f2cd97b5a28d5398c4820d8bc96f30c


--

___
Python tracker 

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



[issue20392] Inconsistency with uppercase file extensions in MimeTypes.guess_type

2022-03-15 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue40280] Consider supporting emscripten/webassembly as a build target

2022-03-15 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset b43b9b49be7d42d2826106c719d1e51f0776be0a by Christian Heimes in 
branch 'main':
bpo-40280: Skip wakeup_fd pipe tests on Emscripten (GH-31909)
https://github.com/python/cpython/commit/b43b9b49be7d42d2826106c719d1e51f0776be0a


--

___
Python tracker 

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



[issue47028] Incorrect behaviour when zipping a bunch of maps

2022-03-15 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

This is because i is not captured by the function definition. `lambda x: x**i` 
always makes the "input to the ith power" function, never the "input to the 3rd 
power" function, even if i happens to be 3 right now.

Consider replacing `lambda x: x**i` with `lambda x, i=i: x**i` to explicitly 
capture the current value of i as a default.

Changing the scoping rules now would be a big backwards-incompatible change.

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue46896] add support for watching writes to selected dictionaries

2022-03-15 Thread Mark Shannon


Mark Shannon  added the comment:

Let me give you an example.

#module eggs

eggs_var = 0 # a variable, maybe a counter or similar
EGGS_CONST # a constant

#module spam

import eggs

spam_var # Another variable

def foo():
use(eggs.EGGS_CONST)

-

We will want to treat `eggs.EGGS_CONST` as a constant.
To do that we need to be notified if `spam.eggs` or `eggs.EGGS_CONST` changes, 
but we do not want be notified whenever `spam.spam_var` or `eggs.eggs_var` 
changes.

This might not be necessary for us right now, but we will want to implement 
optimizations over larger regions than a single bytecode in 3.12.

--

___
Python tracker 

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



[issue47028] Incorrect behaviour when zipping a bunch of maps

2022-03-15 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

There's an FAQ entry here: 
https://docs.python.org/3/faq/programming.html#why-do-lambdas-defined-in-a-loop-with-different-values-all-return-the-same-result

--

___
Python tracker 

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



[issue46817] Add a line-start table to the code object.

2022-03-15 Thread Irit Katriel


Irit Katriel  added the comment:

I can see the linestarts used in trace.py to figure out coverage. But for this 
duplications don't make a difference (they are deduped in _find_lines_from_code 
anyway), right? 

Where else are they used, such that the current scheme may not work?

--

___
Python tracker 

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



[issue45997] asyncio.Semaphore waiters deque doesn't work

2022-03-15 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
pull_requests: +30003
pull_request: https://github.com/python/cpython/pull/31910

___
Python tracker 

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



[issue46817] Add a line-start table to the code object.

2022-03-15 Thread Mark Shannon


Mark Shannon  added the comment:

sys.settrace line events cannot use the co_lines table. They need additional 
state, as we don't want to trace the same line twice (unless there is a 
backwards jump).

Using the start of a entry in `co_lines` doesn't work when some entries have no 
line number.
E.g.
list(co.co_lines):

(0, 2, 1)
(2, 4, None)
(4, 6, 1)

The instruction @ byte offset 4 starts an entry for line 1, but does not start 
line 1.

--

___
Python tracker 

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



[issue46907] Update Windows and MacOS installer to SQLite 3.38.1

2022-03-15 Thread Steve Dower


Steve Dower  added the comment:


New changeset a8c728b8b742fd8ca5a225f79d99014794b8fdf3 by Mariusz Felisiak in 
branch 'main':
bpo-46907: Update Windows installer to SQLite 3.38.1. (GH-31655)
https://github.com/python/cpython/commit/a8c728b8b742fd8ca5a225f79d99014794b8fdf3


--

___
Python tracker 

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



[issue46907] Update Windows and MacOS installer to SQLite 3.38.1

2022-03-15 Thread Steve Dower


Steve Dower  added the comment:

Was there any reason/need to backport this?

--

___
Python tracker 

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



[issue45923] Improve performance of sys.settracing based tools.

2022-03-15 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 099f75614100e88ed90b68d20a51a8d9c22f81a7 by Mark Shannon in 
branch 'main':
bpo-45923: Decouple suspension of tracing from tracing flag. (GH-31908)
https://github.com/python/cpython/commit/099f75614100e88ed90b68d20a51a8d9c22f81a7


--

___
Python tracker 

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



[issue46896] add support for watching writes to selected dictionaries

2022-03-15 Thread Carl Meyer


Carl Meyer  added the comment:

Thanks for the extended example.

I think in order for this example to answer the question I asked, a few more 
assumptions should be made explicit:

1) Either `spam_var` and/or `eggs_var` are frequently re-bound to new values in 
a hot code path somewhere. (Given the observations above about module-level 
code, we should assume for a relevant example this takes place in a function 
that uses `global spam_var` or `global eggs_var` to allow such rebinding.)

2) But `spam_var` and `eggs_var` are not _read_ in any hot code path anywhere, 
because if they were, then the adaptive interpreter would be just as likely to 
decide to watch them as it is to watch `EGGS_CONST`, in which case any benefit 
of per-key watching in this example disappears. (Keep in mind that with 
possibly multiple watchers around, "unwatching" anything on the dispatch side 
is never an option, so we can't say that the adaptive interpreter would decide 
to unwatch the frequently-re-bound keys after it observes them being re-bound. 
It can  always "unwatch" them in the sense of no longer being interested in 
them in its callback, though.)

It is certainly possible that this case could occur, where some module contains 
both a frequently-read-but-not-written global and also a global that is 
re-bound using `global` keyword in a hot path, but rarely read. But it doesn't 
seem warranted to pre-emptively add a lot of complexity to the API in order to 
marginally improve the performance of this quite specific case, unsupported by 
any benchmark or sample workload demonstrating it.

> This might not be necessary for us right now

I think it's worth keeping in mind that `PyDict_WatchKey` API can always be 
added later without disturbing or changing semantics of the `PyDict_Watch` API 
added here.

--

___
Python tracker 

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



[issue46907] Update Windows and MacOS installer to SQLite 3.38.1

2022-03-15 Thread Ned Deily


Ned Deily  added the comment:

I think we can hold off on deciding whether to backport until at least the next 
round of bugfix releases. I don't know of any pressing reason one way or the 
other, ATM.

--

___
Python tracker 

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



[issue46907] Update Windows and MacOS installer to SQLite 3.38.1

2022-03-15 Thread Erlend E. Aasland

Erlend E. Aasland  added the comment:

Updating to SQLite 3.37 was backported because of a data corruption bug that 
was fixed. AFAIK, there’s nothing like that in 3.38. I would prefer waiting to 
see if more patch releases appear. (That was also my intent, given how many 
patch releases we saw with 3.35; I’ll start using the dont-merge label from now 
on.)

--

___
Python tracker 

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



[issue46907] Update Windows and MacOS installer to SQLite 3.38.1

2022-03-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Closing this tonight, unless someone objects.

--
status: open -> pending

___
Python tracker 

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



[issue47024] Update to OpenSSL 1.1.1n

2022-03-15 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +30004
pull_request: https://github.com/python/cpython/pull/31911

___
Python tracker 

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



[issue47024] Update to OpenSSL 1.1.1n

2022-03-15 Thread Ned Deily


Change by Ned Deily :


--
pull_requests: +30005
pull_request: https://github.com/python/cpython/pull/31912

___
Python tracker 

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



[issue47029] Fix a BrokenPipeError when a multiprocessing.Queue is garbage collected

2022-03-15 Thread Géry

New submission from Géry :

A `BrokenPipeError` exception is raised when the queue thread of a 
`multiprocessing.Queue` still sends enqueued items to the write end of the 
queue pipe *after* the read end of the queue pipe has been [automatically 
closed during its garbage 
collection](https://docs.python.org/3/library/socket.html#socket.socket.close) 
following the garbage collection of the queue (the write end of the queue pipe 
is not garbage collected because it is also referenced by the queue thread):

```
import multiprocessing

def main():
q = multiprocessing.Queue()
q.put(0)

if __name__ == '__main__':
main()
```

--
components: Library (Lib)
messages: 415272
nosy: maggyero
priority: normal
severity: normal
status: open
title: Fix a BrokenPipeError when a multiprocessing.Queue is garbage collected
type: crash
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



[issue47029] Fix a BrokenPipeError when a multiprocessing.Queue is garbage collected

2022-03-15 Thread Géry

Change by Géry :


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

___
Python tracker 

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



[issue47029] Fix a BrokenPipeError when a multiprocessing.Queue is garbage collected

2022-03-15 Thread Géry

Géry  added the comment:

I have attached the following patch: pass a reference to the reader end of the 
queue pipe to the queue thread so that the reader end is not garbage collected 
and closed before the queue thread has sent all the buffered data to the writer 
end.

--

___
Python tracker 

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



[issue47030] singledispatch does not work with positional arguments with default values.

2022-03-15 Thread Randolf Scholz


New submission from Randolf Scholz :

from functools import singledispatch
from typing import Optional

@singledispatch
def load(key: Optional[str] = None, /) -> None:
raise NotImplementedError

@load.register
def _(key: None, /) -> None:
print(f"loaded {key=}") 

@load.register
def _(key: str, /) -> None:
print(f"loaded {key=}")

load()  # TypeError: load requires at least 1 positional argument

--
messages: 415274
nosy: randolf.scholz
priority: normal
severity: normal
status: open
title: singledispatch does not work with positional arguments with default 
values.
type: enhancement
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



[issue47028] Incorrect behaviour when zipping a bunch of maps

2022-03-15 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

https://bugs.python.org/issue45469 is similar. Thanks for the report, but I'll 
go ahead and close this.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue46907] Update Windows and MacOS installer to SQLite 3.38.1

2022-03-15 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


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

___
Python tracker 

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



[issue45997] asyncio.Semaphore waiters deque doesn't work

2022-03-15 Thread Yury Selivanov


Yury Selivanov  added the comment:

Andrew, the same problem exists in asyncio.Queue which is also critical. Here's 
how I fixed it in edgedb code base: 
https://github.com/edgedb/edgedb/blob/08e41341024828df22a01cd690b11fcff00bca5e/edb/server/compiler_pool/queue.py#L51-L74

--

___
Python tracker 

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



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread hydroflask


hydroflask  added the comment:

If you connect with check_same_thread=False, I believe the issue may still 
present itself on 3.11+

--

___
Python tracker 

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



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

> If you connect with check_same_thread=False, I believe the issue may still 
> present itself on 3.11+

Nope, works swell on my Mac. Do you see this on Linux with latest 3.11?

--

___
Python tracker 

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



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread hydroflask


hydroflask  added the comment:

I don't see it immediately but I think it's still possible to happen since all 
the same offending code is in place. There are two reasosn why it probably 
doesn't happen in 3.11+:

1) because something is deferring calling the finalizer for the zero-ref object 
to another thread instead on immediately on the thread that is dying as in 
<=3.10

2) In 3.11+ it is fixed so that PyGILState_Ensure can be called in a sequence 
started by PyGILState_Release. @vstinner is this correct?


If the reason it doesn't happen in 3.11+ is because of 1) then I don't think 
that is specified to happen anywhere and changing the GC in future versions 
could theoretically trigger the same bug. If it is 2) then it is fixed in a 
more robust location.

IMO, the most robust fix is to destroy the function callbacks in 
connection_close() and avoid using the destructor_callback and calling 
PyGILState_Ensure() altogether.

--
nosy: +vstinner

___
Python tracker 

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



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

All callbacks triggered from external libraries must protect Python C API 
calls. You may call it offending, but that is the reality; a callback may 
trigger at any point in time, so we need to make sure the GIL is held before 
calling any Py API. That is also the case for the destructor.

--

___
Python tracker 

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



[issue47024] Update to OpenSSL 1.1.1n

2022-03-15 Thread Ned Deily


Ned Deily  added the comment:


New changeset b6204466c1209de5a0794c475096429fdb457a16 by Ned Deily in branch 
'3.7':
bpo-47024: Update Windows builds and macOS installer build to use OpenSSL 
1.1.1n. (GH-31911)
https://github.com/python/cpython/commit/b6204466c1209de5a0794c475096429fdb457a16


--

___
Python tracker 

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



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

See also bpo-44304

--
nosy: +pablogsal

___
Python tracker 

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



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

See also Petrs msg400205:

> [...] I recommend that any function passed to SQLite (and only those) should
>  - be named `*_callback`, for clarity
>  - acquire the GIL at the very start
>  - release the GIL at the very end

--

___
Python tracker 

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



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread hydroflask


hydroflask  added the comment:

> All callbacks triggered from external libraries must protect Python C API 
> calls. You may call it offending, but that is the reality; a callback may 
> trigger at any point in time, so we need to make sure the GIL is held before 
> calling any Py API. That is also the case for the destructor.

Sure but I'm suggesting sidestepping and not using the destructor_callback 
entirely. You can DECREF the callbacks manually in connection_close() after 
calling sqlite3_close_v2(). Doing this makes sense to me since the destructor 
may be called under special conditions.

--

___
Python tracker 

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



[issue47019] Fatal Python Error in sqlite3 Python 3.10

2022-03-15 Thread hydroflask


hydroflask  added the comment:

If PyGILState_Ensure() has been fixed to become re-entrant during 
PyGILState_Release() in 3.11+ then I believe that change should be backported 
to 3.10. @vstinner would know

--

___
Python tracker 

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



[issue45997] asyncio.Semaphore waiters deque doesn't work

2022-03-15 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Thanks, Yuri. 
I'll take a look.

--

___
Python tracker 

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



  1   2   >