[issue45723] Improve and simplify configure.ac checks

2022-01-07 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 994f90c0772612780361e1dc5fa5223dce22f70a by Christian Heimes in 
branch 'main':
bpo-45723: Fix detection of epoll (#30449)
https://github.com/python/cpython/commit/994f90c0772612780361e1dc5fa5223dce22f70a


--

___
Python tracker 

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



[issue45723] Improve and simplify configure.ac checks

2022-01-07 Thread Christian Heimes


Change by Christian Heimes :


--
priority: release blocker -> normal

___
Python tracker 

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



[issue46281] Python 3.10.1 build errors on Ubuntu 18.04

2022-01-07 Thread Christian Heimes


Christian Heimes  added the comment:

Ubuntu 18.04's OpenSSL is too old and unsupported by 3.10. OpenSSL 1.0.2 is EOL 
since 2019. You either need to update to a more recent version of Ubuntu or 
build your own OpenSSL.

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



[issue46289] AST: FomattedValue conversion's default value should be -1

2022-01-07 Thread Anh71me


New submission from Anh71me :

An unexpected behavior lookup:

```python
>>> ast.FormattedValue(ast.Str('ss')).conversion
>>> ast.unparse(ast.FormattedValue(ast.Str('ss')))
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.9/ast.py", line 1564, in unparse
return unparser.visit(ast_obj)
  File "/usr/local/lib/python3.9/ast.py", line 801, in visit
self.traverse(node)
  File "/usr/local/lib/python3.9/ast.py", line 795, in traverse
super().visit(node)
  File "/usr/local/lib/python3.9/ast.py", line 407, in visit
return visitor(node)
  File "/usr/local/lib/python3.9/ast.py", line 1153, in visit_FormattedValue
self._fstring_FormattedValue(node, self.buffer_writer)
  File "/usr/local/lib/python3.9/ast.py", line 1178, in _fstring_FormattedValue
conversion = chr(node.conversion)
TypeError: an integer is required (got type NoneType)
>>> ast.unparse(ast.FormattedValue(ast.Str('ss'), -1))
'f"{\'ss\'}"'
```

ast.FormattedValue conversion's default value is expected to be -1 but not None

See: https://docs.python.org/3/library/ast.html#ast.FormattedValue

Other:

If certainly, it's also a bug on typeshed.

--
components: Parser
messages: 409955
nosy: iyume, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: AST: FomattedValue conversion's default value should be -1
type: behavior
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



[issue9937] _winreg.EnumValue causes MemoryError

2022-01-07 Thread Eryk Sun


Eryk Sun  added the comment:

> Did anyone reproduce on python3.X? 

In principle, winreg should not have a problem in 3.x because it only uses the 
UTF-16 wide-character API.

--
nosy: +eryksun
stage:  -> 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



[issue46279] [docs] Minor information-ordering issue in __main__ doc

2022-01-07 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +easy

___
Python tracker 

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



[issue46290] Parameter names are inaccurate in dataclasses docs

2022-01-07 Thread Zsolt Dollenstein


New submission from Zsolt Dollenstein :

Parameter names for `asdict`, `astuple`, `is_dataclass`, and `replace` are 
incorrect in the docs. The first parameter for all these is `obj`.

--
assignee: docs@python
components: Documentation
messages: 409957
nosy: docs@python, zsol
priority: normal
severity: normal
status: open
title: Parameter names are inaccurate in dataclasses docs
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



[issue46290] Parameter names are inaccurate in dataclasses docs

2022-01-07 Thread Zsolt Dollenstein


Change by Zsolt Dollenstein :


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

___
Python tracker 

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



[issue46290] Parameter names are inaccurate in dataclasses docs

2022-01-07 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +eric.smith
type:  -> behavior

___
Python tracker 

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



[issue45661] [meta] Freeze commonly used stdlib modules.

2022-01-07 Thread Christian Heimes


Christian Heimes  added the comment:

Deep freezing is not a miracle cure for startup performance issues. Every 
additional frozen module increases the size of the main binary / shared 
library. This can have negative affects for performance and usability, too. For 
WASM builds we want to make the wasm binary as small as possible.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue45661] [meta] Freeze commonly used stdlib modules.

2022-01-07 Thread Kumar Aditya


Kumar Aditya  added the comment:

Can you elaborate a bit about "This can have negative affects for performance" 
as I think freezing modules has only one downside of increasing binary size ?

> For WASM builds we want to make the wasm binary as small as possible.

If WASM would become an officially supported platform then there can be a patch 
to disable freezing on such platforms otherwise I don't see how because of WASM 
we cannot deepfreeze for other platforms which benefit from it.

--

___
Python tracker 

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



[issue46289] AST: FomattedValue conversion's default value should be -1

2022-01-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +BTaskaya

___
Python tracker 

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



[issue19073] Inability to specific __qualname__ as a property on a class instance.

2022-01-07 Thread Irit Katriel


Irit Katriel  added the comment:

This is the check that is preventing qualname being a property:

https://github.com/python/cpython/blob/994f90c0772612780361e1dc5fa5223dce22f70a/Objects/typeobject.c#L2853

Note that it is not the same check used for assignment, which is here:

https://github.com/python/cpython/blob/994f90c0772612780361e1dc5fa5223dce22f70a/Objects/typeobject.c#L559


I think some unit tests are missing for properties, they would need to be added.

--
nosy: +iritkatriel, vstinner
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



[issue46246] importlib.metadata.DeprecatedList appears to be missing __slots__

2022-01-07 Thread Arie Bovenberg


