[issue46108] Enum repr() incorrect when mixed with dataclasses

2021-12-16 Thread Eric V. Smith


Eric V. Smith  added the comment:

I know you know this, but here's a version without dataclasses, in case you 
want to add a test for this, too.

from enum import Enum

class Foo:
def __init__(self, a):
self.a = a
def __repr__(self):
return f'Foo(a={self.a!r})'

class Entries(Foo, Enum):
ENTRY1 = Foo(1)

repr(Entries.ENTRY1) != ''

--
nosy: +eric.smith

___
Python tracker 

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



[issue46111] test_unittest fails in optimized mode

2021-12-16 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue46111] test_unittest fails in optimized mode

2021-12-16 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

$ ./python -OO -m test -vuall test_unittest
...
==
FAIL: testShortDescriptionWhitespaceTrimming 
(unittest.test.test_case.Test_TestCase)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/unittest/test/test_case.py", line 639, in 
testShortDescriptionWhitespaceTrimming
self.assertEqual(
^
AssertionError: None != 'Tests shortDescription() whitespace is trimmed, so 
that the first'

==
FAIL: test_Exit (unittest.test.test_program.Test_TestProgram)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/unittest/test/test_program.py", line 127, 
in test_Exit
self.assertIn('\nFAIL: testFail ', stream.getvalue())
^
AssertionError: '\nFAIL: testFail ' not found in 
'..\n--\nRan
 2 tests in 0.000s\n\nOK\n'

==
FAIL: test_ExitAsDefault (unittest.test.test_program.Test_TestProgram)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/unittest/test/test_program.py", line 139, 
in test_ExitAsDefault
self.assertIn('\nFAIL: testFail ', stream.getvalue())
^
AssertionError: '\nFAIL: testFail ' not found in 
'..\n--\nRan
 2 tests in 0.000s\n\nOK\n'

==
FAIL: test_NonExit (unittest.test.test_program.Test_TestProgram)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/unittest/test/test_program.py", line 114, 
in test_NonExit
self.assertIn('\nFAIL: testFail ', stream.getvalue())
^
AssertionError: '\nFAIL: testFail ' not found in 
'..\n--\nRan
 2 tests in 0.000s\n\nOK\n'

==
FAIL: test_special_attrs (unittest.test.testmock.testpatch.PatchTest)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/unittest/test/testmock/testpatch.py", line 
1880, in test_special_attrs
self.assertEqual(foo.__doc__, "TEST")
^
AssertionError: None != 'TEST'

--

--
assignee: serhiy.storchaka
components: Tests
messages: 408755
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: test_unittest fails in optimized mode
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



[issue41033] readline.c: SEGFAULT on SIGWINCH when loaded twice

2021-12-16 Thread Dale


Dale  added the comment:

I hit this on macOS today but I didn't get segmentation fault, at least not for 
as long as I cared to let Python run.  Instead I got a non-responsive Python 
process using 100% CPU that I had to kill with ^\.  I first hit this with GNU 
readline while running Python interactively under Emacs, then I reproduced it 
with libedit readline under a regular old terminal using the above recipe.

macOS 11.6.1, x86-64, Python 3.10.1 from MacPorts

--
nosy: +dale

___
Python tracker 

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



[issue46110] `eval("-"*3000000 + "4")` in cmd causes hard crash

2021-12-16 Thread Charles McMarrow


New submission from Charles McMarrow :

`eval("-"*300 + "4")` in cmd causes hard crash

--
components: Parser
messages: 408753
nosy: charles.mcmarrow.4, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: `eval("-"*300 + "4")` in cmd causes hard crash
type: crash
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



[issue37578] Change Glob: Allow Recursion for Hidden Files

2021-12-16 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

I want to clarify my first comment: my PR is similar to Zsh behaviour as 
described above; as I'm not 100% sure how bash behaves with `**` with globstar 
option, I can say that bash is the same as Zsh with ? and * magic characters 
(with dotglob option), and likely the same for `**` as well, but I can't test 
it (if someone can test it, please comment).

--

___
Python tracker 

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



[issue37578] Change Glob: Allow Recursion for Hidden Files

2021-12-16 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Isaac: my PR does allow [.] to match. But I probably need to update the docs to 
note that.

--

___
Python tracker 

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



[issue37578] Change Glob: Allow Recursion for Hidden Files

2021-12-16 Thread Isaac Muse


Isaac Muse  added the comment:

If this was to be done, you'd want to make sure character sequences also match 
hidden files: [.]. Just * and ? would be incomplete. If allowing ** to match a 
leading dot, it would not match . or ..

--
nosy: +Isaac Muse

___
Python tracker 

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



[issue46109] Separate resources and abc docs from other importlib docs

2021-12-16 Thread Jason R. Coombs


Change by Jason R. Coombs :


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

___
Python tracker 

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



[issue46109] Separate resources and abc docs from other importlib docs

2021-12-16 Thread Jason R. Coombs


New submission from Jason R. Coombs :

The `importlib` documentation is fairly long and covers a number of topics. 
Furthermore, the `importlib.metadata` is separately documented and presents a 
good example of breaking out major aspects. Let's do the same with `.abc` and 
`.resources`.

--
assignee: jaraco
components: Documentation
messages: 408749
nosy: jaraco
priority: normal
severity: normal
status: open
title: Separate resources and abc docs from other importlib docs
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



[issue46108] Enum repr() incorrect when mixed with dataclasses

2021-12-16 Thread Ethan Furman


New submission from Ethan Furman :

from dataclasses import dataclass
from enum import Enum

@dataclass
class Foo:
a: int = 0

class Entries(Foo, Enum):
ENTRY1 = Foo(1)

repr(Entries.ENTRY1) != ''

--
assignee: ethan.furman
messages: 408748
nosy: ethan.furman
priority: normal
severity: normal
status: open
title: Enum repr() incorrect when mixed with dataclasses
versions: Python 3.10, Python 3.11, 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



[issue46089] Problems with AF_PACKET sockets

2021-12-16 Thread Ethan Furman


Ethan Furman  added the comment:

To contribute you'll need to sign a Contributor's License Agreement [1].

After that, anything you can do to help will move this forward.  You may not be 
aware, but Python is developed primarily by volunteers, which unfortunately 
means that time is normally spent on bugs that the volunteers are interested in 
-- and nobody else seems interested in this one (which probably means not many 
people use this functionality).

If you have time, perhaps you could write some tests?  They would obviously 
fail at the moment, but would help when somebody wants to fix the code itself.


[1] https://www.python.org/psf/contrib/contrib-form/

--
assignee: docs@python -> 

___
Python tracker 

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



[issue44893] importlib.metadata Entrypoint has a broken _asdict

2021-12-16 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Expect the fix in 3.11a3.

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



[issue46105] Requirement syntax broken when extras indicated on url_req

2021-12-16 Thread Jason R. Coombs


Change by Jason R. Coombs :


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



[issue46105] Requirement syntax broken when extras indicated on url_req

2021-12-16 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset 864ec170e14b663f999eb415a4f1a0067ec6833a by Jason R. Coombs in 
branch '3.9':
[3.9] bpo-46105: Honor spec when generating requirement specs with urls and 
extras. (GH-30151). (GH-30157)
https://github.com/python/cpython/commit/864ec170e14b663f999eb415a4f1a0067ec6833a


--

___
Python tracker 

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



[issue46028] 3.11.0a3: under tox, sys._base_executable is wrong

2021-12-16 Thread Ned Batchelder


Ned Batchelder  added the comment:

Thanks, your change looks good.  The exact symlinks in the nested venv's are 
different for 3.10.1 and your 3.11, but they both work:

$ python3.10 -c "import sys; print(sys.version)"
3.10.1 (main, Dec 14 2021, 08:30:13) [Clang 12.0.0 (clang-1200.0.32.29)]

$ python3.10 -m venv v310

$ ls -al v310/bin/py*
lrwxr-xr-x  1 nedbatchelder  wheel  10 Dec 16 18:48 v310/bin/python@ -> 
python3.10
lrwxr-xr-x  1 nedbatchelder  wheel  10 Dec 16 18:48 v310/bin/python3@ -> 
python3.10
lrwxr-xr-x  1 nedbatchelder  wheel  25 Dec 16 18:48 v310/bin/python3.10@ -> 
/usr/local/bin/python3.10

$ v310/bin/python -m venv v310-nested

$ ls -al v310-nested/bin/py*
lrwxr-xr-x  1 nedbatchelder  wheel  37 Dec 16 18:48 v310-nested/bin/python@ -> 
/private/tmp/bpo46028/v310/bin/python
lrwxr-xr-x  1 nedbatchelder  wheel   6 Dec 16 18:48 v310-nested/bin/python3@ -> 
python
lrwxr-xr-x  1 nedbatchelder  wheel   6 Dec 16 18:48 v310-nested/bin/python3.10@ 
-> python

$

$ python3.11 -c "import sys; print(sys.version)"
3.11.0a3+ (heads/pr/30144:8b260a8606, Dec 16 2021, 14:31:40) [Clang 12.0.0 
(clang-1200.0.32.29)]

$ python3.11 -m venv v311

$ ls -al v311/bin/py*
lrwxr-xr-x  1 nedbatchelder  wheel  10 Dec 16 18:50 v311/bin/python@ -> 
python3.11
lrwxr-xr-x  1 nedbatchelder  wheel  10 Dec 16 18:50 v311/bin/python3@ -> 
python3.11
lrwxr-xr-x  1 nedbatchelder  wheel  25 Dec 16 18:50 v311/bin/python3.11@ -> 
/usr/local/bin/python3.11

$ v311/bin/python -m venv v311-nested

$ ls -al v311-nested/bin/py*
lrwxr-xr-x  1 nedbatchelder  wheel  10 Dec 16 18:50 v311-nested/bin/python@ -> 
python3.11
lrwxr-xr-x  1 nedbatchelder  wheel  10 Dec 16 18:50 v311-nested/bin/python3@ -> 
python3.11
lrwxr-xr-x  1 nedbatchelder  wheel  33 Dec 16 18:50 v311-nested/bin/python3.11@ 
-> /usr/local/cpython/bin/python3.11

--

___
Python tracker 

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



[issue37578] Change Glob: Allow Recursion for Hidden Files

2021-12-16 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Zsh allows use of *, ? and ** to match hidden files and directories.

Bash allows the same for * and ? with `dotglob` option. There is also a 
`globstar` but my version of bash (on macos) is too old to have it.

By the way setting options in bash is done with `shopt -s `.

I've put up a PR that enables behavior similar to Zsh and Bash (at least for ? 
and * chars).

