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

2022-02-16 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

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

2022-02-16 Thread Eric V. Smith
Eric V. Smith added the comment: New changeset ffd9f8ff84ed53c956b16d027f7d2926ea631051 by Eric V. Smith in branch 'main': bpo-46762: Fix an assert failure in f-strings where > or < is the last character if the f-string is missing a trailing right brace. (#31365)

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

2022-02-16 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +29520 pull_request: https://github.com/python/cpython/pull/31370 ___ Python tracker

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

2022-02-16 Thread miss-islington
Change by miss-islington : -- pull_requests: +29521 pull_request: https://github.com/python/cpython/pull/31371 ___ Python tracker ___

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

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

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

2022-02-16 Thread miss-islington
miss-islington added the comment: New changeset 3d407b931156bc3ee5ae131de2f2babad831ccb2 by Miss Islington (bot) in branch '3.10': bpo-46762: Fix an assert failure in f-strings where > or < is the last character if the f-string is missing a trailing right brace. (GH-31365)

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

2022-02-16 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Thanks for the quick fix, Eric! -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue46767] [Doc] sqlite3 Cursor.execute() return value is unspecified

2022-02-16 Thread Pierre Thierry
New submission from Pierre Thierry : In the documentation of the sqlite3 module, the return value for Connection.execute() is told to be the Cursor that was implicitly created, but nothing is said about the return value/type when using Cursor.execute(). -- components: Library (Lib)

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

2022-02-16 Thread miss-islington
miss-islington added the comment: New changeset a657bff34945e40be24cd75d02560a93b7623cf5 by Miss Islington (bot) in branch '3.9': bpo-46762: Fix an assert failure in f-strings where > or < is the last character if the f-string is missing a trailing right brace. (GH-31365)

