[issue30267] Deprecate os.path.commonprefix

2022-02-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: For now, there are three uses of commonprefix() in the stdlib: 1. In urllib.request it causes a security issue (see issue46756). commonpath() or just str.startswith() should be used instead. 2. In lib2to3.main. The code contains a workaround around

[issue46730] Please consider mentioning property without setter when an attribute can't be set

2022-02-15 Thread Dennis Sweeney
Dennis Sweeney added the comment: Thanks for the PR! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue46730] Please consider mentioning property without setter when an attribute can't be set

2022-02-15 Thread Dennis Sweeney

[issue46766] Add a class for file operations so a syntax such as open("file.img", File.Write | File.Binary | File.Disk) is possible.

2022-02-15 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm sorry, I don't see why you think this will improve code readability. I also expect it will be harder to teach than the current code. open("file.img", "wb") just needs the user to learn about reading and writing files, and the difference between binary

[issue46766] Add a class for file operations so a syntax such as open("file.img", File.Write | File.Binary | File.Disk) is possible.

2022-02-15 Thread Isaac Johnson
Change by Isaac Johnson : -- type: -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46766] Add a class for file operations so a syntax such as open("file.img", File.Write | File.Binary | File.Disk) is possible.

2022-02-15 Thread Isaac Johnson
Isaac Johnson added the comment: I'm currently working on implementing this. It will probably be a few weeks. -- ___ Python tracker ___

[issue46766] Add a class for file operations so a syntax such as open("file.img", File.Write | File.Binary | File.Disk) is possible.

2022-02-15 Thread Isaac Johnson
New submission from Isaac Johnson : I think it would be great for something like this to be with the IO module. It will improve code readability. -- components: Library (Lib) messages: 413315 nosy: isaacsjohnson22 priority: normal severity: normal status: open title: Add a class for

[issue46337] urllib.parse: Allow more flexibility in schemes and URL resolution behavior

2022-02-15 Thread karl
karl added the comment: Just to note that there is a maintained list of officially accepted schemes at IANA. https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml In addition there is a list of unofficial schemes on wikipedia

[issue46764] Wrapping a bound method with a @classmethod no longer works

2022-02-15 Thread Michael J. Sullivan
Change by Michael J. Sullivan : -- keywords: +patch pull_requests: +29517 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31367 ___ Python tracker

[issue46765] Replace Locally Cached Strings with Statically Initialized Objects

2022-02-15 Thread Eric Snow
Change by Eric Snow : -- keywords: +patch pull_requests: +29516 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31366 ___ Python tracker

[issue46765] Replace Locally Cached Strings with Statically Initialized Objects

2022-02-15 Thread Eric Snow
New submission from Eric Snow : This removes a number of static variables and is a little more efficient. -- assignee: eric.snow components: Interpreter Core messages: 413313 nosy: eric.snow priority: normal severity: normal stage: needs patch status: open title: Replace Locally Cached

[issue46764] Wrapping a bound method with a @classmethod no longer works

2022-02-15 Thread Alex Waygood
Change by Alex Waygood : -- nosy: +rhettinger type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue46541] Replace _Py_IDENTIFIER() with statically initialized objects.

2022-02-15 Thread Eric Snow
Eric Snow added the comment: New changeset 4d8a515d193a4c9f3844704f974ddb870d7ee383 by Eric Snow in branch 'main': bpo-46541: Scan Fewer Files in generate_global_objects.py (gh-31364) https://github.com/python/cpython/commit/4d8a515d193a4c9f3844704f974ddb870d7ee383 --

[issue46541] Replace _Py_IDENTIFIER() with statically initialized objects.

2022-02-15 Thread Eric Snow
Eric Snow added the comment: New changeset 6c8958948666403f2370ca7b4c0a52b2010ec16d by Eric Snow in branch 'main': bpo-46541: Drop the check for orphaned global strings. (gh-31363) https://github.com/python/cpython/commit/6c8958948666403f2370ca7b4c0a52b2010ec16d --

[issue46738] Allow http.server to emit HTML 5

