[issue40116] Regression in memory use of shared key dictionaries for "compact dicts"

2022-02-23 Thread Inada Naoki
Inada Naoki added the comment: PyDict_Keys(), PyDict_Values(), and PyDict_Items() don't respect insertion order too. -- ___ Python tracker ___

[issue46430] intern strings in deepfrozen modules

2022-02-23 Thread Kumar Aditya
Kumar Aditya added the comment: I have created a PR to fix the memory leak, See https://github.com/python/cpython/pull/31549 -- ___ Python tracker ___

[issue46845] dict: Use smaller entry for Unicode-key only dict.

2022-02-23 Thread Inada Naoki
New submission from Inada Naoki : Currently, PyDictKeyEntry is 24bytes (hash, key, and value). We can drop the hash from entry when all keys are unicode, because unicode objects caches hash already. This will cause some performance regression on microbenchmark because dict need one more

[issue40116] Regression in memory use of shared key dictionaries for "compact dicts"

2022-02-23 Thread Inada Naoki
Change by Inada Naoki : -- pull_requests: +29671 pull_request: https://github.com/python/cpython/pull/31550 ___ Python tracker ___

[issue46844] Context-based TaskGroup for legacy libraries

2022-02-23 Thread Joongi Kim
Joongi Kim added the comment: Ah, and this use case also requires that TaskGroup should have an option like `return_exceptions=True` which makes it not to cancel sibling tasks upon unhandled exceptions, as I suggested in PersistentTaskGroup (bpo-46843). --

[issue46430] intern strings in deepfrozen modules

2022-02-23 Thread Kumar Aditya
Change by Kumar Aditya : -- pull_requests: +29670 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31549 ___ Python tracker ___

[issue46844] Context-based TaskGroup for legacy libraries

2022-02-23 Thread Joongi Kim
Joongi Kim added the comment: An example would be like: tg = asyncio.TaskGroup() ... async with tg: with asyncio.TaskGroupBinder(tg): # just a hypothetical API asyncio.create_task(...) # equivalent to tg.create_task(...) await some_library.some_work() # all tasks are

[issue46844] Context-based TaskGroup for legacy libraries

2022-02-23 Thread Joongi Kim
Joongi Kim added the comment: My propsal is to opt-in the taskgroup binding for asyncio.create_task() under a specific context, not changing the defautl behavior. -- ___ Python tracker

[issue46844] Context-based TaskGroup for legacy libraries

2022-02-23 Thread Andrew Svetlov
Andrew Svetlov added the comment: -1 Now bare `create_task()` does fire-and-forget action. After the proposed change it will fail loudly. Even if this behavior is better it is not backward compatible. People start blaming and asking "how to return everything back?" --

[issue30677] [doc] mention that os.mkdir() raises FileNotFound if path does not exist

2022-02-23 Thread Stanley
Change by Stanley : -- keywords: +patch nosy: +slateny nosy_count: 3.0 -> 4.0 pull_requests: +29669 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31548 ___ Python tracker

[issue46844] Context-based TaskGroup for legacy libraries

2022-02-23 Thread Joongi Kim
Joongi Kim added the comment: It is also useful to write debugging/monitoring codes for asyncio applications. For instance, we could "group" tasks from different libraries and count them. -- ___ Python tracker

[issue46844] Context-based TaskGroup for legacy libraries

2022-02-23 Thread Joongi Kim
Joongi Kim added the comment: Conceptually it is similar to replace malloc using LD_PRELOAD or LD_LIBRARY_PATH manipulation. When I cannot modify the executable/library binaries, this allows replacing the functionality of specific functions. If we could assign a specific (persistent) task

[issue46844] Context-based TaskGroup for legacy libraries

2022-02-23 Thread Joongi Kim
Joongi Kim added the comment: The main benefit is that any legacy code that I cannot modify can be upgraded to TaskGroup-based codes, which offers a better machinary for exception handling and propagation. There may be different ways to visit this issue: allow replacing the task factory in

[issue40116] Regression in memory use of shared key dictionaries for "compact dicts"