--

___
Python tracker 

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



[issue678264] test_resource fails when file size is limited

2021-12-16 Thread Daniel Diniz


Change by Daniel Diniz :


--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 
3.5

___
Python tracker 

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



[issue9917] resource max value represented as signed when should be unsigned

2021-12-16 Thread Daniel Diniz


Change by Daniel Diniz :


--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 
3.5

___
Python tracker 

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



[issue36225] [subinterpreters] Lingering subinterpreters should be implicitly cleared on shutdown

2021-12-16 Thread Chris Roberts


Change by Chris Roberts :


--
nosy: +nasageek

___
Python tracker 

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



[issue46107] ExceptionGroup.split()/subgroup() don't copy __note__ to parts

2021-12-16 Thread Irit Katriel


Change by Irit Katriel :


--
type:  -> behavior

___
Python tracker 

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



[issue46107] ExceptionGroup.split()/subgroup() don't copy __note__ to parts

2021-12-16 Thread Irit Katriel


Irit Katriel  added the comment:

With the patch:

>>> e = ExceptionGroup("eg", [ValueError(1), TypeError(2)])
>>> e.__note__ = "a note"
>>> e.split(ValueError)
(ExceptionGroup('eg', [ValueError(1)]), ExceptionGroup('eg', [TypeError(2)]))
>>> e.split(ValueError)[0].__note__
'a note'
>>> e.split(ValueError)[1].__note__
'a note'
>>> e.subgroup(ValueError).__note__
'a note'
>>>