Change by Arie Bovenberg :


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

___
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-01-07 Thread Gregor Titze


New submission from Gregor Titze :

The Python Tutorial describes the first argument to the raise statement as 
follows:

"""
This must be either an exception instance or an exception class (a class that 
derives from Exception).
"""
https://docs.python.org/3/tutorial/errors.html#raising-exceptions

However, the Python Language Reference states, that exceptions should be a 
subclass or instance of BaseException.
https://docs.python.org/3/reference/simple_stmts.html#grammar-token-python-grammar-raise_stmt

I think it would be correct, to adapt the Tutorial to match the Reference.

--
assignee: docs@python
components: Documentation
messages: 409961
nosy: docs@python, gtitze
priority: normal
severity: normal
status: open
title: [doc] First argument to raise can also be BaseException
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

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



[issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression)

2022-01-07 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 12.0 -> 13.0
pull_requests: +28657
pull_request: https://github.com/python/cpython/pull/30453

___
Python tracker 

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



[issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression)

2022-01-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28658
pull_request: https://github.com/python/cpython/pull/30454

___
Python tracker 

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



[issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression)

2022-01-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b127e70a8a682fe869c22ce04c379bd85a00db67 by Erlend Egeberg 
Aasland in branch 'main':
bpo-46070: Fix asyncio initialisation guard (GH-30423)
https://github.com/python/cpython/commit/b127e70a8a682fe869c22ce04c379bd85a00db67


--

___
Python tracker 

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



[issue46292] Add microseconds to logging.LogRecord

2022-01-07 Thread James Casbon


New submission from James Casbon :

LogRecord makes microseconds available via the msecs attribute.  This patch 
adds microseconds via usecs attribute.

Some regulators (eg MIFID II) require accuracy greater than 1ms in some 
industries.

This patch calls time_ns rather than time so that the usecs and msecs are 
calculated from int types and then gets the original ct attribute via division.

--
files: usecs.patch
keywords: patch
messages: 409963
nosy: jamescasbon
priority: normal
severity: normal
status: open
title: Add microseconds to logging.LogRecord
Added file: https://bugs.python.org/file50546/usecs.patch

___
Python tracker 

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



[issue46292] Add microseconds to logging.LogRecord

2022-01-07 Thread James Casbon


Change by James Casbon :


--
components: +Library (Lib)
type:  -> enhancement

___
Python tracker 

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



[issue40479] Port _hashlib to OpenSSL 3.0.0

2022-01-07 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +28659
pull_request: https://github.com/python/cpython/pull/30455

___
Python tracker 

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



[issue46288] Migrating python 2.7 to 3.6 using 2to3 tool

2022-01-07 Thread Eric V. Smith


Eric V. Smith  added the comment:

Porting questions don't belong on the bug tracker. And we don't support 2.7 any 
more, in any event.

You'll need to find python 3 versions of all of your packages. Unfortunately we 
can't help you with that.

There used to be a python-porting mailing list, but it's been deleted. Maybe 
someone on the the python-list mailing list could point you in the right 
direction.

--
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: compile error -> behavior

___
Python tracker 

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



[issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression)

2022-01-07 Thread miss-islington


miss-islington  added the comment:


New changeset 9d18045804f6db8224be14f7a618b77977f90144 by Miss Islington (bot) 
in branch '3.10':
bpo-46070: Fix asyncio initialisation guard (GH-30423)
https://github.com/python/cpython/commit/9d18045804f6db8224be14f7a618b77977f90144


--

___
Python tracker 

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



[issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression)

2022-01-07 Thread miss-islington


miss-islington  added the comment:


New changeset 4d2cfd354969590ba8e0af0447fd84f8b5e61952 by Miss Islington (bot) 
in branch '3.9':
bpo-46070: Fix asyncio initialisation guard (GH-30423)
https://github.com/python/cpython/commit/4d2cfd354969590ba8e0af0447fd84f8b5e61952


--

___
Python tracker 

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



[issue46293] Typo in specifying escape sequence

2022-01-07 Thread Preetham Nanjappa


New submission from Preetham Nanjappa :

See section "2.4.1. String and Bytes literals" of 3.10.1 documentation.
https://docs.python.org/3.10/reference/lexical_analysis.html#string-and-bytes-literals

Escape Sequence table. First line.

`\newline` should have been `\n`

--
assignee: docs@python
components: Documentation
messages: 409967
nosy: docs@python, ilovedexter
priority: normal
severity: normal
status: open
title: Typo in specifying escape sequence
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



[issue46281] Python 3.10.1 build errors on Ubuntu 18.04

2022-01-07 Thread Bob Rivoir


Bob Rivoir  added the comment:

According to synaptic, I have openssl 1.1.1-1ubuntu2.1~18.04-14 installed.  On 
the openssl.org site they mention that this version doesn't eol till 2023.  
Shouldn't this still work?  Or does python require the 3.0 version?

--

___
Python tracker 

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



[issue42032] Setting PYTHONPYCACHEPREFIX using ~ (tilde) creates a "~" folder

2022-01-07 Thread Petr Viktorin

Petr Viktorin  added the comment:

> It would perhaps be useful if the os.path.expanduser call was added in the 
> cache_from_source() function in importlib?

No: that would mean Python would be doing work that the shell should do. 
Possibly it would be duplicating the work. Possibly it would be doing it wrong. 
What if your shell uses ⌂ rather than ~? What if the shell has a different idea 
of what the home directory is? Remember, you can use Python with any shell, not 
just Unix/POSIX command-line ones (which is what os.path.expanduser emulates).

