[issue46305] SyntaxError when using dict key in fstring

2022-01-07 Thread Samisafool


New submission from Samisafool :

SyntaxError when using dict key in fstring

Attached is a python file where this bug is visible.
The error is different on CPython 3.8 and 3.9/3.10, interestingly.
Occurs on CPython 3.8-10 and PyPy 3.8 7.3.7

Not sure which component to select, never filed a python bug report before. 
Hopefully this is correct.

--
components: Interpreter Core
files: test.py
messages: 410079
nosy: Samisafool
priority: normal
severity: normal
status: open
title: SyntaxError when using dict key in fstring
type: crash
versions: Python 3.10, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file50550/test.py

___
Python tracker 

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



[issue46304] Unable to iterate over lines in a file without a block of code

2022-01-07 Thread Eric V. Smith


Eric V. Smith  added the comment:

Hi, Jason.

How about:

>>> from pathlib import Path
>>> Path("foo.txt").read_text().splitlines()
['how', 'now', 'brown', 'cow']

Not the most elegant thing, I'll admit.

--
nosy: +eric.smith

___
Python tracker 

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



[issue46299] Improve several exception handling practices in `test_descr.py`

2022-01-07 Thread miss-islington


miss-islington  added the comment:


New changeset d2245cf190c36a6d74fe947bf133ce09d3313a6f by Miss Islington (bot) 
in branch '3.10':
bpo-46299: improve `test_descr.py` with stricter error handling (GH-30471)
https://github.com/python/cpython/commit/d2245cf190c36a6d74fe947bf133ce09d3313a6f


--

___
Python tracker 

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



[issue46299] Improve several exception handling practices in `test_descr.py`

2022-01-07 Thread miss-islington


miss-islington  added the comment:


New changeset 566d70a8d1c1afb8e770068f1686f762a1e343b9 by Miss Islington (bot) 
in branch '3.9':
bpo-46299: improve `test_descr.py` with stricter error handling (GH-30471)
https://github.com/python/cpython/commit/566d70a8d1c1afb8e770068f1686f762a1e343b9


--

___
Python tracker 

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



[issue46303] _Py_stat and _Py_wstat using incorrect type for status argument

2022-01-07 Thread Paul Campbell


Change by Paul Campbell :


--
title: _Py_stat using incorrect type for status argument -> _Py_stat and 
_Py_wstat using incorrect type for status argument

___
Python tracker 

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



[issue46303] _Py_stat using incorrect type for status argument

2022-01-07 Thread Paul Campbell


Change by Paul Campbell :


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

___
Python tracker 

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



[issue46299] Improve several exception handling practices in `test_descr.py`

2022-01-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28680
pull_request: https://github.com/python/cpython/pull/30477

___
Python tracker 

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



[issue46299] Improve several exception handling practices in `test_descr.py`

2022-01-07 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue46303] _Py_stat using incorrect type for status argument

2022-01-07 Thread Paul Campbell


Change by Paul Campbell :


--
components: +Build, Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
type:  -> compile error

___
Python tracker 

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



[issue46304] Unable to iterate over lines in a file without a block of code

2022-01-07 Thread Jason R. Coombs


New submission from Jason R. Coombs :

I'd like to be able to do something pretty fundamental: lazily load lines from 
a file in a single expression.

Best I can tell, that's not possible in the language without triggering 
warnings.

One can use 'open' but that triggers a ResourceWarning:

```
$ $PYTHONWARNINGS='error' python -c "lines = open('/dev/null'); tuple(lines)"
Exception ignored in: <_io.FileIO name='/dev/null' mode='rb' closefd=True>
ResourceWarning: unclosed file <_io.TextIOWrapper name='/dev/null' mode='r' 
encoding='UTF-8'>
```

One can use a `with` statement, but that requires a block of code and can't be 
written easily in a single expression. One can use 
`pathlib.Path.read_text().splitlines()`, but that loads the whole file into 
memory.