2022-02-23 Thread Inada Naoki
Inada Naoki added the comment: I found regression caused by GH-28520. ``` class C: def __init__(self, n): if n: self.a = 1 self.b = 2 self.c = 3 else: self.c = 1 self.b = 2 self.a = 3 o1 = C(True) o2

[issue45991] Improve ambiguous docstrings in pkgutil

2022-02-23 Thread Stanley
Stanley added the comment: Could you expand a bit on why 'list of paths' in pkgutil is understood by default to be 'list of PosixPath paths'? I would interpret it by default to be string paths if I saw it somewhere without context -- nosy: +slateny

[issue46844] Context-based TaskGroup for legacy libraries

2022-02-23 Thread Yury Selivanov
Yury Selivanov added the comment: > I believe that this approach would allow more control over tasks implicitly > spawned by 3rd-party libraries that cannot control. Please elaborate. I'm not sure what are the benefits of this. -- ___ Python

[issue46844] Context-based TaskGroup for legacy libraries

2022-02-23 Thread Joongi Kim
New submission from Joongi Kim : Along with bpo-46843 and the new asyncio.TaskGroup API, I would like to suggest addition of context-based TaskGroup feature. Currently asyncio.create_task() just creates a new task directly attached to the event loop, while asyncio.TaskGroup.create_task()

[issue34429] [doc] On Windows tempfile.TemporaryFile behaves like NamedTemporaryFile

2022-02-23 Thread Stanley
Change by Stanley : -- keywords: +patch nosy: +slateny nosy_count: 4.0 -> 5.0 pull_requests: +29668 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31547 ___ Python tracker

[issue46843] PersistentTaskGroup API

2022-02-23 Thread Joongi Kim
New submission from Joongi Kim : I'm now tracking the recent addition and discussion of TaskGroup and cancellation scopes. It's interesting! :) I would like to suggest to have a different mode of operation in asyncio.TaskGroup, which I named "PersistentTaskGroup". AFAIK, TaskGroup targets

[issue46839] Process finished with exit code -1073741819 (0xC0000005)

2022-02-23 Thread Eryk Sun
Eryk Sun added the comment: I tried to get more information for you by installing 2.7.11 (64-bit because of the given fault) and unassembling python27.dll at the fault offset. But it doesn't help. Whatever the bug is, it ended up jumping to an address that's in the middle of an instruction.

[issue46842] py to pyc location mapping with sys.pycache_prefix isn't 1-to-1 on Windows

2022-02-23 Thread benrg
New submission from benrg : `importlib._bootstrap_external` contains this comment: # We need an absolute path to the py file to avoid the possibility of # collisions within sys.pycache_prefix [...] # [...] the idea here is that if we get `Foo\Bar`, we first # make it absolute

[issue46826] prefixes argument to site.getsitepackages() missing documentation

2022-02-23 Thread Addison Snelling
Change by Addison Snelling : -- keywords: +patch pull_requests: +29667 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31546 ___ Python tracker

[issue13475] Add '--mainpath'/'--nomainpath' command line options to override sys.path[0] initialisation

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: See also bpo-16202 "sys.path[0] security issues". -- ___ Python tracker ___ ___ Python-bugs-list

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

2022-02-23 Thread Ofey Chan
Ofey Chan added the comment: Thank you Larry. It can never be too careful to deal with language issues! > why the code behaves like this--is this behavior a genuine bug, or is it > actually a bugfix for some worse behavior? In my view, there's rather an concept needing clarify, than a

[issue46841] Inline bytecode caches

2022-02-23 Thread Brandt Bucher
Change by Brandt Bucher : -- keywords: +patch pull_requests: +29666 pull_request: https://github.com/python/cpython/pull/31543 ___ Python tracker ___

[issue46841] Inline bytecode caches

2022-02-23 Thread Brandt Bucher
New submission from Brandt Bucher : ...as discussed in https://github.com/faster-cpython/ideas/discussions/263. My plan is for this initial PR to lay the groundwork, then to work on porting over the existing opcode caches one-by-one. Once that's done, we can clean up lots of the "old"

[issue46771] Add some form of cancel scopes

2022-02-23 Thread Guido van Rossum
Guido van Rossum added the comment: New changeset 7fce1063b6e5a366f8504e039a8ccdd6944625cd by Tin Tvrtković in branch 'main': bpo-46771: Implement task cancel requests counter (GH-31513) https://github.com/python/cpython/commit/7fce1063b6e5a366f8504e039a8ccdd6944625cd --

[issue46754] Improve Python Language Reference based on [Köhl 2020]

2022-02-23 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Some specific points from the document: "While the PLR explicitly states that “x < y calls x.__lt__(y)” [20, 3.3.1.] this is actually false." They had to read the implementation to actually figure out how this works. "If no expression is provided, the PLR

[issue46430] intern strings in deepfrozen modules

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

[issue13475] Add '--mainpath'/'--nomainpath' command line options to override sys.path[0] initialisation

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: The problem of long option names is that they cannot be used in a Unix shebang: "#!/usr/bin/python3 --long-option". I propose to add the -P option to not add sys.path[0]: I wrote GH-31542. -- ___ Python tracker

[issue13475] Add '--mainpath'/'--nomainpath' command line options to override sys.path[0] initialisation

2022-02-23 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29665 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31542 ___ Python tracker ___

[issue46840] xmlrpc.client.ServerProxy shows password in __repr__ when using basic authentication

2022-02-23 Thread Jerome Perrin
New submission from Jerome Perrin : >>> import xmlrpc.client >>> xmlrpc.client.ServerProxy('https://login:passw...@example.com') Because this repr is included in error messages, this can lead to leaking the password: >>>

[issue24313] json fails to serialise numpy.int64

2022-02-23 Thread Nikolay Markov
Nikolay Markov added the comment: Just ran into this. Are there any updates? Is there any task to contribute to regarding this? -- nosy: +mxposed ___ Python tracker ___

[issue13475] Add '--mainpath'/'--nomainpath' command line options to override sys.path[0] initialisation

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: See also "Python flag/envvar not to put current directory to sys.path (but don’t ignore PYTHONPATH)" discussion: https://discuss.python.org/t/python-flag-envvar-not-to-put-current-directory-to-sys-path-but-dont-ignore-pythonpath/4235/2 -- nosy:

[issue23041] csv needs more quoting rules

2022-02-23 Thread Samwyse
Samwyse added the comment: I just signed the contributor agreement. (Thought I had done that last year but I don’t see any emails. Is there any place to check?) I agree that round-tripping should Bebe possible for any value of quoting. Hopefully this will finally get done before its eighth

[issue46623] test_zlib: test_pair() and test_speech128() fail with s390x hardware accelerator

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: I checked os.uname() value on two buildbots, by looking at their test.pythoninfo: os.uname: posix.uname_result(sysname='Linux', nodename='ztcpip3.pok.ibm.com', release='3.10.0-1160.53.1.el7.s390x', version='#1 SMP Thu Dec 16 04:33:52 EST 2021',

[issue46754] Improve Python Language Reference based on [Köhl 2020]

2022-02-23 Thread Guido van Rossum
Guido van Rossum added the comment: Another: - The description of this name binding and resolution process in the PLR [20, §4.2.] is unfortunately not particularly clear. (I found this to be the case too, and wrote up what I found: https://gvanrossum.github.io/formal/scopesblog.html

[issue46606] Large C stack usage of os.getgroups() and os.setgroups()

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: > n++; // Avoid malloc(0) > grouplist = PyMem_New(gid_t, n+1); FYI PyMem_New(0) is well specified and doesn't return NULL: https://docs.python.org/dev/c-api/memory.html#c.PyMem_Malloc -- nosy: +vstinner ___

[issue46754] Improve Python Language Reference based on [Köhl 2020]

2022-02-23 Thread Guido van Rossum
Guido van Rossum added the comment: A few examples of issues brought up by Kohl: - While the PLR explicitly states that “x < y calls x.__lt__(y)” [20, §3.3.1.] this is actually false. There are cases where x < y does not call x.__lt__(y) and there are other cases where x.__lt__(y) is

[issue46794] Please update bundled libexpat to 2.4.6 with security fixes (5 CVEs)

2022-02-23 Thread Ned Deily
Ned Deily added the comment: New changeset 15d7594d9974cfef10e65cbb01161168c42abe9d by Miss Islington (bot) in branch '3.7': bpo-46794: Bump up the libexpat version into 2.4.6 (GH-31487) (GH-31521) https://github.com/python/cpython/commit/15d7594d9974cfef10e65cbb01161168c42abe9d --

[issue46839] Process finished with exit code -1073741819 (0xC0000005)

2022-02-23 Thread Zachary Ware
Zachary Ware added the comment: 0xc005 appears to be an access violation, but beyond that there's not much we can help with here. For a start, Python 2.7 has been out of support for over 2 years now, and as far as I can easily tell Anaconda2 is no longer supported either. It is highly

[issue46838] Parameters and arguments parser syntax error improvments

2022-02-23 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Thanks a lot for the suggestions! I will try to give these a go to see if we can get them implemented. Parameter parsing is a bit hairy so not sure how lucky we will be but all of them make sense! -- ___

[issue46839] Process finished with exit code -1073741819 (0xC0000005)

2022-02-23 Thread sami
New submission from sami : Hi, I am running my python code for large data set and currently, I received this exit code: "Process finished with exit code -1073741819 (0xC005)" I monitored via Event Viewer and found the following error. I wonder how I can solve this issue? Thanks

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

2022-02-23 Thread Tin Tvrtković
Change by Tin Tvrtković : -- nosy: +tinchester nosy_count: 6.0 -> 7.0 pull_requests: +29664 pull_request: https://github.com/python/cpython/pull/31513 ___ Python tracker ___

[issue46838] Parameters and arguments parser syntax error improvments

2022-02-23 Thread Andrej Klychin
Andrej Klychin added the comment: I also sometimes write def foo(pos_only, /*, kwarg): pass. Perhaps this can be special cased with SyntaxError: expected comma between / and * -- ___ Python tracker

[issue44136] Remove pathlib flavours

2022-02-23 Thread Barney Gale
Barney Gale added the comment: ^ just to bring my previous comment up-to-date: I'm no longer pursuing adding `os.path.isreserved()` and `os.path.fileuri()` functions, or modifying `normpath()`. At least, not for now! Instead, my plan is to move flavour functionality as follows (as

[issue46838] Parameters and arguments parser syntax error improvments

2022-02-23 Thread Andrej Klychin
New submission from Andrej Klychin : I saw that pablogsal welcomed improvments to the parser's suggestions, so here are the messages for parameters and arguments lists I think should be written instead of the current generic "invalid syntax". >>> def foo(*arg, *arg): pass SyntaxError: *

[issue46430] intern strings in deepfrozen modules

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: I tried to hack _PyStaticCode_Dealloc() to free strings, but since immortal objects are half-baken today, calling Py_DECREF() does crash. Py_SETREF() should increase _Py_RefTotal if the old object is immortal and he new object is not. Maybe this change

[issue46836] [C API] Move PyFrameObject to the internal C API

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: Stefan Behnel: > I haven't looked fully into this yet, but I *think* that Cython can get rid > of most of the direct usages of PyFrameObject by switching to the new > InterpreterFrame struct instead. It looks like the important fields have now > been moved

[issue46836] [C API] Move PyFrameObject to the internal C API

2022-02-23 Thread Stefan Behnel
Stefan Behnel added the comment: I haven't looked fully into this yet, but I *think* that Cython can get rid of most of the direct usages of PyFrameObject by switching to the new InterpreterFrame struct instead. It looks like the important fields have now been moved over to that. That

[issue46430] intern strings in deepfrozen modules

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: PyUnicode_InternInPlace() in intern_strings() can convert an immortal string to a regular Python strong reference, whereas _PyStaticCode_Dealloc() doesn't bother with clearing co_names, co_consts and co_localsplusnames. --

[issue46430] intern strings in deepfrozen modules

2022-02-23 Thread Guido van Rossum
Guido van Rossum added the comment: That's pretty mysterious. The deep-freeze code isn't on the stack for either of those, but allocation of new unicode string objects is. I'm guessing these are somehow leaked by the interning, but I don't follow yet how. --

[issue45459] Limited API support for Py_buffer

2022-02-23 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29663 pull_request: https://github.com/python/cpython/pull/31539 ___ Python tracker ___

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: New changeset 8a716bc62c8205bb9deeda17422b7e69204b6897 by Victor Stinner in branch 'main': bpo-40421: What's New in Python 3.11: PyFrameObject.f_lasti (GH-31536) https://github.com/python/cpython/commit/8a716bc62c8205bb9deeda17422b7e69204b6897 --

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-23 Thread miss-islington
miss-islington added the comment: New changeset 763e23e11e785162f9d68f83539404af8e863748 by Miss Islington (bot) in branch '3.9': bpo-40421: Fix PyFrame_GetCode() documentation (GH-31535) https://github.com/python/cpython/commit/763e23e11e785162f9d68f83539404af8e863748 --

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-23 Thread miss-islington
miss-islington added the comment: New changeset b0de6299a840a397d4fe3e6c98159d9f258d3295 by Miss Islington (bot) in branch '3.10': bpo-40421: Fix PyFrame_GetCode() documentation (GH-31535) https://github.com/python/cpython/commit/b0de6299a840a397d4fe3e6c98159d9f258d3295 --

[issue46823] Add LOAD_FAST__LOAD_ATTR_INSTACE_VALUE combined opcode

2022-02-23 Thread Brandt Bucher
Change by Brandt Bucher : -- nosy: +brandtbucher ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45107] Improve LOAD_METHOD specialization

2022-02-23 Thread Brandt Bucher
Change by Brandt Bucher : -- nosy: +brandtbucher ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46754] Improve Python Language Reference based on [Köhl 2020]

2022-02-23 Thread Brandt Bucher
Change by Brandt Bucher : -- nosy: +brandtbucher ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46430] intern strings in deepfrozen modules

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: > Sure, but "leaks" caused by deep-freezing cannot be solved by freeing up the > deep-frozen memory -- the solution must be to update the accounting somewhere. Python allocates memory (ex: with PyObject_Malloc()) which is not released at exit. Two examples

[issue44337] Port LOAD_ATTR to adaptive interpreter

2022-02-23 Thread Brandt Bucher
Brandt Bucher added the comment: New changeset 281ea9c39146a00cdf3fa2b3d0be60e2a39278ce by Brandt Bucher in branch 'main': bpo-44337: Shrink the LOAD_ATTR/STORE_ATTR caches (GH-31517) https://github.com/python/cpython/commit/281ea9c39146a00cdf3fa2b3d0be60e2a39278ce --

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-23 Thread miss-islington
Change by miss-islington : -- pull_requests: +29662 pull_request: https://github.com/python/cpython/pull/31538 ___ Python tracker ___

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: New changeset 78859e58e4e016286e648d1dc155e0f6cebfa6ff by Victor Stinner in branch 'main': bpo-40421: Fix PyFrame_GetCode() documentation (GH-31535) https://github.com/python/cpython/commit/78859e58e4e016286e648d1dc155e0f6cebfa6ff --

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

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

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: > I found the uwsgi project on PyPI which uses f_lasti with PyCode_Addr2Line(). Oh, plugins/python/profiler.c uses that to define PyFrame_GetLineNumber() on Python older than 2.7, Python 3.0 and Python 3.1. In 2022, it's no longer relevant. But well, there

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: Mark Shannon: > The only purpose of `f_lasti` is to get the line number and that can be done > directly via `PyFrame_GetLineNumber(PyFrameObject *frame)` I found the uwsgi project on PyPI which uses f_lasti with PyCode_Addr2Line(). I wrote GH-31536 to

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-23 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29660 pull_request: https://github.com/python/cpython/pull/31536 ___ Python tracker ___

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: Ned Batchelder: > I went ahead and changed the coverage.py code to this: (...) I proposed a coverage PR using PyObject_GetAttrString(frame, "f_lasti") which should works on all Python versions: https://github.com/nedbat/coveragepy/pull/1331 --

[issue46771] Add some form of cancel scopes

2022-02-23 Thread Guido van Rossum
Guido van Rossum added the comment: I will now merge GH-31513 (cancel counts). Once that's in you can merge main into your timeout PR (GH-31394) and then that can land soon (I'd like to review it once more). -- ___ Python tracker

[issue46771] Add some form of cancel scopes

2022-02-23 Thread Andrew Svetlov
Andrew Svetlov added the comment: Clear, thanks! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46430] intern strings in deepfrozen modules

2022-02-23 Thread Guido van Rossum
Guido van Rossum added the comment: > Not leaking memory at exit matters when Python is embedded > in an application. Sure, but "leaks" caused by deep-freezing cannot be solved by freeing up the deep-frozen memory -- the solution must be to update the accounting somewhere. Where is the

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2022-02-23 Thread Guido van Rossum
Guido van Rossum added the comment: We should really stop appending to a closed issue. Anyway, raising ExceptionGroup is backwards incompatible, since "except CancelledError" wouldn't cancel the group. -- ___ Python tracker

[issue46430] intern strings in deepfrozen modules

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: > Presumably the leak is imaginary Well, you can check with your favorite memory debugger like Valgrind if you don't trust Python internal memory debugger :-) Not leaking memory at exit matters when Python is embedded in an application. I don't think that

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2022-02-23 Thread Thomas Grainger
Thomas Grainger added the comment: there could be multiple messages here perhaps it could be: ``` finally: # Must reacquire lock even if wait is cancelled cancelled = [] while True: try: await self.acquire()

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: > The docs for PyFrame_GetCode say it's returning an "int". Oh. I missed your comment. I created GH-31535 to fix the return type in the documentation. -- ___ Python tracker

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2022-02-23 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +29659 pull_request: https://github.com/python/cpython/pull/31535 ___ Python tracker ___