Thanks for reporting the issue, though! The separation of concerns definitely 
isn't obvious at first.

--
nosy: +petr.viktorin
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



[issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression)

2022-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

Even with PR 30454, I can still reproduce the crash on Python 3.9 (randomly, it 
takes a few attempts to reproduce the crash):

vstinner@DESKTOP-DK7VBIL C:\vstinner\python\3.9>python -X dev 
win_py399_crash_reproducer.py 
Running Debug|x64 interpreter...
exit subinterpreter
exit subinterpreter
exit subinterpreter
Windows fatal exception: access violation

Thread 0x2230 (most recent call first):


Thread 0x2124 (most recent call first):
  File "C:\vstinner\python\3.9\win_py399_crash_reproducer.py", line 13 in doIt
  File "C:\vstinner\python\3.9\lib\threading.py", line 910 in run
  File "C:\vstinner\python\3.9\lib\threading.py", line 973 in _bootstrap_inner
  File "C:\vstinner\python\3.9\lib\threading.py", line 930 in _bootstrap

Current thread 0x27f0 (most recent call first):
  File "C:\vstinner\python\3.9\win_py399_crash_reproducer.py", line 13 in doIt
  File "C:\vstinner\python\3.9\lib\threading.py", line 910 in run
  File "C:\vstinner\python\3.9\lib\threading.py", line 973 in _bootstrap_inner
  File "C:\vstinner\python\3.9\lib\threading.py", line 930 in _bootstrap

Thread 0x1c18 (most recent call first):
  File "C:\vstinner\python\3.9\lib\threading.py", line 312 in wait
  File "C:\vstinner\python\3.9\lib\threading.py", line 574 in wait
  File "C:\vstinner\python\3.9\lib\threading.py", line 897 in start
  File "C:\vstinner\python\3.9\win_py399_crash_reproducer.py", line 19 in 


--

___
Python tracker 

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



[issue46293] Typo in specifying escape sequence

2022-01-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

No, it is a backslash following by a newline.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue46293] Typo in specifying escape sequence

2022-01-07 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Serhiy is correct. The table is correct, \n can be found further down the 
table, the first entry is backslash newline, as it says.

--
nosy: +steven.daprano
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



[issue46290] Parameter names are inaccurate in dataclasses docs

2022-01-07 Thread Eric V. Smith


Change by Eric V. Smith :


--
assignee: docs@python -> eric.smith

___
Python tracker 

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



[issue46294] Integer overflow & Int values loaded into Bool detected via Libfuzzer & UndefinedBehaviorSanitizer

2022-01-07 Thread Steven Wirsz


New submission from Steven Wirsz :

Compiling source from github on January 6, 2022, detected via Libfuzzer  & 
UndefinedBehaviorSanitizer:


# ./fuzz_struct_unpack crash-a0d.txt 
Running: crash-a0d.txt

/src/cpython3/Modules/_struct.c:509:28: runtime error: load of value 128, which 
is not a valid value for type '_Bool'

Python/pyhash.c:396:9: runtime error: unsigned integer overflow: 
1726337582519137 + 1455368869671451682 cannot be represented in type 
'unsigned long'

Python/pyhash.c:414:5: runtime error: unsigned integer overflow: 
6843264283216330929 + 16329705011411640967 cannot be represented in type 
'unsigned long'

Python/pyhash.c:417:5: runtime error: unsigned integer overflow: 
13747253807228978341 + 10396395245414858527 cannot be represented in type 
'unsigned long'

Python/pyhash.c:418:5: runtime error: unsigned integer overflow: 
17173606624272818715 + 4069551840979798976 cannot be represented in type 
'unsigned long'

Python/pyhash.c:419:5: runtime error: unsigned integer overflow: 
12388162105911730119 + 9634611433502982398 cannot be represented in type 
'unsigned long'

Objects/longobject.c:288:22: runtime error: unsigned integer overflow: 0 - 
18446744073709550595 cannot be represented in type 'unsigned long'

Objects/longobject.c:4872:31: runtime error: unsigned integer overflow: 
18446744073709551615 + 1 cannot be represented in type 'unsigned long'

Objects/longobject.c:3124:33: runtime error: unsigned integer overflow: 0 - 1 
cannot be represented in type 'unsigned int'

Objects/longobject.c:3130:33: runtime error: unsigned integer overflow: 0 - 1 
cannot be represented in type 'unsigned int'

Objects/tupleobject.c:426:21: runtime error: unsigned integer overflow: 
219911203979059663 * 14029467366897019727 cannot be represented in type 
'unsigned long'

Objects/tupleobject.c:428:13: runtime error: unsigned integer overflow: 
14367201699383568926 * 11400714785074694791 cannot be represented in type 
'unsigned long'

Objects/tupleobject.c:426:13: runtime error: unsigned integer overflow: 
1835114336222707 + 1497884194698650478 cannot be represented in type 
'unsigned long'

Objects/tupleobject.c:432:9: runtime error: unsigned integer overflow: 
18406138070188819878 + 2870177450013471924 cannot be represented in type 
'unsigned long'

Python/traceback.c:247:86: runtime error: unsigned integer overflow: 
18446744073709551615 * 2 cannot be represented in type 'unsigned long'

Objects/frameobject.c:51:72: runtime error: unsigned integer overflow: 
18446744073709551615 * 2 cannot be represented in type 'unsigned long'