This issue affected the pip-run project, which required 5 new lines in order to 
make such an expression possible 
(https://github.com/jaraco/pip-run/commit/e2f395d8814539e1da467ac09295922d8ccaf14d).

Can the standard library supply a function or method that would provide this 
behavior?

--
components: Library (Lib)
messages: 410075
nosy: jaraco
priority: normal
severity: normal
status: open
title: Unable to iterate over lines in a file without a block of code
versions: Python 3.11

___
Python tracker 

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



[issue46299] Improve several exception handling practices in `test_descr.py`

2022-01-07 Thread Dong-hee Na


Change by Dong-hee Na :


--
pull_requests: +28678
pull_request: https://github.com/python/cpython/pull/30475

___
Python tracker 

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



[issue46299] Improve several exception handling practices in `test_descr.py`

2022-01-07 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset e63066cfed27511c9b786d61761f87f7a532571a by Nikita Sobolev in 
branch 'main':
bpo-46299: improve `test_descr.py` with stricter error handling (GH-30471)
https://github.com/python/cpython/commit/e63066cfed27511c9b786d61761f87f7a532571a


--
nosy: +corona10

___
Python tracker 

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



[issue46235] Do all ref-counting at once for sequence multiplication

2022-01-07 Thread Tim Peters


Change by Tim Peters :


--
assignee:  -> Dennis Sweeney
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



[issue46303] _Py_stat using incorrect type for status argument

2022-01-07 Thread Paul Campbell


New submission from Paul Campbell :

While attempting to embed the full cpython source in my application, I found 
that during compilation on Windows, there was a compilation issue due to struct 
stat not being defined. Taking a look at the file cpython/fileutils.h, it seems 
that the type of the status argument should be _Py_stat_struct instead of just 
stat to satisfy compilation for all supported platforms.

--
messages: 410073
nosy: pacampbell
priority: normal
severity: normal
status: open
title: _Py_stat using incorrect type for status argument
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



[issue46235] Do all ref-counting at once for sequence multiplication

2022-01-07 Thread Tim Peters


Tim Peters  added the comment:


New changeset ad1d5908ada171eff768291371a80022bfad4f04 by Dennis Sweeney in 
branch 'main':
bpo-46235: Do all ref-counting at once during list/tuple multiplication 
(GH-30346)
https://github.com/python/cpython/commit/ad1d5908ada171eff768291371a80022bfad4f04


--
nosy: +tim.peters

___
Python tracker 

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



[issue46300] zlib.compress level and wbits args are shown as keyword-only in the documentation

2022-01-07 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

I forgot that '/' marks end of positional-only args, not keyword-only.

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



[issue46226] User specific paths added to System PATH environment variable

2022-01-07 Thread Eryk Sun


Eryk Sun  added the comment:

Were you upgrading an existing installation of Python 3.10? Did it actually 
install in "C:\Program Files\Python310"? Is Python currently installed in 
per-user "%LocalAppData%\Programs\Python\Python310"? Was it ever installed 
there?

--
nosy: +eryksun

___
Python tracker 

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



[issue46301] Enum tests: One branch is not covered in `Enum._convert_`

2022-01-07 Thread Ethan Furman


Ethan Furman  added the comment:

Alex, thanks for nosying me.  Go ahead and make Enum issues assigned to me as 
well.  :-)

--

___
Python tracker 

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



[issue46301] Enum tests: One branch is not covered in `Enum._convert_`

2022-01-07 Thread Ethan Furman


Change by Ethan Furman :


--
assignee:  -> ethan.furman

___
Python tracker 

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



[issue46287] UNC path normalisation issues on Windows

2022-01-07 Thread Eryk Sun


Eryk Sun  added the comment:

> _Py_abspath/_getfullpathname does not always call GetFullPathNameW on 3.11.

Also, PathCchSkipRoot() doesn't recognize forward slash as a path separator, so 
_Py_isabs() is wrong in many cases compared to the same path that uses 
backslash as the path separator.

For example, _Py_isabs() wrongly returns false in the following cases, so 
GetFullPathNameW() is called, and ironically the misbehavior of _Py_isabs() 
leads to the correct result.

>>> os.path.abspath('//spam//eggs. . .')
'spam\\eggs'
>>> os.path.abspath('C:/spam. . .')
'C:\\spam'
>>> os.path.abspath('C:/nul')
'.\\nul'

_Py_isabs() returns true in the following cases, so only normpath() is called:

>>> os.path.abspath(r'\\spam\\eggs. . .')
'spameggs. . .'
>>> os.path.abspath('C:\\spam. . .')
'C:\\spam. . .'
>>> os.path.abspath('C:\\nul')
'C:\\nul'

As the above shows, normpath() doesn't remove trailing dots and spaces from the 
last component of a path, and it doesn't special case DOS devices in the last 
component of a drive-letter path. The latter is still implemented for the NUL 
device in Windows 11 and implemented for all DOS devices in Windows 8.1 and 10 
(e.g. CON, CONIN$, CONOUT$, AUX, PRN, COM<1-9>, LPT<1-9>).