[issue46736] Generate HTML 5 with SimpleHTTPRequestHandler.list_directory

2022-02-23 Thread Benjamin Peterson
Benjamin Peterson added the comment: New changeset 0bb40a42d71873ea267aace8c92a02d66fe36dc2 by Dong-hee Na in branch 'main': closes bpo-46736: SimpleHTTPRequestHandler now uses HTML5. (GH-31533) https://github.com/python/cpython/commit/0bb40a42d71873ea267aace8c92a02d66fe36dc2 --

[issue46771] Add some form of cancel scopes

2022-02-23 Thread Yves Duprat
Change by Yves Duprat : -- nosy: +yduprat ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2022-02-23 Thread Larry Hastings
Larry Hastings added the comment: Ofey, I appreciate your enthusiasm, but you should probably slow down. Fixing the bug is probably going to be the easy part here. But we're not to that stage quite yet. First, we need to determine * why the code behaves like this--is this behavior a

[issue46835] ImportError: bad magic number in ... does not indicate where is that file located

2022-02-23 Thread Miro Hrončok
Change by Miro Hrončok : -- keywords: +patch pull_requests: +29658 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31534 ___ Python tracker ___

[issue46430] intern strings in deepfrozen modules

2022-02-23 Thread Guido van Rossum
Guido van Rossum added the comment: Okay, let's change the error handling. @Kumar, can you handle that? @Victor, the refleak is unrelated to the error handling right? Presumably the leak is imaginary -- the deep-frozen interned strings should be accounted for somehow. @Kumar do you need