--
files: crash-a0d.txt
messages: 409973
nosy: swirsz
priority: normal
severity: normal
status: open
title: Integer overflow & Int values loaded into Bool detected via Libfuzzer & 
UndefinedBehaviorSanitizer
type: crash
versions: Python 3.11
Added file: https://bugs.python.org/file50547/crash-a0d.txt

___
Python tracker 

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



[issue41370] PEP 585 and ForwardRef

2022-01-07 Thread Niklas Rosenstein


Niklas Rosenstein  added the comment:

I'm running into this issue right now. Can anyone provide a rationale as to why 
you think this is acceptable/expected behaviour? Do we expect developers to 
semi-rely on get_type_hints(), but than still having to manually resolve 
forward references in PEP585 generic aliases? That seems broken to me.

Thanks,
Niklas R.

--
nosy: +n_rosenstein

___
Python tracker 

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



[issue46295] Subinterpreters hang in GIL adquisition if an extension module calls PyGILState_Ensure.

2022-01-07 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

Reproducer:

Code for native_ext.cpp:

#define PY_SSIZE_T_CLEAN
#include 

#include 
#include 
#include 

#pragma GCC push_options
#pragma GCC optimize ("O0")

PyObject*
run_simple(PyObject*, PyObject*)
{
PyGILState_STATE gstate;
gstate = PyGILState_Ensure();
PyGILState_Release(gstate);
Py_RETURN_NONE;
}

static PyMethodDef methods[] = {
{"run_simple", run_simple, METH_NOARGS, "Execute a chain of native 
functions"},
{NULL, NULL, 0, NULL},
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef moduledef = {PyModuleDef_HEAD_INIT, "native_ext", "", 
-1, methods};

PyMODINIT_FUNC
PyInit_native_ext(void)
{
return PyModule_Create(&moduledef);
}
#else
PyMODINIT_FUNC
initnative_ext(void)
{
Py_InitModule("native_ext", methods);
}
#endif

Code for setup.py:

import os
from distutils.core import Extension
from distutils.core import setup

ROOT = os.path.realpath(os.path.dirname(__file__))

setup(
name="native_ext",
version="0.0",
ext_modules=[
Extension(
"native_ext",
language="c++",
sources=[os.path.join(ROOT, "native_ext.cpp")],
),
],
zip_safe=False,
)

Compile extension:

python setup.py build_ext --inplace 

Execute the following script:

from test.support import run_in_subinterp
run_in_subinterp("""
import sys
sys.path.append(".")
import native_ext
native_ext.run_simple()
""")

The script deadlocks

--
messages: 409975
nosy: eric.snow, pablogsal, vstinner
priority: normal
severity: normal
status: open
title: Subinterpreters hang in GIL adquisition if an extension module calls 
PyGILState_Ensure.
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



[issue46294] Integer overflow & Int values loaded into Bool detected via Libfuzzer & UndefinedBehaviorSanitizer

2022-01-07 Thread Mark Dickinson

Mark Dickinson  added the comment:

@swirsz: Thanks for the report.

Most of these look like false positives: we're intentionally making use of C's 
unsigned arithmetic behaviour. Note that these are technically *not* overflows. 
As the C standard itself says, in C99 §6.2.5, paragraph 9:

> A computation involving unsigned operands can never overflow,
> because a result that cannot be represented by the resulting
> unsigned integer type is reduced modulo the number that is one
> greater than the largest value that can be represented by the
> resulting type. 

.. and we're deliberately depending on exactly that well-defined reduction 
behaviour.

Would you be able to do a first pass over the results and identify those that 
might be genuine issues, worthy of further investigation?

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue38735] PYTHONPYCACHEPREFIX fails when importing a module from the root ("/")

2022-01-07 Thread Petr Viktorin


Change by Petr Viktorin :


--
keywords: +patch
nosy: +petr.viktorin
nosy_count: 2.0 -> 3.0
pull_requests: +28660
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30456

___
Python tracker 

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



[issue38735] PYTHONPYCACHEPREFIX fails when importing a module from the root ("/")

2022-01-07 Thread Petr Viktorin


Petr Viktorin  added the comment:

Here's a patch, but testing it would require putting a file in the root 
directory. I don't dare do that from the test suite. Is one-time manual testing 
OK here?

--

___
Python tracker 

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



[issue46294] Integer overflow & Int values loaded into Bool detected via Libfuzzer & UndefinedBehaviorSanitizer

2022-01-07 Thread Steven Wirsz


Steven Wirsz  added the comment:

Closing this report.  I investigated the remaining issue and it looks like a 
perfectly valid call to PyBool_FromLong:

/src/cpython3/Modules/_struct.c:509:28: runtime error: load of value 128, which 
is not a valid value for type '_Bool'

static PyObject *
nu_bool(_structmodulestate *state, const char *p, const formatdef *f)
{
_Bool x;
memcpy((char *)&x, p, sizeof x);
return PyBool_FromLong(x != 0);
}

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



[issue46293] Typo in specifying escape sequence

2022-01-07 Thread Zachary Ware


Zachary Ware  added the comment:

The table could stand some clarification; `\newline` is the only example that 
is not showing exactly the characters that one would see when looking at source 
code and which doesn't have an explanatory note.  There's also the additional 
wrinkle that `\CR`, `\LF`, and `\CRLF` are treated the same, which might be an 
important detail in the reference section.

I don't have a great suggestion to offer, though.

--
nosy: +zach.ware

___
Python tracker 

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



[issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression)

2022-01-07 Thread STINNER Victor

STINNER Victor  added the comment:

> The problematic change could be (d0d29655ff) affecting import.c

This change is part of the 3.10 branch. For 3.9, git bisect tells me that it's 
the following change:

commit 52d9d3b75441ae6038fadead89eac5eecdd34501
Author: Łukasz Langa 
Date:   Tue Oct 5 22:30:25 2021 +0200

[3.9] bpo-44050: Extension modules can share state when they don't support 
sub-interpreters. (GH-27794) (GH-28741)

(cherry picked from commit b9bb74871b27d9226df2dd3fce9d42bda8b43c2b)

Co-authored-by: Hai Shi 


The problem is that this change fixed another bug, well, see: bpo-44050. While 
a revert should fix win_py399_crash_reproducer.py, it will reintroduce 
bpo-44050 bug.

--

___
Python tracker 

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



[issue46281] Python 3.10.1 build errors on Ubuntu 18.04

2022-01-07 Thread Christian Heimes


Christian Heimes  added the comment:

You seem to have OpenSSL 1.0.2 headers installed somewhere on your computer. 
Python's configure script and build system uses these headers instead of the 
system headers from libssl-dev.

--

___
Python tracker 

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



[issue46289] AST: FomattedValue conversion's default value should be -1

2022-01-07 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

ASDL technically allows it to be None though neither compiler nor ast.unparse 
can work with it at this moment. 

> FormattedValue(expr value, int? conversion, expr? format_spec)
https://github.com/python/cpython/blob/b127e70a8a682fe869c22ce04c379bd85a00db67/Parser/Python.asdl#L78

>>> import ast
>>> tree = ast.parse("f'{x + 1}'")
>>> tree.body[0].value.values[0].conversion = None
>>> compile(tree, "", "exec")
Traceback (most recent call last):
  File "", line 1, in 
SystemError: Unrecognized conversion character 0

We can either:
A) change ASDL to reflect it is an integer (since it always has been treated 
that way)
B) Support this on both the compiler as well as in the ast.unparse