I would prefer to remove the _Py_isabs() check from _Py_abspath() in Windows, 
unless there's a strong case for startup performance, in which case I'd prefer 
to revert the change to nt._getfullpathname() and only use _Py_abspath() during 
startup.

--

___
Python tracker 

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



[issue46301] Enum tests: One branch is not covered in `Enum._convert_`

2022-01-07 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +ethan.furman
title: One branch is not covered in `Enum._convert_` -> Enum tests: One branch 
is not covered in `Enum._convert_`

___
Python tracker 

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



[issue46302] IndexError inside list comprehension + workaround

2022-01-07 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Your functions test1 and test2 are irrelevant to the bug report. The driver 
code using eval() to pick which function to call is unneeded. The business of 
simulating a file is complexity for no purpose.

Those ignore, count, unique functions are also irrelevant.

Removing all the irrelevant and extraneous complexity that obfuscates the 
problem, we get to two lines of simplified code sufficient to demonstrate the 
issue:

each = "name = "
[code.strip()[0] for func, code in [each.split('=')]]

which sure enough raises IndexError.

The hint was looking at your fix() function, which made it clear that you are 
getting an IndexError because the string is an empty string. Well of course you 
do, that is expected behaviour.

Why do you get an empty string? Because you split the line "name = " on the 
equals sign, giving

func = "name "
code = " "

then you strip the whitespace from code giving:

code = ""

then you try to extract the first character of code using code[0], which raises 
IndexError, because that's what it is supposed to do.

So there is no bug here, Python is working correctly.

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



[issue46302] IndexError inside list comprehension + workaround

2022-01-07 Thread Stefan Pochmann


Stefan Pochmann  added the comment:

The error occurs when you do code.strip()[0] when code is " ", not "u2".

--
nosy: +Stefan Pochmann

___
Python tracker 

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



[issue46226] User specific paths added to System PATH environment variable

2022-01-07 Thread Aleksandr Krymskiy


Aleksandr Krymskiy  added the comment:

I did not find install logs in my user %TEMP% or C:\Windows\Temp. I did select 
"install for all users" during setup just like I always do, but I did not 
override the default location of "C:\Program Files\Python310". I attached 
screenshots of the options selected during setup.

--
Added file: https://bugs.python.org/file50549/py_install_options.png

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

Make a PR and we can then tweak it via code reviews, it will be easier.

--

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

Thank you.  Compiles without even any warnings.  Tests also all pass.

--

___
Python tracker 

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



[issue46302] IndexError inside list comprehension + workaround

2022-01-07 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

> it returns IndexError (instead of "u") if used in a list comprehension

Works as expected inside a list comprehension:

>>> var = "u2"
>>> [var.strip()[0] for i in range(2)]
['u', 'u']

>>> ["ok" for i in range(2) if var.strip()[0] == "u"]
['ok', 'ok']


I am 99.99% certain that you have a bug in your code, but your code is so 
complicated that it is not obvious at a glance where the bug is. I am strongly 
tempted to just close this as "Works for me" and tell you to come back and 
re-open the bug report when you have isolated the issue to a simpler case, but 
I will resist the temptation for now.

--
nosy: +steven.daprano

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


Change by miss-islington :


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

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


New changeset 6fa8b2ceee38187b0ae96aee12fe4f0a5c8a2ce7 by Pablo Galindo Salgado 
in branch 'main':
bpo-46237: Fix the line number of tokenizer errors inside f-strings (GH-30463)
https://github.com/python/cpython/commit/6fa8b2ceee38187b0ae96aee12fe4f0a5c8a2ce7


--

___
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


Gregor Titze  added the comment:

Irit:

I would move the paragraph starting with "The except clause may specify a 
variable after the exception name ..." and the following example before the 
paragraph starting with "All exceptions inherit from BaseException, and so it 
can be used to serve as a wildcard ..."

Or did you have another position in mind?

--

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

I did some testing on my own using a code generator and a bunch of weird cases 
and I am confident this works. I am going to include this in the next alpha but 
will wait for your validation for some days before merging the backports.

--

___
Python tracker 

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



[issue46006] [subinterpreter] _PyUnicode_EqualToASCIIId() issue with subinterpreters

2022-01-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
priority: release blocker -> 

___
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


Change by Steve Dower :


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



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

2022-01-07 Thread Steve Dower


Steve Dower  added the comment:


New changeset d81182b8ec3b1593daf241d44757a9fa68fd14cc by Steve Dower in branch 
'main':
bpo-46217: Revert use of Windows constant that is newer than what we support 
(GH-30473)
https://github.com/python/cpython/commit/d81182b8ec3b1593daf241d44757a9fa68fd14cc