--

___
Python tracker 

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



[issue46107] ExceptionGroup.split()/subgroup() don't copy __note__ to parts

2021-12-16 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue1062277] Pickle breakage with reduction of recursive structures

2021-12-16 Thread Daniel Diniz


Change by Daniel Diniz :


--
versions: +Python 3.11 -Python 3.5

___
Python tracker 

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



[issue45635] Tidy up error handling in traceback.c / python run.c

2021-12-16 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



[issue45635] Tidy up error handling in traceback.c / python run.c

2021-12-16 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 8d6155ee9d1b05946f951d0ba602b9f63810fe0f by Irit Katriel in 
branch 'main':
bpo-45635: Do not suppress errors in functions called from _PyErr_Display 
(GH-30073)
https://github.com/python/cpython/commit/8d6155ee9d1b05946f951d0ba602b9f63810fe0f


--

___
Python tracker 

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



[issue46107] ExceptionGroup.split()/subgroup() don't copy __note__ to parts

2021-12-16 Thread Irit Katriel


Change by Irit Katriel :


--
assignee:  -> iritkatriel

___
Python tracker 

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



[issue46107] ExceptionGroup.split()/subgroup() don't copy __note__ to parts

2021-12-16 Thread Irit Katriel


New submission from Irit Katriel :

>>> e = ExceptionGroup("eg", [ValueError(1), TypeError(2)])
>>> e.__note__ = "a note"
>>> e.split(ValueError)
(ExceptionGroup('eg', [ValueError(1)]), ExceptionGroup('eg', [TypeError(2)]))
>>> e.split(ValueError)[0].__note__
>>> e.subgroup(ValueError).__note__

--
components: Interpreter Core
messages: 408740
nosy: iritkatriel
priority: normal
severity: normal
status: open
title: ExceptionGroup.split()/subgroup() don't copy __note__ to parts
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



[issue45292] Implement PEP 654: Exception Groups

2021-12-16 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +28377
pull_request: https://github.com/python/cpython/pull/30158

___
Python tracker 

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



[issue46105] Requirement syntax broken when extras indicated on url_req

2021-12-16 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +28376
pull_request: https://github.com/python/cpython/pull/30157

___
Python tracker 

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



[issue46105] Requirement syntax broken when extras indicated on url_req

2021-12-16 Thread miss-islington


miss-islington  added the comment:


New changeset 09d7319bfe0006d9aa3fc14833b69c24ccafdca6 by Miss Islington (bot) 
in branch '3.10':
bpo-46105: Honor spec when generating requirement specs with urls and extras. 
(GH-30151)
https://github.com/python/cpython/commit/09d7319bfe0006d9aa3fc14833b69c24ccafdca6


--

___
Python tracker 

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



[issue44893] importlib.metadata Entrypoint has a broken _asdict

2021-12-16 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset 04deaee4c8d313717f3ea8f6a4fd70286d510d6e by Jason R. Coombs in 
branch 'main':
bpo-44893: Implement EntryPoint as simple class with attributes. (GH-30150)
https://github.com/python/cpython/commit/04deaee4c8d313717f3ea8f6a4fd70286d510d6e


--

___
Python tracker 

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



[issue46105] Requirement syntax broken when extras indicated on url_req

2021-12-16 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset 109d96602199a91e94eb14b8cb3720841f22ded7 by Jason R. Coombs in 
branch 'main':
bpo-46105: Honor spec when generating requirement specs with urls and extras. 
(GH-30151)
https://github.com/python/cpython/commit/109d96602199a91e94eb14b8cb3720841f22ded7


--

___
Python tracker 

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



[issue46105] Requirement syntax broken when extras indicated on url_req

2021-12-16 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 1.0 -> 2.0
pull_requests: +28375
pull_request: https://github.com/python/cpython/pull/30156

___
Python tracker 

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



[issue46106] OpenSSL 1.1.1m is now available

2021-12-16 Thread Ned Deily


New submission from Ned Deily :

Update Windows build, macOS installer, and Tools/multissltests.py

--
components: Build, Windows, macOS
messages: 408736
nosy: christian.heimes, ned.deily, paul.moore, ronaldoussoren, steve.dower, 
tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: OpenSSL 1.1.1m is now available
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



[issue46088] Build hangs under Visual Studio in deepfreeze stage

2021-12-16 Thread Guido van Rossum


Guido van Rossum  added the comment:

I don't see a reason to go through the bootstrap python on Windows. It would 
increase the build time, which is already pretty slow.

--

___
Python tracker 

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



[issue46044] Update distutils documentation to say PyPI only accepts tar.gz and zip.

2021-12-16 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28374
pull_request: https://github.com/python/cpython/pull/30155

___
Python tracker 

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



[issue46044] Update distutils documentation to say PyPI only accepts tar.gz and zip.

2021-12-16 Thread miss-islington


miss-islington  added the comment:


New changeset ecdc0ccede5f9ac4042ff56f295d81df2f428950 by Matthias Bussonnier 
in branch 'main':
bpo-46044: Annotate deprecated sdists formats (GH-30043)
https://github.com/python/cpython/commit/ecdc0ccede5f9ac4042ff56f295d81df2f428950


--

___
Python tracker 

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



[issue46044] Update distutils documentation to say PyPI only accepts tar.gz and zip.

2021-12-16 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue37578] Change Glob: Allow Recursion for Hidden Files

2021-12-16 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
keywords: +patch
nosy: +andrei.avk
nosy_count: 5.0 -> 6.0
pull_requests: +28372
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30153

___
Python tracker 

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



[issue44893] importlib.metadata Entrypoint has a broken _asdict

2021-12-16 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests:  -28371

___
Python tracker 

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



[issue44893] importlib.metadata Entrypoint has a broken _asdict

2021-12-16 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

The change as implemented for importlib_metadata involves refactorings that 
can't be backported, so the fix will only go into Python 3.11. I'll consider 
backporting a more selective fix for this issue if it's important, but I 
suspect there may not be, given that Ronny has reported that he's already 
migrated to a solution accessing by attribute.