I'd say A, since this was always broken. @pablogsal @lys.nikolaou WDYT?

--

___
Python tracker 

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



[issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression)

2022-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

I reverted manually the commit 52d9d3b75441ae6038fadead89eac5eecdd34501 (in my 
local Python 3.9 checkout): I confirm that the revert fix the  
win_py399_crash_reproducer.py crash in Python 3.9.

--

___
Python tracker 

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



[issue46292] Add microseconds to logging.LogRecord

2022-01-07 Thread Ned Deily


Change by Ned Deily :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression)

2022-01-07 Thread Petr Viktorin


Petr Viktorin  added the comment:

> The problem is that this change fixed another bug, well, see: bpo-44050. 
> While a revert should fix win_py399_crash_reproducer.py, it will reintroduce 
> bpo-44050 bug.

bpo-44050 is an attempt to fix a regression introduced in bpo-38858, perhaps 
that regression should be reverted as well?

--

___
Python tracker 

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



[issue46289] AST: FomattedValue conversion's default value should be -1

2022-01-07 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

I agree that A is probably the way to go.

--

___
Python tracker 

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



[issue46289] AST: FomattedValue conversion's default value should be -1

2022-01-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I think A is the best option

--

___
Python tracker 

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



[issue46295] Subinterpreters hang in GIL adquisition if an extension module calls PyGILState_Ensure.

2022-01-07 Thread Eric Snow


Eric Snow  added the comment:

Is this a duplicate of bpo-15751?  (also see bpo-10915)

--

___
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-01-07 Thread Nikita Sobolev


Nikita Sobolev  added the comment:

I think that this is intentional: tutorial gives some very basic ideas about 
what can be raised. Giving the whole context (you can `raise` two kinds of 
errors: `Exception` and `BaseException`, but they are different, should be used 
in different cases, and they are caught differently). Probably most users don't 
need to subclass `BaseException` at all.

And if they need to: there are docs for that 
https://docs.python.org/3/library/exceptions.html#BaseException

In my opinion - nothing should be changed there :)

--
nosy: +sobolevn

___
Python tracker 

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



[issue46292] Add microseconds to logging.LogRecord

2022-01-07 Thread Vinay Sajip


Change by Vinay Sajip :


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



[issue46296] Unreachable condition: `if enum_class._member_type_ is object`

2022-01-07 Thread Nikita Sobolev


New submission from Nikita Sobolev :

This condition can never be `True`: 
https://github.com/python/cpython/blob/b127e70a8a682fe869c22ce04c379bd85a00db67/Lib/enum.py#L222-L223

Why? Because: 
1. It is executed only when `if not enum_class._use_args_:`: 
https://github.com/python/cpython/blob/b127e70a8a682fe869c22ce04c379bd85a00db67/Lib/enum.py#L215
2. But, `enum_class._use_args_` will always be `False` for cases when 
`enum_class._member_type_` is `object`
3. It is defined here: 
https://github.com/python/cpython/blob/b127e70a8a682fe869c22ce04c379bd85a00db67/Lib/enum.py#L937

So, I guess that removing this condition can simplify the `enum.py`.
Coverage shows that this part is not tested.

I will send a PR shortly.

--
components: Library (Lib)
messages: 409989
nosy: sobolevn
priority: normal
severity: normal
status: open
title: Unreachable condition: `if enum_class._member_type_ is object`
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



[issue46296] Unreachable condition: `if enum_class._member_type_ is object`

2022-01-07 Thread Nikita Sobolev


Change by Nikita Sobolev :


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

___
Python tracker 

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