2022-02-15 Thread Martin Panter
Change by Martin Panter : -- superseder: -> Generate HTML 5 with SimpleHTTPRequestHandler.list_directory ___ Python tracker ___

[issue46764] Wrapping a bound method with a @classmethod no longer works

2022-02-15 Thread Michael J. Sullivan
New submission from Michael J. Sullivan : class A: def foo(self, cls): return 1 class B: pass class B: bar = classmethod(A().foo) B.bar() In Python 3.8 and prior, this worked. Since Python 3.9, it produces "TypeError: A.foo() missing 1 required positional argument: 'cls'" I

[issue46763] os.path.samefile incorrect results for shadow copies

2022-02-15 Thread Nick Venenga
Nick Venenga added the comment: This script can reproduce the issue. The computer must be a Windows computer with volume shadow copy service enabled The computer must have shadow storage added to the drive being used This script changes the host machine by creating a shadow copy (permissions

[issue46733] pathlib.Path methods can raise NotImplementedError

2022-02-15 Thread Eryk Sun
Eryk Sun added the comment: > I'm planning to learn more heavily on posixpath + ntpath in > pathlib once bpo-44136 is done. I think that would be a good > time to introduce is_mount() support on Windows. In the long run, it would be better to migrate the implementations in the other

[issue46763] os.path.samefile incorrect results for shadow copies

2022-02-15 Thread Nick Venenga
New submission from Nick Venenga : shutil.copy fails to copy a file from a shadow copy back to its original file since os.path.samefile returns True. os.path.samefile doesn't reliably detect these files are different since it relies on ino which is the same for both files >>> sc = >>>

[issue46762] assertion failure in f-string parsing Parser/string_parser.c

2022-02-15 Thread Eric V. Smith
Change by Eric V. Smith : -- keywords: +patch pull_requests: +29515 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31365 ___ Python tracker ___

[issue46541] Replace _Py_IDENTIFIER() with statically initialized objects.

2022-02-15 Thread Eric Snow
Change by Eric Snow : -- pull_requests: +29514 pull_request: https://github.com/python/cpython/pull/31364 ___ Python tracker ___

[issue46541] Replace _Py_IDENTIFIER() with statically initialized objects.

2022-02-15 Thread Eric Snow
Change by Eric Snow : -- pull_requests: +29513 pull_request: https://github.com/python/cpython/pull/31363 ___ Python tracker ___

[issue46752] Introduce task groups to asyncio and change task cancellation semantics

2022-02-15 Thread Guido van Rossum
Guido van Rossum added the comment: Remaining TODO list: - Add a test showing the need for the .uncancel() call in __aexit__() (currently on line 97). Dropping that line does not cause any tests to fail. - Ensure the taskgroup tests are run with the C and Python Task implementations. -

[issue46752] Introduce task groups to asyncio and change task cancellation semantics

2022-02-15 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 602630ac1855e38ef06361c68f6e216375a06180 by Guido van Rossum in branch 'main': bpo-46752: Add TaskGroup; add Task..cancelled(),.uncancel() (GH-31270) https://github.com/python/cpython/commit/602630ac1855e38ef06361c68f6e216375a06180

[issue46737] Default to the standard normal distribution

2022-02-15 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue44445] Add `site-include` install scheme path in sysconfig

2022-02-15 Thread Stefano Rivera
Change by Stefano Rivera : -- nosy: +stefanor ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46737] Default to the standard normal distribution

2022-02-15 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 08ec80113b3b7f7a9eaa3d217494536b63305181 by Zackery Spytz in branch 'main': bpo-46737: Add default arguments to random.gauss and normalvariate (GH-31360) https://github.com/python/cpython/commit/08ec80113b3b7f7a9eaa3d217494536b63305181

[issue43976] Allow Python distributors to add custom site install schemes

2022-02-15 Thread Stefano Rivera
Change by Stefano Rivera : -- nosy: +stefanor ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46762] assertion failure in f-string parsing Parser/string_parser.c

2022-02-15 Thread Eric V. Smith
Eric V. Smith added the comment: Good catch! I'll have a patch tonight. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue46762] assertion failure in f-string parsing Parser/string_parser.c