--
versions:  -Python 3.10, 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



[issue23522] Misleading note in Statistics module documentation

2021-12-16 Thread Mark Dickinson


Mark Dickinson  added the comment:

> "The mean is strongly affected by outliers and is not necessarily a typical 
> example of the data points. For a more robust, although less efficient, 
> measure of central tendency, see median()"

That wording sounds fine to me. I don't think we can reasonably expect to hear 
from Jake again, but from my understanding of his post, this addresses his 
concerns.

FWIW, I share those concerns. My brain can't parse "robust estimator for 
central location", because the term "estimator" has a precise and well-defined 
meaning in (frequentist) statistics, and what I expect to see after "estimator 
for" is a description of a parameter of a statistical model - as in for example 
"estimator for the population mean", or "estimator for the Weibull shape 
parameter". "central location" doesn't really fit in that slot.

> How do we feel about linking to Wikipedia?

I can't think of any good reason not to. We have plenty of other external links 
in the docs, and the Wikipedia links are probably at lower risk of becoming 
stale than most of the others.

--

___
Python tracker 

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



[issue46097] Split function versions into 1-0xffff and 0x1000+ regions

2021-12-16 Thread Brandt Bucher


Brandt Bucher  added the comment:

Ah, never mind, I think I understand what you meant. Special methods get 
0x0001-0x, all other functions get 0x0001-0x. So we use 16-bit 
versions for special method caches, and 32-bit versions for normal call caches. 
"super().__init__()" and "object.__new__()" will specialize correctly, since 
special method versions are also valid function versions.

This seems like a solid idea, then, provided that we're reasonably confident 
this will actually improve real code. I guess the case this optimizes for is a 
program that specializes more than 2**16 normal calls, *then* tries to 
specialize a 2**16 special method calls? Seems uncommon, but not impossible.

(I think there might be a weird edge-case where a function is specialized first 
as a normal function, *then* as a special method. I imagine we just reassign it 
a special method version and continue as normal in that case, though.)

--

___
Python tracker 

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



[issue46101] argparse: using parents & subcommands, options can be ignored

2021-12-16 Thread Lucas Cimon


Lucas Cimon  added the comment:

The GitHub PR is ready for reviewing.

--

___
Python tracker 

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



[issue46105] Requirement syntax broken when extras indicated on url_req

2021-12-16 Thread Jason R. Coombs


Change by Jason R. Coombs :


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

___
Python tracker 

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



[issue44893] importlib.metadata Entrypoint has a broken _asdict

2021-12-16 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
pull_requests: +28371
pull_request: https://github.com/python/cpython/pull/30151

___
Python tracker 

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



[issue45755] Specialized generic class does not return class attributes in dir

2021-12-16 Thread Guido van Rossum


Guido van Rossum  added the comment:

I think a 3.10 backport would be appreciated.

--

___
Python tracker 

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



[issue46085] OrderedDict iterator allocates di_result unnecessarily

2021-12-16 Thread Kevin Shweh


Kevin Shweh  added the comment:

Almost - C's weird bitwise operator precedence means it has to be parenthesized 
as

if ((kind & _odict_ITER_ITEMS) == _odict_ITER_ITEMS)

--

___
Python tracker 

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



[issue46105] Requirement syntax broken when extras indicated on url_req

2021-12-16 Thread Jason R. Coombs


New submission from Jason R. Coombs :

In https://github.com/python/importlib_metadata/issues/357, a user reported an 
issue where a requirement generated by importlib.metadata from egg info 
metadata would result in a parse error attempting to parse the error. A fix was 
released in importlib_metadata 4.8.3.

--
assignee: jaraco
messages: 408727
nosy: jaraco
priority: normal
severity: normal
status: open
title: Requirement syntax broken when extras indicated on url_req
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



[issue23522] Misleading note in Statistics module documentation

2021-12-16 Thread Guido van Rossum


Guido van Rossum  added the comment:

Great! I will leave it to Steven and Mark D to work out an acceptable solution.

PS. Allen Downey is a computer scientist who has written at least one book 
about Python.

--

___
Python tracker 

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



[issue44893] importlib.metadata Entrypoint has a broken _asdict

2021-12-16 Thread Jason R. Coombs


Change by Jason R. Coombs :


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

___
Python tracker 

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



[issue46097] Split function versions into 1-0xffff and 0x1000+ regions

2021-12-16 Thread Brandt Bucher


Brandt Bucher  added the comment:

Interesting idea!

> It is likely that programs will have more than 2**16 functions versions, but 
> it is much less likely that they will have more than 2**16 versions of 
> special methods.

Is it? The pyperformance suite isn't exactly representative of huge production 
apps, sure, but the most recent specialization stats don't seem to indicate 
that we ever run out of versions. Do we have reason to believe that real-world 
code would benefit from this?

These versions are only created for successful specializations in hot code (and 
we typically expect a high degree of stability thereafter), so I would think 
that in practice it's actually quite rare to bump the version after the first 
few are handed out.

> We should partition the version space into 1-0x for use by special 
> methods and 0x1000+ for use by other methods.

Typo? It seems like the ranges 0x0001-0x and 0x1-0x1 are closer to 
what you're describing here. If so:
- Does this mean that it will now be impossible to specialize explicit calls to 
special methods, like "super().__init__()" or "object.__new__()"?
- Why not just maintain two separate 16-bit version counters, instead of one 
17-bit counter with two distinct regions?

Or maybe you meant 0x0001-0x7FFF and 0x8000-0x? But then my concern would 
be that it essentially halves the number of "normal" functions that we can 
successfully specialize. If it's likely that more than 2**15 "normal" function 
versions will be used and unlikely that 2**15 special methods will be used, 
lots of the special method versions will remain unused long after we've 
exhausted the "normal" versions.

Also, just to make sure we're on the same page: when you say "other methods", 
are you actually referring to "other functions"? It doesn't seem like there's a 
reason for this versioning to only apply to method objects, but maybe I'm 
missing something.

--

___
Python tracker 

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



[issue5004] socket.getfqdn() doesn't cope properly with purely DNS-based setups