[issue46295] Subinterpreters hang in GIL adquisition if an extension module calls PyGILState_Ensure.

2022-01-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue46295] Subinterpreters hang in GIL adquisition if an extension module calls PyGILState_Ensure.

2022-01-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Yeah, this is indeed related/duplicate of bpo-15751

--

___
Python tracker 

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



[issue46295] Subinterpreters hang in GIL adquisition if an extension module calls PyGILState_Ensure.

2022-01-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
superseder:  -> [subinterpreters] Make the PyGILState API compatible with 
subinterpreters

___
Python tracker 

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



[issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression)

2022-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

In the 3.9 branch, the commit 4d2cfd354969590ba8e0af0447fd84f8b5e61952 fixed 
the _asyncio extension. win_py399_crash_reproducer.py still branch on Windows 
in the 3.9 branch. The code can be simplified with:

code = "import _sre"

Moreover, even if I modify PyInit__sre() to only call PyModule_Create(), it 
does still crash. I can still reproduce the crash with the following simplified 
_sre.c code:
---
static PyMethodDef _functions[] = {
_SRE_COMPILE_METHODDEF
{NULL, NULL}
};

static struct PyModuleDef sremodule = {
PyModuleDef_HEAD_INIT,
"_" SRE_MODULE,
NULL,
-1,
_functions,
NULL,
NULL,
NULL,
NULL
};

PyMODINIT_FUNC PyInit__sre(void)
{
return PyModule_Create(&sremodule);
}
---

If _SRE_COMPILE_METHODDEF is removd from _functions, the script no longer crash.

Is there something specific about method objects? Is it safe to share them 
between multiple interpreters? See my message msg408662 which gives some 
details.

--

___
Python tracker 

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



[issue46216] spurious link to os.system() from os.times() documentation entry

2022-01-07 Thread miss-islington


miss-islington  added the comment:


New changeset 9b7aa6a9d678ba798c57fa5bbc800014dfe4fb91 by Irit Katriel in 
branch 'main':
bpo-46216: remove spurious link to os.system() from os.time() documentation 
(GH-30326)
https://github.com/python/cpython/commit/9b7aa6a9d678ba798c57fa5bbc800014dfe4fb91


--
nosy: +miss-islington

___
Python tracker 

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



[issue46216] spurious link to os.system() from os.times() documentation entry

2022-01-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28662
pull_request: https://github.com/python/cpython/pull/30459

___
Python tracker 

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



[issue46216] spurious link to os.system() from os.times() documentation entry

2022-01-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28663
pull_request: https://github.com/python/cpython/pull/30460

___
Python tracker 

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



[issue46217] 3.11 build failure on Win10: new _freeze_module changes?

2022-01-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Let me be clearer. This bug prevents me from building main (3.11) to test 
anything with a proper up-to-date 3.11 binary.  So to me this is highest 
priority.  Is this just my machine or every Windows system?  How are CI and 
buildbots rebuilding and running?  Is there some workaround I need to add?  Use 
newer VC (and change devguide)?

--
priority: normal -> release blocker
stage:  -> backport needed
type:  -> compile error

___
Python tracker 

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



[issue46227] add pathlib.Path.walk method

2022-01-07 Thread Éric Araujo

Éric Araujo  added the comment:

The idea is interesting, and I agree that glob with a maxi wildcard is not a 
great solution.  There is discussion on the PR about adding walk vs extending 
iterdir; could you post a message on discuss.python.org and sum up the the 
discussion?  (Pull requests on the CPython repo are only used to discuss 
implementation, not for debating ideas or proposing features.)

--
nosy: +eric.araujo

___
Python tracker 

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



[issue15751] [subinterpreters] Make the PyGILState API compatible with subinterpreters

2022-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

The bpo-46295 was marked as a duplicate of this issue.

--

___
Python tracker 

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



[issue46264] 'I'.lower() should give non dotted i for LANG=tr_TR

2022-01-07 Thread Éric Araujo

Éric Araujo  added the comment:

I suppose the casefold method does not help?
https://docs.python.org/3.10/library/stdtypes.html#str.casefold

--
nosy: +eric.araujo

___
Python tracker 

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



[issue46279] [docs] Minor information-ordering issue in __main__ doc

2022-01-07 Thread Éric Araujo

Éric Araujo  added the comment:

Do you have a suggestion on how to fix this?

--
nosy: +eric.araujo

___
Python tracker 

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



[issue24650] Error in yield expression documentation

2022-01-07 Thread Irit Katriel


Change by Irit Katriel :


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



[issue24650] Error in yield expression documentation

2022-01-07 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue24650] Error in yield expression documentation

2022-01-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28665
pull_request: https://github.com/python/cpython/pull/30462

___
Python tracker 

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



[issue24650] Error in yield expression documentation

2022-01-07 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 273cb8e7577d143830404f6779946a0bedb58758 by Jacob Walls in branch 
'main':
bpo-24650: Use full term "generator function" in yield expressions docs 
(GH-24663)
https://github.com/python/cpython/commit/273cb8e7577d143830404f6779946a0bedb58758


--
nosy: +iritkatriel

___
Python tracker 

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



[issue46282] print() docs do not indicate its return value

2022-01-07 Thread Éric Araujo

Change by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

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



[issue46216] spurious link to os.system() from os.times() documentation entry

2022-01-07 Thread miss-islington


miss-islington  added the comment:


New changeset 6630952cf0955d205e48874a53b69868c97b8875 by Miss Islington (bot) 
in branch '3.10':
bpo-46216: remove spurious link to os.system() from os.time() documentation 
(GH-30326)
https://github.com/python/cpython/commit/6630952cf0955d205e48874a53b69868c97b8875


--

___
Python tracker 

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



[issue46220] imaplib.py "select" mailbox names containing spaces.

2022-01-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I presume you mean the mailbox parameter of imaplib.IMAP.select().
https://docs.python.org/3/library/imaplib.html#imaplib.IMAP4.select

IMAP4.select(mailbox='INBOX', readonly=False)

Select a mailbox. Returned data is the count of messages in mailbox (EXISTS 
response). The default mailbox is 'INBOX'. If the readonly flag is set, 
modifications to the mailbox are not allowed.

Enhancements only go into future releases.  Please make sure that the current 
main branch does not have the feature you are requesting. 

Neither our doc nor https://datatracker.ietf.org/doc/html/rfc2060.html contain 
'2822', so you might be requesting something not supported.

There is no active maintainer for this module, so response from someone 
familiar with imaplib may take awhile.

--
nosy: +terry.reedy
versions: +Python 3.11 -Python 3.6

___
Python tracker 

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



[issue46223] asyncio cause infinite loop during debug

2022-01-07 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
components: +asyncio
nosy: +asvetlov, yselivanov

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


Irit Katriel  added the comment:

If you scroll up, you can see that BaseException was mentioned above:

"All exceptions inherit from BaseException, and so it can be used to serve as a 
wildcard"

so I don't think it will add confusion to fix this. And it will be more 
accurate.

Gregor, would you like to submit a patch?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue24650] Error in yield expression documentation

2022-01-07 Thread miss-islington


miss-islington  added the comment:


New changeset 8bc68140cbe8230cf048bc04faf927c1413066d1 by Miss Islington (bot) 
in branch '3.9':
bpo-24650: Use full term "generator function" in yield expressions docs 
(GH-24663)
https://github.com/python/cpython/commit/8bc68140cbe8230cf048bc04faf927c1413066d1


--

___
Python tracker 

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



[issue46216] spurious link to os.system() from os.times() documentation entry

2022-01-07 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset c55616cf936bd8497d9ff321c03f7379f5f78a0e by Miss Islington (bot) 
in branch '3.9':
bpo-46216: remove spurious link to os.system() from os.time() documentation 
(GH-30326) (GH-30460)
https://github.com/python/cpython/commit/c55616cf936bd8497d9ff321c03f7379f5f78a0e


--

___
Python tracker 

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



[issue24650] Error in yield expression documentation

2022-01-07 Thread miss-islington


miss-islington  added the comment:


New changeset 75a1865d1ce352909ad9a30d001486bbd7d3ed75 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-24650: Use full term "generator function" in yield expressions docs 
(GH-24663) (GH-30461)
https://github.com/python/cpython/commit/75a1865d1ce352909ad9a30d001486bbd7d3ed75


--

___
Python tracker 

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



[issue46216] spurious link to os.system() from os.times() documentation entry

2022-01-07 Thread Irit Katriel


Change by Irit Katriel :


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



[issue24650] Error in yield expression documentation

2022-01-07 Thread Irit Katriel


Change by Irit Katriel :


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



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

2022-01-07 Thread Andre Roberge


Andre Roberge  added the comment:

In https://docs.python.org/3/library/exceptions.html#Exception, it is written:

"All built-in, non-system-exiting exceptions are derived from this class. All 
user-defined exceptions should also be derived from this class."

Yes, technically, the root of all exceptions is BaseException. However, this 
seems to indicate that the advice given in the tutorial is correct.

--
nosy: +aroberge

___
Python tracker 

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



[issue42209] Incorrect line reported in syntax error

2022-01-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Arian-f's new issue is #46237.

--
nosy: +terry.reedy
superseder:  -> Incorrect line reported in syntax error

___
Python tracker 

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



[issue46237] Incorrect line reported in syntax error

2022-01-07 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue46237] Incorrect line reported in syntax error

2022-01-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Since #42209 was closed, a new issue seems OK.

As a result of the incorrect line number, IDLE highlights one of the opening 
quotes on line 1.

--
nosy: +pablogsal, terry.reedy -eric.smith
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



[issue46237] Incorrect line reported in syntax error

2022-01-07 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
stage:  -> needs patch

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


Irit Katriel  added the comment:

Andre, I don't follow. The OP is reporting an issue with a line about raising 
exceptions. Why is it correct to advise us to raise only Exception subclasses?

--

___
Python tracker 

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



[issue46237] Incorrect line reported in syntax error

2022-01-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +eric.smith

___
Python tracker 

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



[issue46237] Incorrect line reported in syntax error

2022-01-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This also affects 3.9 I imagine, no?

--

___
Python tracker 

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



[issue46070] [subinterpreters] asyncio crash when importing _asyncio in subinterpreter (Python 3.8 regression)

2022-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

The _sre crash has a complex history in the 3.9 branch:

* (1) 2019-11-20, commit 7247407c35330f3f6292f1d40606b7ba6afd5700: first CRASH! 
The parent commit (488d02a24142948bfb1fafd19fa48e61fcbbabc5) doesn't crash.
* (2) 2019-11-22, commit 82c83bd907409c287a5bd0d0f4598f2c0538f34d: no crash 
(fix/workaround the crash)
* (3) 2021-10-05, commit 52d9d3b75441ae6038fadead89eac5eecdd34501: crash again! 
(somehow revert the previous fix/workaround the crash, but fix another bug)