[issue46837] lstrip and strip not working as expected

2022-02-23 Thread Jigar Gajjar
Change by Jigar Gajjar : -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue46837] lstrip and strip not working as expected

2022-02-23 Thread Jigar Gajjar
New submission from Jigar Gajjar : Code: my_string = 'Auth:AWS' print(my_string.lstrip('Auth:')) Actual Output: WS Excepted Output: AWS -- messages: 413831 nosy: jigar030 priority: normal severity: normal status: open title: lstrip and strip not working as expected type: behavior

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2022-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Also Future.result() and Future.exception() can raise a CancelledError. So a CancelledError raised in a task may not contain a message passed to Task.cancel(). import asyncio import random async def main(): fut = asyncio.Future() fut.cancel()

[issue46836] [C API] Move PyFrameObject to the internal C API

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: Petr Viktorin: > So, this will break Cython and gevent, This change doesn't break Cython and gevent: they are already broken. > but (unlike the optimization work that broke f_code/f_frame) it won't provide > any value to users? The problem is that the C

[issue46836] [C API] Move PyFrameObject to the internal C API

2022-02-23 Thread Petr Viktorin
Petr Viktorin added the comment: So, this will break Cython and gevent, but (unlike the optimization work that broke f_code/f_frame) it won't provide any value to users? I don't see how that's a good idea. -- ___ Python tracker

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: See also bpo-46670: "Build Python with -Wundef: don't use undefined macros". -- ___ Python tracker ___