2021-12-16 Thread Matej Cepl


Change by Matej Cepl :


--
nosy: +mcepl

___
Python tracker 

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



[issue42238] Deprecate suspicious.py?

2021-12-16 Thread Julien Palard


Julien Palard  added the comment:

Another true positive for make suspicious:

WARNING: [c-api/apiabiversion:70] ":macro" found in "the same format as the 
c:macro:"

I'm working on implementing it on rstlint, in the meantime I opened:

=> https://github.com/python/cpython/pull/30149

to fix this occurrence. This show that the current version of rstlint catches 
two mores \o/

--

___
Python tracker 

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



[issue45383] PyType_FromSpec API fails to use metaclass of bases

2021-12-16 Thread Sebastian Berg


Sebastian Berg  added the comment:

It is probably early, but I am starting to like the idea of a "C MetaClass 
factory" helper/indicator.

It seems to me that yes, at least `tp_new` cannot be called reasonable for a 
class that is created in C, it is just too confusing/awkward to try to push the 
C stuff _through_ the Python API.  (And the Python API is the typical one that 
should not be inconvenienced)

Which gives two possibilities if I want this capability?:
1. Force use of a custom class factory in Python (i.e. not through `__new__`).  
But that seems hard, since I need to refuse `__new__()`!).
2. Use a class factor in C which never calls `__new__` and knows that this is 
OK.

This is not my turf, so I like unholy, but maybe pragmatic things :).  Would a 
slot/flag indicating `Py_using_metaclass_cinit_pretty_promise_please` "solve" 
these issues?

I mean, we have two ways to create classes (C and Python), I am not sure it is 
plausible to untangle this on the MetaClass level, so maybe the only way 
forward is to embrace it: Some Python MetaClasses just can't be instantiated 
from C, because we don't know it will work.  If we want to allow instantiating 
the MetaClass from C, we need some way to set this up.  And either we cannot 
use `PyType_FromSpec` then, or we need to tell it that we know what we are 
doing.

--

___
Python tracker 

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



[issue46102] pdb can't convert dict_values to list

2021-12-16 Thread Christian Heimes


Christian Heimes  added the comment:

list is a pdb command.

(Pdb) help list
l(ist) [first [,last] | .]

List source code for the current file.  Without arguments,
list 11 lines around the current line or continue the previous
listing.  With . as argument, list 11 lines around the current
line.  With one argument, list 11 lines starting at that line.
With two arguments, list the given range; if the second
argument is less than the first, it is a count.

The current line in the current frame is indicated by "->".
If an exception is being debugged, the line where the
exception was originally raised or propagated is indicated by
">>", if it differs from the current line.

You have to use "p list(x.values())" if you want to print the output of the 
list function.

(Pdb) x = {'a': 1}
(Pdb) p list(x.values())
[1]

--
nosy: +christian.heimes
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



[issue46104] Reduce use of old-style syntax in typing docs

2021-12-16 Thread Alex Waygood


Change by Alex Waygood :


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

___
Python tracker 

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



[issue46104] Reduce use of old-style syntax in typing docs

2021-12-16 Thread Alex Waygood


New submission from Alex Waygood :

There are a few places in the typing docs where old-style (pre-PEP 526) syntax 
is used in examples. It doesn't look like these examples have been updated 
since 2016; it would be good to change them so that they use the newer syntax 
introduced in PEP 526.

--
assignee: docs@python
components: Documentation
messages: 408721
nosy: AlexWaygood, docs@python, gvanrossum, kj
priority: normal
severity: normal
status: open
title: Reduce use of old-style syntax in typing docs
type: enhancement
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



[issue45383] PyType_FromSpec API fails to use metaclass of bases

2021-12-16 Thread Sebastian Berg


Sebastian Berg  added the comment:

Sorry, I need some time to dive back into this, so some things might be garbled 
:).  Yes, I do agree supporting a custom `tp_new` here seems incredibly tricky. 
 I have not thought about the implications of this, though.

> guess the safest option is to fail when the metaclass has a custom tp_new

That would seem OK, but I can't quite judge it.  It may mean that I have to do 
a custom factory to create new metaclass instances from Python, but that is 
probably for the better anyway.

Now, calling `tp_new` is a bit useless, since from C we don't have a dict 
anyway (at least not really).  So yeah, this does not make sense at all for 
most Python defined metaclasses...  (they may want to inspect/mutate the dict)

> But at that point, this is duplicating a lot of existing functionality, and 
> I'm starting to wonder if this wouldn't all be better with calling the 
> metaclass instead.