--

___
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


Gregor Titze  added the comment:

Andre:

You mention that user-defined exceptions should inherit from Exception. This is 
totally right and explicitly stated just a bit later in 8.6 on the same page of 
the tutorial. I think this perfectly covers this concern .

However, the paragraph I refer to explains the raise statement and as stated in 
the reference, the raise statement must be followed by a class or instance 
derived from BaseException. Thus, I think it would just be accurate and people 
reading on don't stumble over this difference as I did.

Regarding the mentioned wildcard: I think it wouldn't be a real wildcard 
anymore if it didn't catch ALL exceptions. Anyway the tutorial states that it 
needs to be used with extreme caution and the example re-raises the error.

Irit:

Yes I am happy provide a patch. I would also correct the other two issues you 
mentioned.

--

___
Python tracker 

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



[issue46287] UNC path normalisation issues on Windows

2022-01-07 Thread neonene


neonene  added the comment:

Regarding https://github.com/python/cpython/pull/30362#issuecomment-1005496892

_Py_abspath/_getfullpathname does not always call GetFullPathNameW on 3.11.

Python 3.10.1
>>> nt._getfullpathname('.\\C:spameggs. . .')
'.\\C:\\spam\\eggs'

Python 3.11.0a3
>>> nt._getfullpathname('.\\C:spameggs. . .')
'.\\C:spameggs. . .'

--
nosy: +neonene

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

Please Andre and Terry, test this fix as much as you want. I am quite sure is 
correct, but it is far-reaching so I want to make sure every situation that we 
can think of is correct (and remains correct).

--

___
Python tracker 

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



[issue46302] IndexError inside list comprehension + workaround

2022-01-07 Thread Pierre Fortin


New submission from Pierre Fortin :

var = "u2"
var.strip()[0] 
Works as expected, except that it returns IndexError (instead of "u") if used 
in a list comprehension -- at least, that's where I found it.  Attached example 
script illustrates the issue.
Call it with "mytest N" where N is 1 (fails), 2 (works), 3 (fails).
mytest 1 -- KeyError expected; this was due to infile design change
adding a digit to previously single char code
mytest 2 -- workaround to actual issue in next test
mytest 3 -- adding [0] fails when used in list comprehension

--
components: Interpreter Core
files: mytest
messages: 410054
nosy: NetAlien
priority: normal
severity: normal
status: open
title: IndexError inside list comprehension + workaround
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file50548/mytest

___
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


Change by Steve Dower :


--
keywords: +patch
pull_requests: +28676
stage: backport needed -> patch review
pull_request: https://github.com/python/cpython/pull/30473

___
Python tracker 

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



[issue46301] One branch is not covered in `Enum._convert_`

2022-01-07 Thread Nikita Sobolev


Change by Nikita Sobolev :


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

___
Python tracker 

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



[issue46301] One branch is not covered in `Enum._convert_`

2022-01-07 Thread Nikita Sobolev


New submission from Nikita Sobolev :

This branch is never covered: 
https://github.com/python/cpython/blob/c9dc1f491e8edb0bc433cde73190a3015d226891/Lib/enum.py#L831

I will send a PR in a moment :)

--
components: Tests
messages: 410053
nosy: sobolevn
priority: normal
severity: normal
status: open
title: One branch is not covered in `Enum._convert_`
type: behavior
versions: Python 3.11

___
Python tracker 

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



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

2022-01-07 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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



[issue46142] python --help output is too long

2022-01-07 Thread Éric Araujo

Éric Araujo  added the comment:

I hard forgotten this bit in the email thread:

Serhiy: What do you think about -hh (and maybe —help-full) printing full help?

Guidp: Is there enough of a use case for this to bother?

Barry: Maybe not.  I’d say if it was easy to implement, why not, but if it’s a 
pain, don't bother.


The option parsing code is easy to edit, and the function would only need to 
call the other usage functions with a blank line inbetween.  Should I add it?

--

___
Python tracker 

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



[issue46297] Python interpreter crashes on bootup with multiple PythonPaths set in registry

2022-01-07 Thread Steve Dower


Change by Steve Dower :


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



[issue46300] zlib.compress level and wbits args are shown as keyword-only in the documentation

2022-01-07 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
components: +Library (Lib)

___
Python tracker 

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



[issue46300] zlib.compress level and wbits args are shown as keyword-only in the documentation

