[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

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

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

[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

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

[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 Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

[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

[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

[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

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

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

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

[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
Change by Inada Naoki : -- pull_requests: +29671 pull_request: https://github.com/python/cpython/pull/31550 ___ 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

[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

[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

[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

[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

[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

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

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

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

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

2022-02-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Seems a CancelledError message can be lost also in Condition.wait(). -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue46798] xml.etree.ElementTree: get() doesn't return default value, always ATTLIST value

2022-02-23 Thread padremayi
padremayi added the comment: IMHO if the developer doesn't manage the XML itself it is VERY unreasonable to use the document value and not the developer one. At the moment the developer must predict the future changes on XML structure. For my point of view if an attribute is not present

[issue46798] xml.etree.ElementTree: get() doesn't return default value, always ATTLIST value

2022-02-23 Thread padremayi
Change by padremayi : -- status: closed -> open ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46833] Installer Wizard is unclear and has redundant settings

2022-02-23 Thread Christian Buhtz
New submission from Christian Buhtz : Hello together, this is is about the installer of Python 3.9.10 on Windows 10 64bit. I have problems to interpret the installer wizard/dialog. And my argument is that no matter if there are good reasons for the current options some of the users are

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

2022-02-23 Thread Ofey Chan
Ofey Chan added the comment: Hello, I am new to cpython project and want to help. I dig into `follow_wrapper_chains` feature and found it really interesting. In `inspect.signature()`, the conversion of `functools.partial` object's signature is made when going down the unwrap chain.

[issue26832] ProactorEventLoop doesn't support stdin/stdout nor files with connect_read_pipe/connect_write_pipe

2022-02-23 Thread Min RK
Min RK added the comment: It appears that connect_read_pipe also doesn't accept pipes returned by `os.pipe`. If that's the case, what _does_ ProactorEventLoop.connect_read_pipe accept? I haven't been able to find any examples of `connect_read_pipe` that work on Windows, and every

[issue45459] Limited API support for Py_buffer

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: > Include/object.h:109:3: warning: redefinition of typedef 'PyObject' is a C11 > feature [-Wtypedef-redefinition] Oh. I already met this error :-( That's why I proposed in GH-31201 to move all forward declarations at the top of Python.h to solve such

[issue45885] Specialize COMPARE_OP

2022-02-23 Thread Mark Shannon
Mark Shannon added the comment: New changeset 375a56bd4015596c0cf44129c8842a1fe7199785 by Brandt Bucher in branch 'main': bpo-45885: Don't un-adapt `COMPARE_OP` when collecting stats (GH-31516) https://github.com/python/cpython/commit/375a56bd4015596c0cf44129c8842a1fe7199785 --

[issue46329] Split up the CALL_NO_KW and CALL_KW instructions.

2022-02-23 Thread Mark Shannon
Mark Shannon added the comment: New changeset 424023efee5b21567b4725015ef143b627112e3c by Brandt Bucher in branch 'main': bpo-46329: Fix test failure when `Py_STATS` is enabled (GH-31511) https://github.com/python/cpython/commit/424023efee5b21567b4725015ef143b627112e3c --

[issue45459] Limited API support for Py_buffer

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

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

2022-02-23 Thread Miro Hrončok
New submission from Miro Hrončok : Recently I've been debugging a very nasty bug report that looked like this: Traceback (most recent call last): File "/usr/bin/jupyter-notebook", line 5, in from notebook.notebookapp import main File

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

2022-02-23 Thread Tzu-ping Chung
Tzu-ping Chung added the comment: Another thing to point out is that existing third-party solutions (both alru_cache and cached_property) only work for asyncio, and the stdlib version (as implemented now) will be an improvement. And if the position is that the improvements should only be

[issue46798] xml.etree.ElementTree: get() doesn't return default value, always ATTLIST value

2022-02-23 Thread padremayi
padremayi added the comment: Now: def get(self, key, default=None) Future: def get(self, key, default=None, double_value=False) No code break -- ___ Python tracker ___

[issue46834] test_gdb started to fail on buildbot/s390x RHEL7

2022-02-23 Thread Nikita Sobolev
Nikita Sobolev added the comment: Sorry, wrong link. It started to fail after this commit: https://github.com/python/cpython/commit/66b3cd7063322a9f5c922a97bbd06fdb9830 -- ___ Python tracker

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

2022-02-23 Thread Miro Hrončok
Miro Hrončok added the comment: Apparently, the exception already contains a path attribute with exactly the kind of information I'd like to see. What if the message was: ImportError: bad magic number in '/usr/bin/six.pyc': b'\x03\xf3\r\n' Would that be accepted as a PR? Should I discuss

[issue45326] Unexpected TypeError with type alias+issubclass+ABC

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

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

2022-02-23 Thread Andrew Svetlov
Andrew Svetlov added the comment: Thanks, Raymond. I agree that caching of iterators and generators is out of the issue scope. Also, I agree that a separate async cache decorator should be added. I prefer the `async_lru_cache` (and maybe `async_cache` for the API symmetry). We have

[issue46798] xml.etree.ElementTree: get() doesn't return default value, always ATTLIST value

2022-02-23 Thread Stefan Behnel
Stefan Behnel added the comment: > IMHO if the developer doesn't manage the XML itself it is VERY unreasonable > to use the document value and not the developer one. I disagree. If the document says "this is the default if no explicit value if given", then I consider that just as good as

[issue46834] test_gdb started to fail on buildbot/s390x RHEL7

2022-02-23 Thread Nikita Sobolev
New submission from Nikita Sobolev : Log sample: ``` == FAIL: test_up_then_down (test.test_gdb.StackNavigationTests) -- Traceback (most recent call last):

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

2022-02-23 Thread STINNER Victor
New submission from STINNER Victor : I propose to move the PyFrameObject structure to the internal C API. -- Between Python 3.10 and Python 3.11, the work on optimizing ceval.c modified deeply the PyFrameObject structure. Examples: * The f_code member has been removed by in bpo-44032 by

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

2022-02-23 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +29654 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31530 ___ 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 created bpo-46836: "[C API] Move PyFrameObject to the internal C API". -- ___ Python tracker ___

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

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: See also bpo-40421 "[C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API". I added getter functions in recent Python versions: * PyFrame_GetBack(): Python 3.9 * PyFrame_GetCode(): Python 3.9 *

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

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: See also bpo-44800 "Code readability: rename InterpreterFrame to _Py_framedata". -- ___ Python tracker ___

[issue46771] Add some form of cancel scopes

2022-02-23 Thread Andrew Svetlov
Andrew Svetlov added the comment: I have no good simple real-case scenario, sorry. There is a demonstration of my thoughts. Suppose we have a custom context manager that behaves similar to timeout() but is controlled not by timer but external event source (it could be an invalidation

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

[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

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

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

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

[issue45459] Limited API support for Py_buffer

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

[issue44032] Function locals and evaluation stack should be stored in a contiguous, per-thread stack

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: I created bpo-46836: "[C API] Move PyFrameObject to the internal C API". -- ___ Python tracker ___

[issue46355] [C API] Document PyFrameObject and PyThreadState changes and explain how to port code to Python 3.11

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: I created bpo-46836: "[C API] Move PyFrameObject to the internal C API". -- ___ Python tracker ___

[issue44590] Create frame objects lazily when needed

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: I created bpo-46836: "[C API] Move PyFrameObject to the internal C API". -- nosy: +vstinner ___ Python tracker ___

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

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

[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

[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

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

2022-02-23 Thread Chris Jerdonek
Chris Jerdonek added the comment: For future reference, with Andrew's change merged above, the traceback for the example snippet in my message above: https://bugs.python.org/issue45390#msg403570 is now the following. Observe that (1) the call to sleep() continues to be present, but (2)

[issue45247] [C API] Add explicit support for Cython to the C API

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: I created bpo-46836: "[C API] Move PyFrameObject to the internal C API". -- ___ Python tracker ___

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

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: See also bpo-45247: [C API] Add explicit support for Cython to the C API. -- ___ Python tracker ___

[issue46833] Installer Wizard is unclear and has redundant settings

2022-02-23 Thread Christian Buhtz
Christian Buhtz added the comment: Thank you very much for your quick replay and for taking my problems and thoughts into account. I have to dive deeper into the topic but still have some ideas how to re-design the wizard. IMHO the primary problem is that on the first page the decision

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

2022-02-23 Thread Andrew Svetlov
Andrew Svetlov added the comment: Serhiy is right, Condition.wait() has the following code: finally: # Must reacquire lock even if wait is cancelled cancelled = False while True: try: await self.acquire()

[issue46356] [C API] Enforce usage of PyFrame_GetBack()

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: I created bpo-46836: "[C API] Move PyFrameObject to the internal C API". -- ___ 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.

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

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

2022-02-23 Thread Ofey Chan
Change by Ofey Chan : -- keywords: +patch pull_requests: +29653 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/31529 ___ Python tracker

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

2022-02-23 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +Mark.Shannon, corona10, erlendaasland, petr.viktorin, scoder ___ Python tracker ___ ___

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

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: I marked my PR as a draft since this change is an incompatible change. Even if PyFrameObject structure is excluded from the limited C API and not documented, it's used by a few projects. I plan to check how this change impacts these projects before merging

[issue45184] Add `pop` function to remove context manager from (Async)ExitStack

2022-02-23 Thread Andreas H.
Andreas H. added the comment: Inside the discussion an ExitPool class is sketched (https://mail.python.org/archives/list/python-id...@python.org/message/66W55FRCYMYF73TVMDMWDLVIZK4ZDHPD/), which provides this removal of context managers. What I learned is that this would have different

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

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: See also the bpo-39947: "[C API] Make the PyThreadState structure opaque (move it to the internal C API)". Recently, I also added helper functions: * PyThreadState_GetFrame(): Python 3.9 and limited C API version 3.10 * PyThreadState_GetID(): Python 3.9 and

[issue46813] Allow developer to resize the dictionary

2022-02-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm going to close this one. Making a new and previously rejected extension to one of Python's most import APIs requires broad discussion and buy-in. If you really want to push for this, please take it to the python-ideas list. -- resolution:

[issue45107] Improve LOAD_METHOD specialization

2022-02-23 Thread Mark Shannon
Change by Mark Shannon : -- nosy: +Mark.Shannon nosy_count: 1.0 -> 2.0 pull_requests: +29655 pull_request: https://github.com/python/cpython/pull/31531 ___ Python tracker ___

[issue46806] Overlapping PYTHONPATH may cause import already imported module

2022-02-23 Thread Eric Snow
Eric Snow added the comment: FYI, a technical solution has been discussed before: bpo-13475 and PEP 395. However, that does not help so much if the default behavior isn't changed. That would require a PEP but I expect it would be rejected because so many scripts already rely on the

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

2022-02-23 Thread Ofey Chan
Change by Ofey Chan : Added file: https://bugs.python.org/file50639/update_wrapper.breaks.partial.signature.check.__wrapped__.py ___ Python tracker ___

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

2022-02-23 Thread Petr Viktorin
Petr Viktorin added the comment: I assume a PR review should be enough. -- components: +Library (Lib) -Interpreter Core ___ Python tracker ___

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

2022-02-23 Thread Ofey Chan
Ofey Chan added the comment: I fix the problem. But sorry for my last message, because it totally miss the point ;) In `inspect.signature()`, the order of handle `follow_wrapper_chains` and `functools.partial` cause the problem. Relevant code:

[issue46736] Generate HTML 5 with SimpleHTTPRequestHandler.list_directory

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

[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

[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

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

[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

[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

[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

[issue46833] Installer Wizard is unclear and has redundant settings

2022-02-23 Thread Steve Dower
Steve Dower added the comment: > I am not sure but would say that the first two options are related to the > py-launcher not the the python interpreter itself. You correctly read the options, so we'll need a suggestion on how to make it more clear without becoming impenetrable. Maybe

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

2022-02-23 Thread STINNER Victor
STINNER Victor added the comment: By the way, Include/cpython/ceval.h uses the "struct _interpreter_frame*" type whereas this type is part of the internal C API: PyAPI_FUNC(PyObject *) _PyEval_EvalFrameDefault(PyThreadState *tstate, struct _interpreter_frame *f, int exc); Maybe we should

[issue46356] [C API] Enforce usage of PyFrame_GetBack()

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

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

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

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