[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-16 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: This looks similar to a previous proposal https://discuss.python.org/t/enum-for-open-modes/2445 -- nosy: +xtreak ___ Python tracker

[issue46724] Odd Bytecode Generation in 3.10

2022-02-16 Thread Mark Shannon
Mark Shannon added the comment: New changeset d4e4ef107a9fea257981d7701f023177b704a44f by Mark Shannon in branch '3.10': [3.10] bpo-46724: Use `JUMP_ABSOLUTE` for all backward jumps. (GH-31326) (GH-31354) https://github.com/python/cpython/commit/d4e4ef107a9fea257981d7701f023177b704a44f

[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-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You can create a module on PyPI. If it becomes popular we could consider including in the stdlib. -- nosy: +serhiy.storchaka resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker

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

2022-02-16 Thread Dong-hee Na
Dong-hee Na added the comment: New changeset e59309b9d0969d5c8f493cb8df28afa6f38d6273 by Dong-hee Na in branch 'main': bpo-46541: Remove usage of _Py_IDENTIFIER from dbms modules (GH-31358) https://github.com/python/cpython/commit/e59309b9d0969d5c8f493cb8df28afa6f38d6273 --

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

2022-02-16 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +29519 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31369 ___ Python tracker ___

[issue46767] [Doc] sqlite3 Cursor.execute() return value is unspecified

2022-02-16 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Quoting the docs: > This is a nonstandard shortcut that creates a cursor object by calling the > cursor() method, calls the cursor’s execute() method with the parameters > given, and returns the cursor. There is already a backlink (or back reference) to

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

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

[issue46072] Unify handling of stats in the CPython VM

2022-02-16 Thread Brandt Bucher
Brandt Bucher added the comment: New changeset 580cd9ab2992b7df6f4815020b5841e14a5a6977 by Brandt Bucher in branch 'main': bpo-46072: Add detailed failure stats for BINARY_OP (GH-31289) https://github.com/python/cpython/commit/580cd9ab2992b7df6f4815020b5841e14a5a6977 --

[issue46770] ConfigParser(dict_type=) not behaving as expected

2022-02-16 Thread Mark Lonnemann
New submission from Mark Lonnemann : ConfigParser() is not using a custom dictionary class correctly, according to my understanding. I have duplicate options in a config file that I want to rename uniquely. The following code does not work. x = 0 class MultiDict(dict): def

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

2022-02-16 Thread Eryk Sun
Eryk Sun added the comment: Python uses the volume serial number (VSN) and file ID for st_dev and st_ino. The OS allows the file ID to be 0 if the filesystem doesn't support file IDs. Also, it does not require or force the VSN to be a unique ID in the system, though if it's not 0 it's

[issue45069] python 3.9.2 contains libcrypto-1_1.dll and libssl-1_1.dll associates CVE-2021-23840\CVE-2021-3450\CVE-2021-3711\CVE-2021-3712\CVE-2021-23841\CVE-2021-3449 of openssl-1.1.1i

2022-02-16 Thread zjmxq
Change by zjmxq : -- components: -Library (Lib) title: CVE-201-4160 Vulnerability Is Found in Lib/site-packages/cryptography/hazmat/bindings/_openssl.pyd for Cryptography Version 3.3.2 -> python 3.9.2 contains libcrypto-1_1.dll and libssl-1_1.dll associates

[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-16 Thread Isaac Johnson
Isaac Johnson added the comment: Well it wouldn't need to be imported. I was working on including it inside builtins like open(). It wouldn't be very convenient if it needed to be imported. -- ___ Python tracker

[issue46768] CVE-201-4160 Vulnerability Is Found in Lib/site-packages/cryptography/hazmat/bindings/_openssl.pyd for Cryptography Version 3.3.2

2022-02-16 Thread zjmxq
Change by zjmxq : -- components: Library (Lib) nosy: zjmxq priority: normal severity: normal status: open title: CVE-201-4160 Vulnerability Is Found in Lib/site-packages/cryptography/hazmat/bindings/_openssl.pyd for Cryptography Version 3.3.2 type: security versions: Python 3.9

[issue29992] Expose parse_string in JSONDecoder

2022-02-16 Thread Tobias Oberstein
Tobias Oberstein added the comment: > It's unlikely that you would want to parse every string that looks enough > like a decimal as a decimal, or that you would want to pay the cost of > checking every string in the whole document to see if it's a decimal. fwiw, yes, that's what I do, and

[issue45069] CVE-201-4160 Vulnerability Is Found in Lib/site-packages/cryptography/hazmat/bindings/_openssl.pyd for Cryptography Version 3.3.2

2022-02-16 Thread zjmxq
Change by zjmxq : -- components: +Library (Lib) title: python 3.9.2 contains libcrypto-1_1.dll and libssl-1_1.dll associates CVE-2021-23840\CVE-2021-3450\CVE-2021-3711\CVE-2021-3712\CVE-2021-23841\CVE-2021-3449 of openssl-1.1.1i -> CVE-201-4160 Vulnerability Is Found in

[issue46329] Split up the CALL_NO_KW and CALL_KW instructions.

2022-02-16 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +29523 pull_request: https://github.com/python/cpython/pull/31373 ___ Python tracker ___

[issue46768] CVE-201-4160 Vulnerability Is Found in Lib/site-packages/cryptography/hazmat/bindings/_openssl.pyd for Cryptography Version 3.3.2

2022-02-16 Thread Christian Heimes
New submission from Christian Heimes : The file is from 3rd party package PyCA cryptography and not maintained by us. 3.3.2 is an old version of cryptography and no longer supported. I recommend that you update to cryptography 36.0.1 -- nosy: +christian.heimes resolution: -> third

[issue29418] inspect.isroutine does not return True for some bound builtin methods

2022-02-16 Thread miss-islington
miss-islington added the comment: New changeset 562c13f5734d406b2283cfca673611f4b496fdc7 by Hakan Çelik in branch 'main': bpo-29418: Implement inspect.ismethodwrapper and fix inspect.isroutine for cases where methodwrapper is given (GH-19261)

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

2022-02-16 Thread Dan Halbert
Dan Halbert added the comment: For your TODO list (not sure how else to communicate this): I agree with the de-emphasis of gather(). I think adding another version of gather() that cancels all the remaining tasks if one fails would also be good, unless you think it is completely redundant

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

2022-02-16 Thread Dong-hee Na
Dong-hee Na added the comment: New changeset b2077117d125925210148294eefee28797b7ff4c by Erlend Egeberg Aasland in branch 'main': bpo-46541: Replace _Py_IDENTIFIER with _Py_ID in sqlite3 (GH-31351) https://github.com/python/cpython/commit/b2077117d125925210148294eefee28797b7ff4c --

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

2022-02-16 Thread Dong-hee Na
Dong-hee Na added the comment: New changeset d64f3caebe8f8e31ecd193e0bd25105400153ece by Dong-hee Na in branch 'main': bpo-46541: Remove usage of _Py_IDENTIFIER from csv module (GH-31372) https://github.com/python/cpython/commit/d64f3caebe8f8e31ecd193e0bd25105400153ece --

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

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

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

2022-02-16 Thread Dong-hee Na
Dong-hee Na added the comment: New changeset e8a19b092fc0551581e10d6f310dd5feabac7609 by Dong-hee Na in branch 'main': bpo-46541: Remove usage of _Py_IDENTIFIER from mmap module (GH-31375) https://github.com/python/cpython/commit/e8a19b092fc0551581e10d6f310dd5feabac7609 --

[issue46702] Specialize UNPACK_SEQUENCE

2022-02-16 Thread Brandt Bucher
Brandt Bucher added the comment: New changeset a9da085015db8cbb81f660158864ac94fe6c67a2 by Brandt Bucher in branch 'main': bpo-46702: Specialize UNPACK_SEQUENCE (GH-31240) https://github.com/python/cpython/commit/a9da085015db8cbb81f660158864ac94fe6c67a2 --

[issue46769] Improve documentation for `typing.TypeVar`

2022-02-16 Thread Alex Waygood
New submission from Alex Waygood : There are three variants of `TypeVar`s: (1) TypeVars that are neither constrained nor bound: `T = TypeVar("T")` (2) TypeVars that are bound: `U = TypeVar("U", bound=str)` (3) TypeVars that are constrained: `V = TypeVar("V", str, bytes)` The third variant is

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Tin Tvrtković
Tin Tvrtković added the comment: I've essentially forked `async-timeout` (a very good library) into Quattro cancel scopes: https://github.com/Tinche/quattro/blob/main/src/quattro/cancelscope.py. The differences are: * the API follows Trio, so instead of `timeout` you'd use `fail_after` or

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Guido van Rossum
Guido van Rossum added the comment: Sure, we should create the best possible solution. We have no CI in the stdlib that checks type annotations, so those should probably be moved to a stub file in typeshed. (Ditto for asyncio taskgroups.py.) Using the new .cancelling()/.uncancel() API added

[issue46772] Statically Initialize PyArg_Parser in clinic.py

2022-02-16 Thread Eric Snow
New submission from Eric Snow : The code generated by clinic.py is already partially statically initialized. Currently we init the other fields in Python/getargs.c:parser_init(), which runs the first time we try to use each parser. AFAICS, that remaining init that could be done statically

[issue29418] inspect.isroutine does not return True for some bound builtin methods

2022-02-16 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue29418] inspect.isroutine does not return True for some bound builtin methods

2022-02-16 Thread Hakan Çelik
Change by Hakan Çelik : -- pull_requests: +29527 pull_request: https://github.com/python/cpython/pull/31377 ___ Python tracker ___

[issue46773] Add a Private API for Looking Up Global Objects

2022-02-16 Thread Eric Snow
New submission from Eric Snow : We need this to statically initialize PyArg_Parser.kwtuple. (See bpo-46772.) For now this will be a "private" API (leading underscore). Ultimately, we'll want a Public API, so we can eventually stop exposing *any* objects as symbols in the C-API. However,

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Alex Grönholm
Alex Grönholm added the comment: A brief explanation of cancel scopes for the uninitiated: A cancel scope can enclose just a part of a coroutine function, or an entire group of tasks. They can be nested within each other (by using them as context managers), and marked as shielded from

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

2022-02-16 Thread Eric Snow
Eric Snow added the comment: (from https://github.com/python/cpython/pull/31376#issuecomment-1041836106) [corona10] > Should we create the separate bpo issue if module changes are too noisy? I think it's fine to use the one issue. There are only 26 modules with `NEEDS_PY_IDENTIFIER` and

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Alex Grönholm
Alex Grönholm added the comment: I'm not trying to argue that asyncio should be changed to have level cancellation or even cancel scopes as built-in (at this point), but expanding the low level API to make implementing these features possible in third party libraries without the awkward

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Guido van Rossum
Guido van Rossum added the comment: OK. 1. Please have a look at how .cancelling()/.uncancel() works (there's an example of it in TaskGroup) to solve that particular problem without using the cancel message. 2. Suppose you could make (backwards compatible) changes to asyncio. What would

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

2022-02-16 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +dhalbert ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Tin Tvrtković
Tin Tvrtković added the comment: Oh, and Trio's `current_effective_deadline` is also in. -- ___ Python tracker ___ ___

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +tinchester ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2022-02-16 Thread Guido van Rossum
Guido van Rossum added the comment: @dhalbert, it's probably better to file a new issue if you want changes to gather(). Although I suppose that if we want to deemphasize it, we shouldn't be adding new features to it. My own new feature idea would be to have it wait for all tasks and then

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Guido van Rossum
Guido van Rossum added the comment: Alex, the goal here is not to replicate every Trio feature or behavior. For example I don't think that asyncio is likely to get level cancellation in 3.11, but we can certainly see if we can do something about some of the edge cases you mention, like the

[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-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: True, but you did say it would be with the io module in your original suggestion. -- ___ Python tracker ___

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Jacob Nilsson
Change by Jacob Nilsson : -- nosy: +ajoino ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Irit Katriel
Change by Irit Katriel : -- nosy: +ajoino ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46769] Improve documentation for `typing.TypeVar`

2022-02-16 Thread Guido van Rossum
Guido van Rossum added the comment: Maybe historically constrained type vars predated bound type vars. This could have influenced the way PEP 484 was written and then the docs were derived from the PEP. But yes, this should be fixed in as many places as possible (including the mypy docs,

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Guido van Rossum
New submission from Guido van Rossum : Now that TaskGroup is merged (see bpo-46752) we might consider adding some form of cancel scopes (another Trio idea). There's a sensible implementation we could use as a starting point in @asvetlov's async-timeout package

[issue46772] Statically Initialize PyArg_Parser in clinic.py

2022-02-16 Thread Eric Snow
Change by Eric Snow : -- dependencies: +Add a Private API for Looking Up Global Objects, Statically allocate and initialize the empty tuple. ___ Python tracker ___

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Alex Grönholm
Alex Grönholm added the comment: Thanks, I will take a look at .uncancel() and .cancelling(). I saw that work happening in my email feed but couldn't figure out right away how it helped, but I will definitely look into the new TaskGroup code to see how it's used there and will get back to

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

2022-02-16 Thread Guido van Rossum
Guido van Rossum added the comment: I've created a separate issue for cancel scopes: bpo-46771. -- ___ Python tracker ___ ___

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Guido van Rossum
Change by Guido van Rossum : -- keywords: +patch pull_requests: +29526 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31270 ___ Python tracker

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

2022-02-16 Thread Guido van Rossum
Guido van Rossum added the comment: I have a PR up to typeshed to add the new Task methods and a new stub file taskgroups.pyi: https://github.com/python/typeshed/pull/7240 -- ___ Python tracker

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Guido van Rossum
Guido van Rossum added the comment: Oh, wait. The new Task.cancelling() API helps tell the difference between the *parent* task being cancelled "from outside" vs. the task group itself cancelling the parent task so as to break out of an await like the following: async with TaskGroup() as g:

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Joshua Bronson
Change by Joshua Bronson : -- nosy: +jab ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2022-02-16 Thread Mark Shannon
Change by Mark Shannon : -- nosy: +brandtbucher, iritkatriel ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2022-02-16 Thread Yury Selivanov
Yury Selivanov added the comment: > There's one thing that gather() does that TaskGroup doesn't: it gives us the > return values from the tasks. That's easy to do with task groups too: async with TaskGroup() as g: r1 = g.create_task(coro1()) r2 = g.create_task(coro2())

[issue46756] Incorrect authorization check in urllib.request

2022-02-16 Thread Martin Panter
Martin Panter added the comment: Maybe the same as Issue 42766? -- nosy: +martin.panter ___ 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-16 Thread Isaac Johnson
Isaac Johnson added the comment: Well that is how it works with open. It is implemented in the io module and added to builtins. -- ___ Python tracker ___

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Guido van Rossum
Guido van Rossum added the comment: FWIW it looks like this part of taskgroups is vulnerable to a similar race: https://github.com/python/cpython/blob/6f1efd19a70839d480e4b1fcd9fecd3a8725824b/Lib/asyncio/taskgroups.py#L212-L232 Deleting the two lines I mentioned won't fix it here; a hack

[issue46750] some code paths in ssl and _socket still import idna unconditionally

2022-02-16 Thread Shivaram Lingamneni
Shivaram Lingamneni added the comment: I wanted to check in about the status of this patch. Here's the case for the patch, as I understand it: 1. It is not a novel optimization, it just consistently applies design decisions that were made previously (RFE #1472176 and bpo-22127). 2. The

[issue46774] Importlib.metadata.version picks first distribution not latest

2022-02-16 Thread Kevin Kirsche
New submission from Kevin Kirsche : When using importlib.metadata.version with tools such as poetry which may install the current package one or more times, importlib.metadata.version is not deterministic in returning the latest version of the package, instead returning the first one

[issue46774] Importlib.metadata.version picks first distribution not latest

2022-02-16 Thread Kevin Kirsche
Change by Kevin Kirsche : -- nosy: +kkirsche ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46066] Deprecate keyword args syntax for TypedDict definition

2022-02-16 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue46066] Deprecate keyword args syntax for TypedDict definition

2022-02-16 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset de6043e596492201cc1a1eb28038970bb69f3107 by 97littleleaf11 in branch 'main': bpo-46066: Deprecate kwargs syntax for TypedDict definitions (GH-31126) https://github.com/python/cpython/commit/de6043e596492201cc1a1eb28038970bb69f3107 --

[issue46775] [Windows] OSError should unconditionally call winerror_to_errno

2022-02-16 Thread Eryk Sun
New submission from Eryk Sun : bpo-37705 overlooked fixing the OSError constructor. oserror_parse_args() in Objects/exceptions.c should unconditionally call winerror_to_errno(), which is defined in PC/errmap.h. winerror_to_errno() maps the Winsock range 1-11999 directly, except for the

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

2022-02-16 Thread Christoph Reiter
Change by Christoph Reiter : -- nosy: -lazka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2022-02-16 Thread Eryk Sun
Eryk Sun added the comment: Sample implementation: import os import msvcrt import win32file def samefile(f1, f2): """Test whether two paths refer to the same file or directory.""" s1 = os.stat(f1) s2 = os.stat(f2) return _common_same_file(f1,

[issue46745] Typo in new PositionsIterator

2022-02-16 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset 482a4b6c3f8ef60056e85647a1d84af2e6dfd3ef by Robert-André Mauchin in branch 'main': bpo-46745: Fix typo in PositionsIterator (#31322) https://github.com/python/cpython/commit/482a4b6c3f8ef60056e85647a1d84af2e6dfd3ef -- nosy: +Jelle

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Guido van Rossum
Guido van Rossum added the comment: I hesitate to add yet another stack at this fundamental level. The Task.cancel() method returns a bool which indicates whether any state changed. When multiple cancellations happen concurrently, all but the first will return False, and anything that

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Alex Grönholm
Alex Grönholm added the comment: I just tried to write a snippet to demonstrate the issue in TaskGroup, but that doesn't seem possible since TaskGroup never swallows a CancelledError. It always raises/propagates _some_ exception out of __aexit__() unless of course all the child tasks run to

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

2022-02-16 Thread Dong-hee Na
Dong-hee Na added the comment: > I think it's fine to use the one issue. Great! and thank you for all your efforts :) -- ___ Python tracker ___

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Tin Tvrtković
Tin Tvrtković added the comment: The use of the cancel message is a hack, yeah. But it's what I had to work with. We could introduce a new, proper cancellation context to Tasks instead, which could be attached to the CancelError when it's raised. On the topic of multiple cancellations being

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Tin Tvrtković
Tin Tvrtković added the comment: On the topic of TaskGroups needing to know whether to swallow a child CancelledError or no: just use the same nonce/cancellation context trick? I remember asking Nathaniel about why in Trio nurseries and cancel scopes were linked (nurseries contain a cancel

[issue43275] [venv] Add a `.gitignore` file with content `*` in the root folder generated by venv module

2022-02-16 Thread Brett Cannon
Change by Brett Cannon : -- superseder: -> [venv] Adding a .gitignore file to virtual environments ___ Python tracker ___ ___

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Guido van Rossum
Guido van Rossum added the comment: Hm, I see. So the problem is that in the interval between move_on's calls to t.cancel() and t.uncancel(), if the web server calls t.cancel() that will just return False. So the web server would have to implement some other mechanism for cancelling

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Guido van Rossum
Guido van Rossum added the comment: > (I note that there is no documented way to retrieve the cancel message; > you're supposed to access the protected `_cancel_message` attribute, > apparently. Looks like we forgot something there.) Oh, it's passed to the CancelledError() constructor. But

[issue46333] ForwardRef.__eq__ does not respect module parameter

2022-02-16 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 8.0 -> 9.0 pull_requests: +29529 pull_request: https://github.com/python/cpython/pull/31379 ___ Python tracker

[issue46333] ForwardRef.__eq__ does not respect module parameter

2022-02-16 Thread miss-islington
Change by miss-islington : -- pull_requests: +29530 pull_request: https://github.com/python/cpython/pull/31380 ___ Python tracker ___

[issue46333] ForwardRef.__eq__ does not respect module parameter

2022-02-16 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: New changeset 6e7b813195f9bd6a2a15c1f00ef2c0180f6c751a by aha79 in branch 'main': bpo-46333: Honor `module` parameter in ForwardRef (GH-30536) https://github.com/python/cpython/commit/6e7b813195f9bd6a2a15c1f00ef2c0180f6c751a --

[issue46333] ForwardRef.__eq__ does not respect module parameter

2022-02-16 Thread miss-islington
miss-islington added the comment: New changeset 29ae7d3996e073ec3f15c4e7486b17c1d0e3c8f5 by Miss Islington (bot) in branch '3.9': bpo-46333: Honor `module` parameter in ForwardRef (GH-30536) https://github.com/python/cpython/commit/29ae7d3996e073ec3f15c4e7486b17c1d0e3c8f5 --

[issue46333] ForwardRef.__eq__ does not respect module parameter

2022-02-16 Thread miss-islington
miss-islington added the comment: New changeset a17d59a6df146077b5420b36c35a1b82ab3f071a by Miss Islington (bot) in branch '3.10': [3.10] bpo-46333: Honor `module` parameter in ForwardRef (GH-30536) (GH-31379) https://github.com/python/cpython/commit/a17d59a6df146077b5420b36c35a1b82ab3f071a

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

2022-02-16 Thread Dong-hee Na
Dong-hee Na added the comment: New changeset 8cb5f707a841832aeac4b01c8b6a0e72dced52ae by Dong-hee Na in branch 'main': bpo-46541: Remove usage of _Py_IDENTIFIER from array module (GH-31376) https://github.com/python/cpython/commit/8cb5f707a841832aeac4b01c8b6a0e72dced52ae --

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

2022-02-16 Thread Jason Wilkes
Change by Jason Wilkes : -- nosy: +notarealdeveloper nosy_count: 7.0 -> 8.0 pull_requests: +29528 pull_request: https://github.com/python/cpython/pull/30310 ___ Python tracker

[issue29992] Expose parse_string in JSONDecoder

2022-02-16 Thread Inada Naoki
Inada Naoki added the comment: > Generally speaking, parsing some things as decimal or datetime are schema > dependent. Totally agree with this. > In order to provide maximal flexibility it would be much nicer to have a > streaming interface available (like SAX for XML parsing), but that

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Tin Tvrtković
Tin Tvrtković added the comment: Ok, first the happy path. We have a task running this: async def a(): with move_on_after(5): await a_long_op() await something_else() `move_on_after` has scheduled a callback to run that calls `parent_task.cancel(msg=1)` 5 seconds after it was

[issue46755] QueueHandler logs stack_info twice

2022-02-16 Thread Ned Deily
Change by Ned Deily : -- nosy: +vinay.sajip ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Guido van Rossum
Guido van Rossum added the comment: @Tin The sad path is just a race, right? If the web server had disconnected just a tad later, __aexit__() would already have returned and await something_else() would already be running. So you can't make any promises if you write your code that way

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Tin Tvrtković
Tin Tvrtković added the comment: @Guido Imagine something_else() takes a long time and a lot of server resources (like a heavy query). If the web server disconnected a tad later and avoided the race condition, the task would have gotten cancelled very soon after the start of something_else()

[issue46333] ForwardRef.__eq__ does not respect module parameter

2022-02-16 Thread Jelle Zijlstra
Change by Jelle Zijlstra : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Guido van Rossum
Guido van Rossum added the comment: > > I note that there is no documented way to retrieve the cancel message > Does retrieving it from the CancelledError that is bubbling up suffice? Or do > you need to be able to obtain it from the future object? I'm not sure yet (if anything I'd need it

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Chris Jerdonek
Chris Jerdonek added the comment: > I'm not sure yet (if anything I'd need it for a task, not a future). (By future, I also meant task, as task inherits from future.) For now, I think it would be safer to get the message from the CancelledError, if possible, since how it gets there truly is

[issue46771] Add some form of cancel scopes

2022-02-16 Thread Chris Jerdonek
Chris Jerdonek added the comment: > I note that there is no documented way to retrieve the cancel message Does retrieving it from the CancelledError that is bubbling up suffice? Or do you need to be able to obtain it from the future object? -- nosy: +chris.jerdonek

[issue34526] Path.relative_to() taking multiple arguments could be better documented

2022-02-16 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch nosy: +python-dev nosy_count: 3.0 -> 4.0 pull_requests: +29518 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31368 ___ Python tracker

  1   2   >