It seems like the initial regression comes from this change:

commit 7247407c35330f3f6292f1d40606b7ba6afd5700
Author: Victor Stinner 
Date:   Wed Nov 20 12:25:50 2019 +0100

bpo-36854: Move _PyRuntimeState.gc to PyInterpreterState (GH-17287)

* Rename _PyGC_InitializeRuntime() to _PyGC_InitState()
* finalize_interp_clear() now also calls _PyGC_Fini() in
  subinterpreters (clear the GC state).

--

___
Python tracker 

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



[issue46292] Add microseconds to logging.LogRecord

2022-01-07 Thread Vinay Sajip


Vinay Sajip  added the comment:

Thanks for the patch. We're need to get contributors to sign a Contributor 
License Agreement (CLA) before we can accept their patches. Would you be 
willing to do this? The process could be smoother, but it's not too bad, and 
here's where you get started:

https://www.python.org/psf/contrib/contrib-form/

--

___
Python tracker 

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



[issue46285] http/server.py wont respect its protocol_version

2022-01-07 Thread Éric Araujo

Éric Araujo  added the comment:

Hello and thanks for the report!

Could you tell more about what you’re trying to achieve?


Some notes:

You are not meant to change the code of provided modules, but to instantiate 
classes with the right parameters, or subclass in your own code to change how 
some methods work.

Supporting HTTP 1/1 is not just changing the protocol string, but also about 
supporting the actual behaviours defined in the 1.1 spec!

If the module has a parameter for version and it doesn’t work, then you can 
report a bug.  If there is no such parameter, you can open a feature request to 
ask for HTTP 1.1 support.

--
nosy: +eric.araujo

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


Irit Katriel  added the comment:

There are other issues in this doc:

1. The paragraph starting with "The except clause may specify a variable after 
the exception name.." appears after this face was used in an example. It should 
move up.

2. In the User-defined Exceptions Section, there is a link to the Classes 
tutorial in the beginning "(See Classes for more about Python classes)", and 
another one at the end, "More information on classes it presented in chapter 
Classes". The second one can be removed.

--

___
Python tracker 

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



[issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression)

2022-01-07 Thread STINNER Victor


Change by STINNER Victor :


--
title: [subinterpreters] asyncio crash when importing _asyncio in 
subinterpreter (Python 3.8 regression) -> [subinterpreters] crash when 
importing _sre in subinterpreters in parallel (Python 3.9 regression)

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


Change by Irit Katriel :


--
versions:  -Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue46237] Incorrect line reported in syntax error

2022-01-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
keywords: +patch
pull_requests: +28666
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/30463

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


Change by Irit Katriel :


--
keywords: +easy

___
Python tracker 

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



[issue46070] [subinterpreters] crash when importing _sre in subinterpreters in parallel (Python 3.9 regression)

2022-01-07 Thread STINNER Victor


STINNER Victor  added the comment:

This bug is hard to reproduce for different reasons:

* It occurs randomly: I need between 1 and 50 attempts to reproduce the bug 
using win_py399_crash_reproducer.py

* So far, the bug was only reproduced on Windows.

* I failed to reproduce the crash on Linux. I tried PYTHONMALLOC=malloc and 
PYTHONMALLOC=malloc_debug with and without 
LD_PRELOAD=/usr/lib64/libjemalloc.so.2 (jemalloc memory allocator).

* The _sre extension has been converted to multi-phase init in Python 3.10. 
"import _sre" is no longer enough to reproduce the crash on Python 3.10 and 
newer.

--

___
Python tracker 

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



[issue46285] http/server.py wont respect its protocol_version

2022-01-07 Thread Éric Araujo

Éric Araujo  added the comment:

I understand your report better after looking at the code.

There is indeed a protocol_version parameter in the test function (which is 
really a main function, not test), that sets the protocol attribute on the 
passed handler class.  (The class attribute is changed, which seems like a 
bug!)  The BaseHTTPRequestHandler class does have support for HTTP 1.1 (adds 
automatic keep-alive).

So if we ignore the distraction that OP changed the source code, and imaging 
instead that they called `test(protocol="HTTP/1.1")`, then there would be a bug 
if the requests went out as HTTP/1.0.

Hugo, can you attach a minimal reproducer?  (a python script as small as 
possible to show the problem — don’t edit code in http.server but call the 
http.server.test function with your own code)

--

___
Python tracker 

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



[issue46217] 3.11 build failure on Win10: new _freeze_module changes?

2022-01-07 Thread Steve Dower


Steve Dower  added the comment:

Only a newer WinSDK, which is not in any way a significant change to the 
resulting build and so isn't part of the "spec" as it were.

But we'll remove the use of this flag once someone has the time to make a PR.

(Remember to add the RM when you declare something a release blocker or the 
release may not be blocked.)

--
nosy: +pablogsal

___
Python tracker 

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



[issue28546] [doc] Clarify setting pdb breakpoints

2022-01-07 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue28546] [doc] Clarify setting pdb breakpoints

2022-01-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28668
pull_request: https://github.com/python/cpython/pull/30465

___
Python tracker 

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



[issue28546] [doc] Clarify setting pdb breakpoints

2022-01-07 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 6d07a9fb7cb31433c376a1aa20ea32001da0a418 by Hugo van Kemenade in 
branch 'main':
bpo-28546: [doc] Clarify setting pdb breakpoints (GH-30360)
https://github.com/python/cpython/commit/6d07a9fb7cb31433c376a1aa20ea32001da0a418


--

___
Python tracker 

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



  1   2   >