2022-01-07 Thread Andrei Kulakov


New submission from Andrei Kulakov :

zlib.compress level and wbits args are shown as keyword-only in the 
documentation, however they are accepted as positional without error.

Should the docs or the code be fixed?

--
messages: 410051
nosy: andrei.avk
priority: low
severity: normal
status: open
title: zlib.compress level and wbits args are shown as keyword-only in the 
documentation
type: behavior
versions: Python 3.11

___
Python tracker 

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



[issue46299] Improve several exception handling practices in `test_descr.py`

2022-01-07 Thread Nikita Sobolev


Change by Nikita Sobolev :


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

___
Python tracker 

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



[issue46299] Improve several exception handling practices in `test_descr.py`

2022-01-07 Thread Nikita Sobolev


New submission from Nikita Sobolev :

There are several problems in `test_descr.py` that I've found:
1. In `test_dir` there's a test case that ensure that `TypeError` is raised in 
some case: 
https://github.com/python/cpython/blame/c9dc1f491e8edb0bc433cde73190a3015d226891/Lib/test/test_descr.py#L2548-L2551
 But it never does anything if this error is not raised. So, this test can 
contain a possible problem inside. It will just skip a scenario where 
`TypeError` is not thrown.

2. The same with `test_file_failt` here: 
https://github.com/python/cpython/blame/c9dc1f491e8edb0bc433cde73190a3015d226891/Lib/test/test_descr.py#L4451-L4456
 If `RuntimeError` is not thrown - nothing happens

3. `assert 0, ...` is problematic: 
https://github.com/python/cpython/blame/c9dc1f491e8edb0bc433cde73190a3015d226891/Lib/test/test_descr.py#L4451-L4456
 It can be dropped in optimized mode and it's error message is not ideal

I will send a PR with all these problems fixed.

--
components: Tests
messages: 410050
nosy: sobolevn
priority: normal
severity: normal
status: open
title: Improve several exception handling practices in `test_descr.py`
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



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

2022-01-07 Thread miss-islington


miss-islington  added the comment:


New changeset bea3f42bb7c360921f864949ef7472a7ecb02cd3 by Miss Islington (bot) 
in branch '3.10':
bpo-46289: Make conversion of FormattedValue not optional on ASDL (GH-30467)
https://github.com/python/cpython/commit/bea3f42bb7c360921f864949ef7472a7ecb02cd3


--

___
Python tracker 

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



[issue46297] Python interpreter crashes on bootup with multiple PythonPaths set in registry

2022-01-07 Thread Steve Dower


Steve Dower  added the comment:

Thanks for the report and the PR!

--
assignee:  -> steve.dower

___
Python tracker 

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



[issue46297] Python interpreter crashes on bootup with multiple PythonPaths set in registry

2022-01-07 Thread Steve Dower


Steve Dower  added the comment:


New changeset c9dc1f491e8edb0bc433cde73190a3015d226891 by Daniel in branch 
'main':
bpo-46297: Fix interpreter crash on startup with multiple PythonPaths set in 
registry (GH-30466)
https://github.com/python/cpython/commit/c9dc1f491e8edb0bc433cde73190a3015d226891


--

___
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 Barry A. Warsaw


Barry A. Warsaw  added the comment:

> Barry: The PEP 8 'return None' recommendation could be added to the Reference 
> entry for 'return'.  But I think this should be a separate issue as 1) it is 
> about coding rather than documentation and 2) there is the possible objection 
> that choosing completely explicit 'return None' versus half explicit, half 
> implicit 'return' and the latter versus completely implicit  
> should be left to the style PEP.

I do think it's a question of style.  Section 7.6 of the language reference 
says:

> If an expression list is present, it is evaluated, else None is substituted.

which is the important concept that beginners should learn.

I agree that the admonition in PEP 8 is really trying to say "don't mix 
implicit and explicit return styles".  Implicit None return is fine if all exit 
paths are implicit.  But once you add an explicit value to a return path, all 
return paths should use explicit values, including those that return None.

IME, while I do occasionally encounter push back on this when doing reviews, 
most folks come around to this p.o.v.

--

___
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


Change by Terry J. Reedy :


--
nosy: +pablogsal

___
Python tracker 

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



[issue42378] logging reopens file with same mode, possibly truncating

2022-01-07 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset e35430bec528dfb1a653cd457ea58b5a08543632 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-42378: fixed log truncation on logging shutdown (GH-27310) (GH-30468)
https://github.com/python/cpython/commit/e35430bec528dfb1a653cd457ea58b5a08543632