I do not think I am following :(.  My worry is that I want people to create a 
MetaClass instance through C (but not be locked into static types forever).

My current thought is that I would like it be possible to do something like:

/* Create a new type object */
type_spec = {stuff};
newtype = PyType_FromSpec(_spec);
/* Finalize the MetaClass */
metatype_spec = {more_stuff};
PyArray_InitDTypeFromSpec(newtype, _spec);

Of course I can move this into a single function and create the class for the 
user.  But I am uncertain that piping everything through `tp_new` will help?  
At some point I thought that the user should create a subclass, and I create 
another class inheriting it.  But it also seems convoluted and complicated.

I have no idea right now, but maybe there could also be a way to make creating 
a metaclass-factory in C easier, rather than supporting `PyType_FromSpec` for 
metaclasses.
(I.e. an `PType_InitFromSpec()` doing most of what `PyType_FromSpec` does, but 
really meant to be only used be such metaclass factories.)

> - basicsize/itemsize could be allowed with __basicsize__/__itemsize__ in the 
> dict.

Do we need this?  I need the basicsize of the metaclass, but that of the class 
seems fixed/OK?

> - flags: we could add mechanisms to set individual flags after the type is 
> created, as needed.

Seems fine, yeah.

> - slots can usually be applied after the class is created; maybe there should 
> be a public function for this.
> - members could theoretically be copied to individual descriptors; there 
> doesn't seem much need for keeping tp_members around.

But a Python MetaClass (that the author may not even realize about) might need 
access to these to work properly?
A bit far fetched, but...

--

___
Python tracker 

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



[issue46103] inspect.getmembers will call the instance __bases__ attribute, which may cause an exception

2021-12-16 Thread hongweipeng


Change by hongweipeng :


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

___
Python tracker 

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



[issue46058] argparse: arg groups and mutually exclusive groups behave inconsitently

2021-12-16 Thread Irit Katriel


Irit Katriel  added the comment:

Nesting argument groups and mutually exclusive groups is now deprecated (see 
issue22047). Thank you for the bug report.

Note Paul's comment about why nesting mutually exclusive groups does not give 
you anything in terms of semantics.

--
nosy: +iritkatriel
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Deprecate unsupported nesting of argparse groups

___
Python tracker 

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



[issue46090] C extensions can't swap out live frames anymore

2021-12-16 Thread Jason Madden


Change by Jason Madden :


--
nosy: +jmadden

___
Python tracker 

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



[issue38584] argparse: Specifying a whitespace-only help message to a positional arg triggers an IndexError when displaying --help

2021-12-16 Thread Lucas Cimon


Lucas Cimon  added the comment:

This was resolved by https://github.com/python/cpython/pull/28050

--
message_count: 4.0 -> 5.0
pull_requests: +28366
status: open -> closed
pull_request: https://github.com/python/cpython/pull/28050

___
Python tracker 

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



[issue46103] inspect.getmembers will call the instance __bases__ attribute, which may cause an exception

2021-12-16 Thread hongweipeng


New submission from hongweipeng :

root@debian:/workspace/cpython# ./python
Python 3.11.0a3+ (heads/main-dirty:b123ad8030, Dec 16 2021, 06:16:15) [GCC 
10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import inspect
>>> class Foo:
...   def __getattr__(self, attr):
... return None
... 
>>> inspect.getmembers(Foo())
Traceback (most recent call last):
  File "", line 1, in 
  File "/workspace/cpython/Lib/inspect.py", line 488, in getmembers
return _getmembers(object, predicate, getattr)
   ^^^
  File "/workspace/cpython/Lib/inspect.py", line 455, in _getmembers
for base in object.__bases__:
^
TypeError: 'NoneType' object is not iterable

--
components: Library (Lib)
messages: 408717
nosy: hongweipeng
priority: normal
severity: normal
status: open
title: inspect.getmembers will call the instance __bases__ attribute, which may 
cause an exception
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



[issue38590] argparse unexpected behavior with argument group inside mutually exclusive group

2021-12-16 Thread Irit Katriel


Irit Katriel  added the comment:

Nesting argument groups and mutually exclusive groups is now deprecated (see 
issue22047). Thank you for the bug report.

--
nosy: +iritkatriel
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Deprecate unsupported nesting of argparse groups

___
Python tracker 

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



[issue45690] Argparse exclusive group inside required exclusive group displays incorrectly

2021-12-16 Thread Irit Katriel


Irit Katriel  added the comment:

Nesting argument groups and mutually exclusive groups is now deprecated (see 
issue22047). Thank you for the bug report.

--
nosy: +iritkatriel
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Deprecate unsupported nesting of argparse groups

___
Python tracker 

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



[issue46102] pdb can't convert dict_values to list

2021-12-16 Thread Aidas Petryla


New submission from Aidas Petryla :

Reproducing:

Running pdb shell (for example "python -m pdb "

Input:
x = {'a': 1}
list(x.values())

Output:
*** Error in argument: '(x.values())'

--
messages: 408714
nosy: apetryla
priority: normal
severity: normal
status: open
title: pdb can't convert dict_values to list
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



[issue22047] Deprecate unsupported nesting of argparse groups

2021-12-16 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



[issue46057] argparse: embedded groups may prevent options from being in help output

2021-12-16 Thread Irit Katriel


Irit Katriel  added the comment:

Nesting argument groups and mutually exclusive groups is now deprecated (see 
issue22047). Thank you for the bug report.

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



[issue46101] argparse: using parents & subcommands, options can be ignored

2021-12-16 Thread Lucas Cimon


Change by Lucas Cimon :


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

___
Python tracker 

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



[issue22047] Deprecate unsupported nesting of argparse groups

2021-12-16 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 30322c497e0b8d978f7a0de95985aac9c5daf1ac by Irit Katriel in 
branch 'main':
bpo-22047: [argparse] deprecate nested argument groups and mutually exclusive 
groups (GH-30098)
https://github.com/python/cpython/commit/30322c497e0b8d978f7a0de95985aac9c5daf1ac


--

___
Python tracker 

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



[issue46101] argparse: using parents & subcommands, options can be ignored

2021-12-16 Thread Lucas Cimon


New submission from Lucas Cimon :

Hi!

Here is some minimal code reproducing the issue:

import argparse

common_opts_parser = argparse.ArgumentParser(add_help=False)
common_opts_parser.add_argument("--endpoint", choices=("prod", "dev"), 
default="dev")

parser = argparse.ArgumentParser(parents=[common_opts_parser])
subparsers = parser.add_subparsers(required=True)

subcmd_cmd = subparsers.add_parser("subcmd", parents=[common_opts_parser])
subcmd_cmd.add_argument("--debug", action="store_true")

print(parser.parse_args())

Everything works fine / as expected when specifying the common optional arg 
last:

$ ./bug_repro.py subcmd --endpoint=dev
Namespace(endpoint='dev', debug=False)

However when specifying the --endpoint between the program and the subcommand, 
the value provided is ignored:

$ ./bug_repro.py --endpoint=dev subcmd
Namespace(endpoint=None, debug=False)

I have a PR ready to fix that.

--
components: Library (Lib)
messages: 408711
nosy: Lucas Cimon
priority: normal
severity: normal
status: open
title: argparse: using parents & subcommands, options can be ignored
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



[issue46072] Unify handling of stats in the CPython VM

2021-12-16 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +28363
pull_request: https://github.com/python/cpython/pull/30145

___
Python tracker 

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



[issue46028] 3.11.0a3: under tox, sys._base_executable is wrong

2021-12-16 Thread Steve Dower


Steve Dower  added the comment:

This PR *might* be a fix, but I think it's only partial. It isn't going to work 
if you've made a venv and copied "python3"->"python", for example.

It still might be best solved by writing base_executable into pyvenv.cfg, and 
then simply reading it out.

--

___
Python tracker 

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



[issue46028] 3.11.0a3: under tox, sys._base_executable is wrong

2021-12-16 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue46088] Build hangs under Visual Studio in deepfreeze stage

2021-12-16 Thread Steve Dower


Steve Dower  added the comment:

On Windows we automatically download a runtime if you don't have one, so this 
isn't such a big deal. You *do* need an internet connection to do this, of 
course, but that's the case for most of our external dependencies already.

Plus I don't think we're even building the bootstrap interpreter on Windows yet?

--

___
Python tracker 

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



[issue46072] Unify handling of stats in the CPython VM

2021-12-16 Thread Mark Shannon


Mark Shannon  added the comment:

The --enable-stats option is for CPython development and shouldn't be turned on 
for a release version, so I'm not really concerned about people attacking their 
own machines.

--

___
Python tracker 

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



[issue45755] Specialized generic class does not return class attributes in dir

2021-12-16 Thread Ken Jin


Ken Jin  added the comment:

Hi, I won't be backporting this to 3.9 since I don't like having jarring 
behavior changes so late into the bugfix cycle of a Python version.

I'm tempted to backport to 3.10. For now, I'll be conservative and just merge 
it in main. Please do tell me if any of you feel that I should backport to 3.10 
too.

3.6-3.8 are in security-fix only mode so they won't get any bugfixes.

Thanks Kevin for the interesting bug report, and Karthikeyan for saving me a 
ton of time debugging this!

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



[issue46088] Build hangs under Visual Studio in deepfreeze stage

2021-12-16 Thread Christian Heimes


Christian Heimes  added the comment:

VS builds could use the bootstrap interpreter again. This will remove the need 
to have a Python interpreter installed to build Python on Windows.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue45755] Specialized generic class does not return class attributes in dir

2021-12-16 Thread Ken Jin


Ken Jin  added the comment:


New changeset d6e13747161d7b634b47d2d3d212ed3be4a21fab by Ken Jin in branch 
'main':
bpo-45755: [typing] Reveal class attributes of generic in generic aliases in 
`dir()` (GH-29962)
https://github.com/python/cpython/commit/d6e13747161d7b634b47d2d3d212ed3be4a21fab


--

___
Python tracker 

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



[issue46072] Unify handling of stats in the CPython VM

2021-12-16 Thread Christian Heimes


Christian Heimes  added the comment:

I just noticed that you are using hard-coded paths with /tmp for the pystats 
directory. That's problematic and opens the possibility of a symlink race 
attack.

Could please add exclusive create to _Py_PrintSpecializationStats()? The will 
prevent symlink attacks. fopen() mode "x" is not generally available in all 
libcs. You have to combine open() and fdopen():


int flags = O_WRONLY | O_CREAT | O_EXCL;
#ifdef O_NOFOLLOW
flags |= O_NOFOLLOW;
#endif
#ifdef O_CLOEXEC
flags |= O_CLOEXEC;
#endif

int fd = open(path, flags);
if (fd >= 0) {
FILE *fout = fdopen(fd, "w");
}

--

___
Python tracker 

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



[issue46097] Split function versions into 1-0xffff and 0x1000+ regions

2021-12-16 Thread Ken Jin


Change by Ken Jin :


--
nosy: +kj

___
Python tracker 

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



[issue46088] Build hangs under Visual Studio in deepfreeze stage

2021-12-16 Thread Steve Dower


Steve Dower  added the comment:

I posted a PR that shells out to the find_python script and captures its output 
to use during VS builds.

Theoretically, this could save us from running it in build.bat, but I like 
having the detection and messages up front rather than buried deep in the build 
logs.

--

___
Python tracker 

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



[issue46088] Build hangs under Visual Studio in deepfreeze stage

2021-12-16 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +28361
pull_request: https://github.com/python/cpython/pull/30143

___
Python tracker 

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



[issue23522] Misleading note in Statistics module documentation

2021-12-16 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue46072] Unify handling of stats in the CPython VM