2022-02-15 Thread Ammar Askar
New submission from Ammar Askar : Similar to https://bugs.python.org/issue46503 found by the ast.literal_eval fuzzer ``` >>> f'{<' python: Parser/string_parser.c:346: fstring_compile_expr: Assertion `*expr_end == '}' || *expr_end == '!' || *expr_end == ':' || *expr_end == '='' failed. [1]

[issue46738] Allow http.server to emit HTML 5

2022-02-15 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Looks like this is a duplicate of issue46736. Seems like a good idea though! -- nosy: +Jelle Zijlstra resolution: -> duplicate stage: -> resolved status: open -> closed ___ Python tracker

[issue46318] asyncio and ssl: ResourceWarning: unclosed transport

2022-02-15 Thread Andrew Svetlov
Andrew Svetlov added the comment: Please check against the latest master. It has rewritten SSL protocol implementation borrowed from uvloop. See #44011 for details -- ___ Python tracker

[issue46761] functools.update_wrapper breaks the signature of functools.partial objects

2022-02-15 Thread Larry Hastings
New submission from Larry Hastings : It's considered good hygiene to use functools.update_wrapper() to make your wrapped functions look like the original. However, when using functools.partial() to pre-supply arguments to a function, if you then call functools.update_wrapper() to update

[issue46760] test_dis should test the dis module, not everything else

2022-02-15 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- nosy: +Jelle Zijlstra ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46733] pathlib.Path methods can raise NotImplementedError

2022-02-15 Thread Barney Gale
Barney Gale added the comment: I'm planning to learn more heavily on posixpath + ntpath in pathlib once bpo-44136 is done. I think that would be a good time to introduce is_mount() support on Windows. -- ___ Python tracker

[issue46741] Docstring for asyncio.protocols.BufferedProtocol appears out of date

2022-02-15 Thread Andrew Svetlov
Change by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue46741] Docstring for asyncio.protocols.BufferedProtocol appears out of date

2022-02-15 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 72c46462aa9fd0a69317917ba127e62f94ce08d7 by Miss Islington (bot) in branch '3.10': bpo-46741: Update `asyncio.protocols.BufferedProtocol` docstring (GH-31327) (GH-31362)

[issue46741] Docstring for asyncio.protocols.BufferedProtocol appears out of date

2022-02-15 Thread miss-islington
miss-islington added the comment: New changeset c292118ef3528df85a9d76ad21029009b560b088 by Miss Islington (bot) in branch '3.9': bpo-46741: Update `asyncio.protocols.BufferedProtocol` docstring (31327) https://github.com/python/cpython/commit/c292118ef3528df85a9d76ad21029009b560b088

[issue46741] Docstring for asyncio.protocols.BufferedProtocol appears out of date

2022-02-15 Thread miss-islington
Change by miss-islington : -- pull_requests: +29512 pull_request: https://github.com/python/cpython/pull/31362 ___ Python tracker ___

[issue46741] Docstring for asyncio.protocols.BufferedProtocol appears out of date

2022-02-15 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 1d81fdc4c004511c25f74db0e04ddbbb8a04ce6d by Alex Waygood in branch 'main': bpo-46741: Update `asyncio.protocols.BufferedProtocol` docstring (31327) https://github.com/python/cpython/commit/1d81fdc4c004511c25f74db0e04ddbbb8a04ce6d --

[issue46741] Docstring for asyncio.protocols.BufferedProtocol appears out of date

2022-02-15 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 4.0 -> 5.0 pull_requests: +29511 pull_request: https://github.com/python/cpython/pull/31361 ___ Python tracker

[issue46744] installers on ARM64 suggest wrong folders

2022-02-15 Thread Steve Dower
Steve Dower added the comment: Yeah, currently the only detection that happens is OS version, and just so we can block (or at least log) users who are trying to install on supported versions. The install directories are unconditional. Any dynamic detection code would have to go into

[issue46737] Default to the standard normal distribution

2022-02-15 Thread Zackery Spytz
Zackery Spytz added the comment: I have created a patch for this issue. Please consider having a look. -- ___ Python tracker ___

[issue46737] Default to the standard normal distribution