[issue45412] [C API] Remove Py_OVERFLOWED(), Py_SET_ERRNO_ON_MATH_ERROR(), Py_ADJUST_ERANGE1()

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: New changeset 9bbdde218005f552304d9954bb97e3f9185edded by Victor Stinner in branch 'main': bpo-45412: Add _PY_SHORT_FLOAT_REPR macro (GH-31171) https://github.com/python/cpython/commit/9bbdde218005f552304d9954bb97e3f9185edded --

[issue46668] encodings: the "mbcs" alias doesn't work

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: commit ccbe8045faf6e63d36229ea4e1b9298572cda126 Author: Victor Stinner Date: Tue Feb 22 22:04:07 2022 +0100 bpo-46659: Fix the MBCS codec alias on Windows (GH-31218) -- resolution: -> fixed stage: patch review -> resolved status: open ->

[issue46430] intern strings in deepfrozen modules

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: _PyStaticCode_InternStrings() error handling is based on assert(): that's really bad. It can crash Python (exit with abort()) at the first memory allocation failure. Why not returning -1 on error? -- ___ Python

[issue46430] intern strings in deepfrozen modules

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: > This change introduced a memory leak at Python exit. It's regression related to bpo-1635741 which I fixed recently: https://mail.python.org/archives/list/python-...@python.org/thread/E4C6TDNVDPDNNP73HTGHN5W42LGAE22F/ --