2021-12-16 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 4506bbede1644e985991884964b43afa7ee6f609 by Mark Shannon in 
branch 'main':
bpo-46072: Document --enable-stats option. (GH-30139)
https://github.com/python/cpython/commit/4506bbede1644e985991884964b43afa7ee6f609


--

___
Python tracker 

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



[issue46100] Simplify readline / editline detection

2021-12-16 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

FWIW, the XCode SDKs for macOS 11 and 12 use the NetBSD editline library.


$ grep "NetBSD: readline" 
/Library/Developer/CommandLineTools/SDKs/MacOSX*.sdk/usr/include/readline/readline.h
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/readline/readline.h:/*
  $NetBSD: readline.h,v 1.33 2012/05/15 17:30:04 christos Exp $   */
/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include/readline/readline.h:/*
  $NetBSD: readline.h,v 1.33 2012/05/15 17:30:04 christos Exp $   */
/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/readline/readline.h:/*
  $NetBSD: readline.h,v 1.33 2012/05/15 17:30:04 christos Exp $   */
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/readline/readline.h:/*
$NetBSD: readline.h,v 1.33 2012/05/15 17:30:04 christos Exp $   */
/Library/Developer/CommandLineTools/SDKs/MacOSX12.0.sdk/usr/include/readline/readline.h:/*
  $NetBSD: readline.h,v 1.33 2012/05/15 17:30:04 christos Exp $   */
/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/readline/readline.h:/*
$NetBSD: readline.h,v 1.33 2012/05/15 17:30:04 christos Exp $   */
$ grep RL_READLINE_VERSION 
/Library/Developer/CommandLineTools/SDKs/MacOSX*.sdk/usr/include/readline/readline.h
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/readline/readline.h:#define
 RL_READLINE_VERSION 0x0402
/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include/readline/readline.h:#define
 RL_READLINE_VERSION 0x0402