2022-02-15 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch nosy: +ZackerySpytz nosy_count: 2.0 -> 3.0 pull_requests: +29510 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31360 ___ Python tracker

[issue20923] [doc] Explain ConfigParser 'valid section name' and .SECTCRE

2022-02-15 Thread Vidhya
Vidhya added the comment: Thanks. A pull request is created at https://github.com/python/cpython/pull/31359. -- ___ Python tracker ___

[issue20923] [doc] Explain ConfigParser 'valid section name' and .SECTCRE

2022-02-15 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch nosy: +python-dev nosy_count: 10.0 -> 11.0 pull_requests: +29509 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31359 ___ Python tracker

[issue46760] test_dis should test the dis module, not everything else

2022-02-15 Thread Mark Shannon
New submission from Mark Shannon : This is getting really annoying. It takes longer to fix all the heavily coupled and poorly written tests in test_dis than to make the real changes. Tiny changes in the calling sequence, or reordering CFGs, cause huge diffs in the test_dis module. No one

[issue46728] Docstring of combinations_with_replacement for consistency

2022-02-15 Thread DongGeon Lee
DongGeon Lee added the comment: My pleasure :) -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46541] Replace _Py_IDENTIFIER() with statically initialized objects.

2022-02-15 Thread Dong-hee Na
Change by Dong-hee Na : -- pull_requests: +29508 pull_request: https://github.com/python/cpython/pull/31358 ___ Python tracker ___

[issue44011] Borrow asyncio ssl implementation from uvloop

2022-02-15 Thread Andrew Svetlov
Change by Andrew Svetlov : -- priority: critical -> normal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44011] Borrow asyncio ssl implementation from uvloop

2022-02-15 Thread Andrew Svetlov
Andrew Svetlov added the comment: The code had landed. Need a follow-up PR with documentation update (mention new ssl_shutdown_timeout arguments) -- ___ Python tracker ___

[issue44011] Borrow asyncio ssl implementation from uvloop

2022-02-15 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 13c10bfb777483c7b02877aab029345a056b809c by Kumar Aditya in branch 'main': bpo-44011: New asyncio ssl implementation (#31275) https://github.com/python/cpython/commit/13c10bfb777483c7b02877aab029345a056b809c --

[issue46541] Replace _Py_IDENTIFIER() with statically initialized objects.

2022-02-15 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46728] Docstring of combinations_with_replacement for consistency

2022-02-15 Thread Dong-hee Na
Dong-hee Na added the comment: Thank you DongGeon :) -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue46728] Docstring of combinations_with_replacement for consistency

2022-02-15 Thread Dong-hee Na
Dong-hee Na added the comment: New changeset ad47db34be23c5cd75ed5d5c220d4b56a9b5683c by DongGeon Lee in branch '3.9': [3.9] bpo-46728: fix docstring of combinations_with_replacement for consistency (GH-31293). (GH-31356)

[issue46759] sys.excepthook documentation doesn't mention that it isn't called for SystemExit

2022-02-15 Thread Colin Watson
Change by Colin Watson : -- keywords: +patch pull_requests: +29507 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31357 ___ Python tracker ___

[issue46759] sys.excepthook documentation doesn't mention that it isn't called for SystemExit

2022-02-15 Thread Colin Watson
New submission from Colin Watson : In https://bugs.debian.org/1005803, Matthew Vernon reports that the library documentation for sys.excepthook doesn't mention the detail that that sys.excepthook isn't called for uncaught SystemExit exceptions, although help(sys) does mention this. (He also

[issue46758] Incorrect behaviour creating a Structure with ctypes.c_bool bitfields

2022-02-15 Thread SIGSEG V
New submission from SIGSEG V : Setting/getting values in a Structure containing multiple c_bool bitfields like: _fields_ = [ ('one', c_bool, 1), ('two', c_bool, 1), ] results in an unexpected behavior. Setting any one of these fields to `True` results in ALL of these fields being set to

[issue46757] dataclasses should define an empty __post_init__

2022-02-15 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46757] dataclasses should define an empty __post_init__