--

___
Python tracker 

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



[issue46205] test.libregrtest: Race condition in runtest_mp leads to hangs (never exits)

2022-01-07 Thread Sam Gross


Change by Sam Gross :


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

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


Change by miss-islington :


--
pull_requests: +28672
pull_request: https://github.com/python/cpython/pull/30469

___
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 would say yes, for consistency. It doesn't have any effects on user code that 
I am aware

--

___
Python tracker 

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



[issue42378] logging reopens file with same mode, possibly truncating

2022-01-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28671
pull_request: https://github.com/python/cpython/pull/30468

___
Python tracker 

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



[issue42378] logging reopens file with same mode, possibly truncating

2022-01-07 Thread Vinay Sajip


Vinay Sajip  added the comment:

I guess it got missed during the 3.10 beta cycle by not being backported - it 
might have needed to be cherry-picked. I'll see about getting it backported to 
3.10.

--

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

Should we backport this?

On Sat, Jan 8, 2022, 12:05 AM miss-islington  wrote:

>
> miss-islington  added the
> comment:
>
>
> New changeset d382f7ee0b98e4ab6ade9384268f25c06be462ad by Batuhan Taskaya
> in branch 'main':
> bpo-46289: Make conversion of FormattedValue not optional on ASDL
> (GH-30467)
>
> https://github.com/python/cpython/commit/d382f7ee0b98e4ab6ade9384268f25c06be462ad
>
>
> --
> nosy: +miss-islington
>
> ___
> Python tracker 
> 
> ___
>

--
nosy: +Batuhan Taskaya

___
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 Ethan Furman


Ethan Furman  added the comment:

Thank you, Nikita!

--
resolution:  -> fixed
stage: test needed -> 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



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

2022-01-07 Thread Ethan Furman


Ethan Furman  added the comment:


New changeset 74d1663580d1914bd110c3ab7282451f5e2cd2b5 by Nikita Sobolev in 
branch 'main':
bpo-46296: [Enum] add a test for missing `value` recovery (GH-30458)
https://github.com/python/cpython/commit/74d1663580d1914bd110c3ab7282451f5e2cd2b5


--

___
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 Andre Roberge


Andre Roberge  added the comment:

> This also affects 3.9 I imagine, no?

Yes. And, from what I can tell, the same incorrect line is indicated at least 
all the way back to Python 3.6   (where it was "invalid token" instead of 
"invalid decimal literal).

--
nosy: +aroberge

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


Terry J. Reedy  added the comment:

How about following "The Python interpreter has a number of functions and types 
built into it that are always available. They are listed here in alphabetical 
order." in
https://docs.python.org/3/library/functions.html
with "Here and elsewhere in these docs, entries for functions (including 
methods) that always return None usually omit 'Return None' and just say what 
the function does."

Barry: The PEP 8 'return None' recommendation could be added to the Reference 
entry for 'return'.  But I think this should be a separate issue as 1) it is 
about coding rather than documentation and 2) there is the possible objection 
that choosing completely explicit 'return None' versus half explicit, half 
implicit 'return' and the latter versus completely implicit  
should be left to the style PEP.

--
nosy: +terry.reedy

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

>> For this advice (catching Exception and not BaseException) to be correct, 
>> users should be advised (as they are in the tutorial) to raise exceptions 
>> derived from Exception (and not BaseException).

> I disagree with that.

You are a core developer and I just an end-user. I respect your expertise and 
will no longer comment.

--

___
Python tracker 

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



[issue46297] Python interpreter crashes on bootup with multiple PythonPaths set in registry

2022-01-07 Thread Eryk Sun


Change by Eryk Sun :


--
type: behavior -> crash

___
Python tracker 

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



[issue42378] logging reopens file with same mode, possibly truncating

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



[issue46297] Python interpreter crashes on bootup with multiple PythonPaths set in registry

2022-01-07 Thread Eryk Sun


Change by Eryk Sun :


--
components: +Windows
nosy: +paul.moore, tim.golden, zach.ware
type: crash -> behavior

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

> For this advice (catching Exception and not BaseException) to be correct, 
> users should be advised (as they are in the tutorial) to raise exceptions 
> derived from Exception (and not BaseException).

I disagree with that.

--

___
Python tracker 

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



[issue46297] Python interpreter crashes on bootup with multiple PythonPaths set in registry

2022-01-07 Thread Ned Deily


Change by Ned Deily :


--
nosy: +steve.dower

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

Irit:


In all the books and tutorials I have seen, the advice is to try to catch 
specific exceptions whenever possible or, *at most*, to catch Exception (and 
not BaseException).  This is to allow, for example, a program to be interrupted 
by a KeyboardInterrupt.

As you know, the hierarchy is as follows:

BaseException
 +-- SystemExit
 +-- KeyboardInterrupt
 +-- GeneratorExit
 +-- Exception
  +-- all others

If specific action to do some cleanup before a SystemExit (usually the result 
of calling sys.exit()) or catching some KeyboardInterrupt (which is generally 
NOT done via a raise statement), then these specific exception should be caught.
The documentation refers to GeneratorExit as not indicating an error needing to 
be caught by users.

For this advice (catching Exception and not BaseException) to be correct, users 
should be advised (as they are in the tutorial) to raise exceptions derived 
from Exception (and not BaseException).

--

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


miss-islington  added the comment:


New changeset d382f7ee0b98e4ab6ade9384268f25c06be462ad by Batuhan Taskaya in 
branch 'main':
bpo-46289: Make conversion of FormattedValue not optional on ASDL (GH-30467)
https://github.com/python/cpython/commit/d382f7ee0b98e4ab6ade9384268f25c06be462ad


--
nosy: +miss-islington

___
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


Nikita Sobolev  added the comment:

Yes, this is just a missing test. Not a wrong condition!

--
components: +Tests -Library (Lib)

___
Python tracker 

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



[issue34602] python3 resource.setrlimit strange behaviour under macOS

2022-01-07 Thread Ned Deily


Ned Deily  added the comment:

> @ned.deily, @lukasz.langa: reopen this issue or open a new one?

Since there are so many iterations on this issue already, I think a new issue 
would be better.

--

___
Python tracker 

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



[issue42378] logging reopens file with same mode, possibly truncating

2022-01-07 Thread Dustin Oprea


Dustin Oprea  added the comment:

<- I'm intentionally using mode 'w' (to support development) and it's never 
been an issue until I recently refactored the project to be asynchronous. Now, 
every time I fail, I suddenly lose the logs. Not awesome.

--

___
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 Ethan Furman


Change by Ethan Furman :


--
Removed message: https://bugs.python.org/msg410029

___
Python tracker 

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



[issue42378] logging reopens file with same mode, possibly truncating

2022-01-07 Thread Dustin Oprea


Dustin Oprea  added the comment:

I believe I'm seeing this, still, in an async situation. It seems like the 
obvious culprit. 

When will this go out in a release? I'm on 3.10.1 from December (under Arch). 
The PR got merged to master in July but I went through all changelogs back to 
March and don't see it listed.

--
nosy: +Dustin.Oprea

___
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 Ethan Furman


Ethan Furman  added the comment:

Looking through some of my code that prompted that branch, the issue is caused 
when `_generate_next_value_` modifies the given args -- when `__set_name__` 
runs it has no way of getting the same results to automatically create the 
`_value_` attribute.

--

___
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, are you saying that we should only RAISE Exception subclasses?

--

___
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


Change by Batuhan Taskaya :


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

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

Irit:

Gregor indicates that, while the tutorial refers to "a class that derives from 
Exception", the Python Reference Language states exceptions should be 
subclasses of BaseException  (which Exception *is*).

You then invited Gregor to submit a patch to change the wording of the tutorial 
(implying that it would refer to a class that derives from BaseException).

I pointed out that the advice given elsewhere is that user-defined exceptions 
should derive from Exception (thus, not from BaseException), so that nothing 
should be changed in the tutorial, and no change should be submitted.

So, as I understand it: there is a strict hierarchy of exceptions classes, all 
inheriting from BaseException. However, user-defined exceptions should be 
derived from Exception (and not BaseException), as indicated in the tutorial 
and on the page describing what each exception indicates. If that is correct, 
nothing needs to be changed in the tutorial.

--

___
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 Ethan Furman


Ethan Furman  added the comment:

(2) is false.

>>> from enum import Enum
>>> 
>>> class MyEnum(Enum):
... def __new__(cls, value):
... member = object.__new__(cls)
... return member
... ONE = 1
... 

>>> MyEnum.ONE
MyEnum.ONE

>>> MyEnum._use_args_
True

>>> MyEnum._member_type_


If coverage shows a branch not being tested, design a test for it instead of 
removing the branch.

--
assignee:  -> ethan.furman
nosy: +ethan.furman
stage: patch review -> test needed

___
Python tracker 

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



[issue46297] Python interpreter crashes on bootup with multiple PythonPaths set in registry

