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

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

[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 won't

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

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

[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: * argum

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

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

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

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

[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! -- ___ Py

[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

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

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

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

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

[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', machine='s39

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

[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: +vstinn

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

[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: >>> xmlrpc.client.ServerProxy('https://login:passw...@example.com').method(

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

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

[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: https://mail.pytho

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

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

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

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

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

[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

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

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

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

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

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

[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() crea

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

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

[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

[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

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

[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

[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 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?" -- ___

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

[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: 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). -- __

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

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

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

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

<    1   2