2022-02-15 Thread Neil Girdhar
New submission from Neil Girdhar : When defining a dataclass, it's possible to define a post-init (__post_init__) method to, for example, verify contracts. Sometimes, when you inherit from another dataclass, that dataclass has its own post-init method. If you want that method to also do its

[issue46728] Docstring of combinations_with_replacement for consistency

2022-02-15 Thread Dong-hee Na
Dong-hee Na added the comment: New changeset ac55cea3cbee4d40cf7320bd691f5327cff30f13 by DongGeon Lee in branch '3.10': [3.10] bpo-46728: fix docstring of combinations_with_replacement for consistency (GH-31293) (GH-31350)

[issue46728] Docstring of combinations_with_replacement for consistency

2022-02-15 Thread DongGeon Lee
Change by DongGeon Lee : -- pull_requests: +29506 pull_request: https://github.com/python/cpython/pull/31356 ___ Python tracker ___

[issue46755] QueueHandler logs stack_info twice

2022-02-15 Thread Erik Montnemery
Change by Erik Montnemery : -- keywords: +patch nosy: +emontnemery nosy_count: 1.0 -> 2.0 pull_requests: +29504 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31355 ___ Python tracker

[issue31084] QueueHandler not formatting messages

2022-02-15 Thread Erik Montnemery
Change by Erik Montnemery : -- nosy: +emontnemery nosy_count: 2.0 -> 3.0 pull_requests: +29505 pull_request: https://github.com/python/cpython/pull/31355 ___ Python tracker

[issue46728] Docstring of combinations_with_replacement for consistency

2022-02-15 Thread Dong-hee Na
Dong-hee Na added the comment: @LeeDongGeon1996 Please send the backported patch to 3.9 also -- ___ Python tracker ___ ___

[issue46728] Docstring of combinations_with_replacement for consistency

2022-02-15 Thread Dong-hee Na
Change by Dong-hee Na : -- versions: -Python 3.7, Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46724] Odd Bytecode Generation in 3.10

2022-02-15 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +29503 pull_request: https://github.com/python/cpython/pull/31354 ___ Python tracker ___

[issue46756] Incorrect authorization check in urllib.request

2022-02-15 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- title: Incorrect -> Incorrect authorization check in urllib.request ___ Python tracker ___ ___

[issue46756] Incorrect

2022-02-15 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +29502 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31353 ___ Python tracker

[issue46756] Incorrect

2022-02-15 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : There is an error in determining a sub-URI in the urllib.request module. Due to it, if the user is authorized for example.org/foo, it gets also access to example.org/foobar. -- components: Library (Lib) messages: 413280 nosy: orsenthil,

[issue46724] Odd Bytecode Generation in 3.10

2022-02-15 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +29501 pull_request: https://github.com/python/cpython/pull/31352 ___ Python tracker ___

[issue46541] Replace _Py_IDENTIFIER() with statically initialized objects.

2022-02-15 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- nosy: +erlendaasland nosy_count: 5.0 -> 6.0 pull_requests: +29500 pull_request: https://github.com/python/cpython/pull/31351 ___ Python tracker

[issue46724] Odd Bytecode Generation in 3.10

2022-02-15 Thread Mark Shannon
Mark Shannon added the comment: New changeset 3be1a443ca8e7d4ba85f95b78df5c4122cae9ede by Mark Shannon in branch 'main': bpo-46724: Use `JUMP_ABSOLUTE` for all backward jumps. (GH-31326) https://github.com/python/cpython/commit/3be1a443ca8e7d4ba85f95b78df5c4122cae9ede --

[issue46728] Docstring of combinations_with_replacement for consistency

2022-02-15 Thread DongGeon Lee
Change by DongGeon Lee : -- pull_requests: +29499 pull_request: https://github.com/python/cpython/pull/31350 ___ Python tracker ___

[issue46755] QueueHandler logs stack_info twice

2022-02-15 Thread Erik Montnemery
New submission from Erik Montnemery : logging.handlers.QueueHandler logs stack twice when stack_info=True: >>> import logging >>> from logging.handlers import QueueHandler, QueueListener >>> from queue import Queue >>> q = Queue() >>> logging.getLogger().addHandler(QueueHandler(q)) >>>