2022-01-07 Thread Derzsi Dániel

Change by Derzsi Dániel :


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

___
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


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



[issue28546] [doc] Clarify setting pdb breakpoints

2022-01-07 Thread miss-islington


miss-islington  added the comment:


New changeset a74eb5465582dd6e194a84ce4c66c12453373304 by Miss Islington (bot) 
in branch '3.9':
bpo-28546: [doc] Clarify setting pdb breakpoints (GH-30360)
https://github.com/python/cpython/commit/a74eb5465582dd6e194a84ce4c66c12453373304


--

___
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 Guido van Rossum


Guido van Rossum  added the comment:

Deep-freezing is definitely not a miracle cure. We should continue to trim or 
delay unneeded imports (like Christian just did for setuptools' 
_distutils_hack).

What *would* be a miracle cure would be if we could deep-freeze the module 
contents after it has *executed*. But that is much harder in general, since two 
executions (even on the same platform) could result in different module 
contents (e.g. conditionally defining something based on environment contents).

Instagram's Cinder has something that works for this, strict modules 
(https://github.com/facebookincubator/cinder#strict-modules). It is a complex 
system! But if we could do this it could really speed up a lot of imports 
tremendously. (Though still at the cost of binary size increase.)

--

___
Python tracker 

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



[issue46298] Automatically check for __slots__-mistakes in Lib

2022-01-07 Thread Arie Bovenberg


New submission from Arie Bovenberg :

Recently, I've identified some __slots__-related mistakes in the stdlib 
(bpo-46247, bpo-46244, bpo-46246).

Looking forward, it'd be wise to automate this check so mistakes don't creep 
into the code in the future.

Implementation-wise, the most straightforward solution would be a single test 
that walks all Lib/ (sub)modules and checks all classes.

Perhaps those with more experience in the test suite can chime in where this 
check might live

--
components: Library (Lib), Tests
messages: 410023
nosy: ariebovenberg
priority: normal
severity: normal
status: open
title: Automatically check for __slots__-mistakes in Lib
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



[issue28546] [doc] Clarify setting pdb breakpoints

2022-01-07 Thread miss-islington


miss-islington  added the comment:


New changeset ed2656a7d313dd9fa3a963d8b4dca4438cf73bc9 by Miss Islington (bot) 
in branch '3.10':
bpo-28546: [doc] Clarify setting pdb breakpoints (GH-30360)
https://github.com/python/cpython/commit/ed2656a7d313dd9fa3a963d8b4dca4438cf73bc9


--

___
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 Eryk Sun


Eryk Sun  added the comment:

Terry, it's just a simple bug that slipped by. The PATHCCH_OPTIONS enum in the 
SDK header "PathCch.h" unconditionally defines all of the options. So there's 
no compiler error when building with a newer version of the SDK, even though we 
define _WIN32_WINNT to 0x602 (Windows 8).

--
nosy:  -pablogsal

___
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 Guido van Rossum


Guido van Rossum  added the comment:

Niklas, can you show a brief example showing the issue you're running into? Is 
it just that list["Node"].__args__ is just ("Node",), not 
(ForwardRef("Node"),)? Or is it more complex?

--

___
Python tracker 

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



[issue46297] Python interpreter crashes on bootup with multiple PythonPaths set in registry

2022-01-07 Thread Derzsi Dániel

New submission from Derzsi Dániel :

When multiple PythonPaths are set up in the registry, in addition to the 
default PythonPath, the interpreter crashes immediately on bootup.

```Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.11\PythonPath\Panda3D]
@="C:\\Panda3D-1.11.0-x64\\python"```

The interpreter will crash with the following message:

```Exception ignored error evaluating path:
Traceback (most recent call last):
  File "", line 652, in 
TypeError: QueryValue expected 2 arguments, got 1
Fatal Python error: error evaluating path
Python runtime state: core initialized

Current thread 0x2bd0 (most recent call first):
  ```

This regression was introduced in the Python 3.11 branch with commit 
99fcf1505218464c489d419d4500f126b6d6dc28 on Dec 3, 2021.

--
components: Interpreter Core
messages: 410019
nosy: darktohka
priority: normal
severity: normal
status: open
title: Python interpreter crashes on bootup with multiple PythonPaths set in 
registry
type: crash
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



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

2022-01-07 Thread Steve Dower


Steve Dower  added the comment:

> Can you update the sources repo in the mean time?

Done

--

___
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



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



[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



[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



[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



[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



[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



  1   2   >