[issue46430] intern strings in deepfrozen modules

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: > New changeset c0a5ebeb1239020f2ecc199053bb1a70d78841a1 by Kumar Aditya in > branch 'main': > bpo-46430: Intern strings in deep-frozen modules (GH-30683) This change introduced a memory leak at Python exit. Before: $ ./python -X showrefcount -c pass [0

[issue46829] Confusing CancelError message if multiple cancellations are scheduled

2022-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: For reference, the msg parameter of Task.cancel() was added in issue31033. It seems that the initial use case was for debugging. I do not see how it differs from the following example: r = random.random() if r < 0.5: x = 0 else:

[issue46771] Add some form of cancel scopes

2022-02-23 Thread Guido van Rossum
Guido van Rossum added the comment: To make this cleanly interact with timeout, TaskGroup etc., the CancelOnEvent class should have a "did-I-cancel" flag which is set in the _cancel_on_event() callback. Then if that flag is set it should call .uncancel(), and if that returns a value > 0, it

[issue46622] Add an async variant of lru_cache for coroutines.

2022-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: async_lru_cache() and async_cached_property() can be written using that decorator. The implementation of async_lru_cache() is complicated because the interface of lru_cache() is complicated. But it is simpler than using _lru_cache_wrapper(). def

[issue46736] Generate HTML 5 with SimpleHTTPRequestHandler.list_directory

2022-02-23 Thread Dong-hee Na
Change by Dong-hee Na : -- keywords: +patch pull_requests: +29657 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31533 ___ Python tracker ___

[issue46833] Installer Wizard is unclear and has redundant settings

2022-02-23 Thread Christian Buhtz
Christian Buhtz added the comment: In the attachment you will find a PDF with variants A to D on each side. I tried to think into the design decisions made by the team who created the current installer. I am not sure of course but I tried to take this (assumed) decisions into account.

[issue46829] Confusing CancelError message if multiple cancellations are scheduled

2022-02-23 Thread Guido van Rossum
Guido van Rossum added the comment: But that example is made-up. Is there a real-world situation where you need to know the call site, and it wouldn't be obvious from other log messages? Directly cancelling a task without also somehow catching the cancellation (like in the timeout or task

[issue46622] Add an async variant of lru_cache for coroutines.

2022-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think that it would be simpler to add a decorator which wraps the result of an asynchronous function into an object which can be awaited more than once: def reawaitable(func): @wraps(func) def wrapper(*args, **kwargs): return

[issue43311] bpo-43311: PyInterpreterState_New use thread-specific data tstate before key create .

2022-02-23 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

  1   2   >