/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/readline/readline.h:#define
 RL_READLINE_VERSION 0x0402
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/readline/readline.h:#define
 RL_READLINE_VERSION   0x0402
/Library/Developer/CommandLineTools/SDKs/MacOSX12.0.sdk/usr/include/readline/readline.h:#define
 RL_READLINE_VERSION 0x0402
/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/readline/readline.h:#define
 RL_READLINE_VERSION   0x0402


This is what Homebrew provides:

$ PKG_CONFIG_PATH=$(brew --prefix readline)/lib/pkgconfig pkg-config readline 
--cflags --libs
-I/usr/local/Cellar/readline/8.1.1/include 
-L/usr/local/Cellar/readline/8.1.1/lib -lreadline

--

___
Python tracker 

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



[issue46100] Simplify readline / editline detection

2021-12-16 Thread Christian Heimes


New submission from Christian Heimes :

The configure.ac code for editline/readline detection is complicated. 
Especially the code for linking with extra termcap libraries makes it 
complicated to port the check to pkg-config. The termcap checks were added by 
Greg in bpo-3645 and commit 188209465a966cf046ed7946589aa21767f95e68 .

I propose to simplify the checks and require a readline 4.2 compatible API. GNU 
readline was released in 2001 (20 years ago). NetBSD libedit 
editline/readline.h has RL_READLINE_VERSION 0x0402 for at least 10 years.

* drop the check for additional termcap libs
* remove the fallback to completion_matches
* replace AC_CHECK_LIB($LIBREADLINE, ...) checks with a check for 
RL_READLINE_VERSION >= 0x0402

What do you think?

--
components: Build
messages: 408700
nosy: christian.heimes, erlendaasland, gregory.p.smith
priority: normal
severity: normal
status: open
title: Simplify readline / editline detection
type: enhancement
versions: Python 3.11

___
Python tracker 

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



[issue28816] [doc] Clarify that zipimport does not invoke import hooks to load custom files from zip.

2021-12-16 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



[issue28816] [doc] Clarify that zipimport does not invoke import hooks to load custom files from zip.

2021-12-16 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 0194bbbee6a12264e93d3217c774e226f0a1737d by Miss Islington (bot) 
in branch '3.10':
bpo-28816: [doc] clarify that zipimport invokes importers only for python files 
(GH-30060) (GH-30133)
https://github.com/python/cpython/commit/0194bbbee6a12264e93d3217c774e226f0a1737d


--

___
Python tracker 

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



[issue28816] [doc] Clarify that zipimport does not invoke import hooks to load custom files from zip.

2021-12-16 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 4c1effaaee472cc67f3186411a3df4f39af3d71a by Miss Islington (bot) 
in branch '3.9':
bpo-28816: [doc] clarify that zipimport invokes importers only for python files 
(GH-30060) (GH-30134)
https://github.com/python/cpython/commit/4c1effaaee472cc67f3186411a3df4f39af3d71a


--

___
Python tracker 

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



[issue23522] Misleading note in Statistics module documentation

2021-12-16 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Prompted by Guido's reopening of the ticket, I have given it some more thought, 
and have softened my views. Jake if you're still around, perhaps there is more 
to what you said than I initially thought, and I just needed fresh eyes to see 
it. Sorry for being so slow to come around.

People may be less likely to wrongly imagine there is a single centre location 
of data if we use the term "central tendency" instead of location. I think we 
should also drop the reference to mode(), since it only works with discrete 
data and is not suitable for continuous data.

"The mean is strongly affected by outliers and is not necessarily a typical 
example of the data points. For a more robust, although less efficient, measure 
of central tendency, see median()"

How do we feel about linking to Wikipedia? I'd like to link both outliers and 
central tendency to the appropriate Wikipedia entries.

--
stage: resolved -> 
versions: +Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 
3.9 -Python 3.4

___
Python tracker 

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



[issue45554] multiprocessing exitcode is insufficiently documented

2021-12-16 Thread John Marshall


Change by John Marshall :


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

___
Python tracker 

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



[issue12681] unittest expectedFailure could take a message argument like skip does

2021-12-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Such change would break a lot of existing interfaces.

* addUnexpectedSuccess() has a single parameter. The change will add the second 
parameter and will break subclasses of TestResult.
* addExpectedFailure() has two parameter. The change will add the third 
parameter and will break subclasses of TestResult.
* unexpectedSuccesses is a list of tests. The change will make it a list of 
2-tuples and will break users of TestResult.
* expectedFailures is a list of 2-tuples. The change will make it a list of 
3-tuples and will break users of TestResult.

It is too destructive change. I think we can live without a message argument 
for expectedFailure().

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue46096] Support PyObject interface for global variables in local scope and debugger

2021-12-16 Thread Dmitry


Change by Dmitry :


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

___
Python tracker 

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



[issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls)

2021-12-16 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue46099] Solaris: Fix pthread_getcpuclockid test

2021-12-16 Thread Jakub Kulik


Change by Jakub Kulik :


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

___
Python tracker 

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



[issue20165] unittest TestResult wasSuccessful returns True when there are unexpected successes

2021-12-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

See also issue22815.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue46099] Solaris: Fix pthread_getcpuclockid test

2021-12-16 Thread Jakub Kulik


New submission from Jakub Kulik :

On Solaris, when `pthread_getcpuclockid()` is called with current thread id as 
an argument, it returns `CLOCK_THREAD_CPUTIME_ID`.

==
FAIL: test_pthread_getcpuclockid (test.test_time.TimeTestCase)
--
Traceback (most recent call last):
  File 
"/var/share/buildbot-worker/default/3.9.kulikjak-solaris-sparcv9/build/Lib/test/test_time.py",
 line 116, in test_pthread_getcpuclockid
self.assertNotEqual(clk_id, time.CLOCK_THREAD_CPUTIME_ID)
AssertionError: 2 == 2

Based on the test code, 32bit AIX seems to do the same thing so I added another 
similar code for Solaris.

--
components: Tests
messages: 408694
nosy: kulikjak
priority: normal
severity: normal
status: open
title: Solaris: Fix pthread_getcpuclockid test
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



  1   2   >