[issue42819] readline 8.1 bracketed paste

2021-01-18 Thread Dustin Rodrigues
Dustin Rodrigues added the comment: The linked PR disables bracketed paste regardless of if the user has it as a configuration option or if Python was configured with a version of readline which defaults to on for bracketed paste. Is this a viable approach? --

[issue42964] Draft PEP blob etc

2021-01-18 Thread Larry Hastings
Larry Hastings added the comment: (Oops, meant to send that as a private email. Sorry for the noise, I'll try to be more careful in the future.) -- ___ Python tracker ___

[issue42964] Draft PEP blob etc

2021-01-18 Thread Larry Hastings
New submission from Larry Hastings : You interested in me doing an editing pass / critique of your PEP?  I just poked around on Github, and I don't think I can do one of those inline code review things until it's a PR. Also, I'm a PEP editor, I can get it assigned a PEP number when you're

[issue42888] Not installed “libgcc_s.so.1” causes exit crash.

2021-01-18 Thread Xinmeng Xia
Xinmeng Xia added the comment: I think the crash is fixed by this PR. I try other arguments. No crash is reported. Thank you! -- ___ Python tracker ___

[issue42888] Not installed “libgcc_s.so.1” causes exit crash.

2021-01-18 Thread Xinmeng Xia
Xinmeng Xia added the comment: No crash is reported anymore. The result is like following: - ... OSError: [Errno 24] Too many open files OSError: [Errno 24] Too many open files OSError: [Errno 24] Too many open files OSError: [Errno 24] Too many

[issue42959] AttributeError: module 'signal' has no attribute 'SIGHUP'

2021-01-18 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42963] [multiprocessing] Calling pool.terminate() from an error_callback causes deadlock

2021-01-18 Thread Sammy Jelin
Change by Sammy Jelin : -- type: -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42963] [multiprocessing] Calling pool.terminate() from an error_callback causes deadlock

2021-01-18 Thread Sammy Jelin
New submission from Sammy Jelin : As the title says, calling `pool.terminate()` inside an `error_callback` handler causes a deadlock. The deadlock always happens, so it's not a race condition or thread-safety issue. Simple repro: ``` from multiprocessing import Pool p = Pool() def

[issue31356] Add context manager to temporarily disable GC

2021-01-18 Thread Bar Harel
Change by Bar Harel : -- nosy: +Dennis Sweeney ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42962] Windows: SystemError during os.kill(..., signal.CTRL_C_EVENT)

2021-01-18 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42962] Windows: SystemError during os.kill(..., signal.CTRL_C_EVENT)

2021-01-18 Thread William Schwartz
William Schwartz added the comment: > In Windows, os.kill() is a rather confused function. I know how it feels. To be honest, I don't have an opinion about whether the steps I laid out ought to work. I just reported it because the SystemError indicates that a C-API function was returning

[issue42923] Py_FatalError(): dump the list of extension modules

2021-01-18 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +23076 pull_request: https://github.com/python/cpython/pull/24238 ___ Python tracker ___

[issue42955] Add sys.module_names: list of stdlib module names (Python and extension modules)

2021-01-18 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +23075 pull_request: https://github.com/python/cpython/pull/24254 ___ Python tracker ___

[issue42923] Py_FatalError(): dump the list of extension modules

2021-01-18 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +23074 pull_request: https://github.com/python/cpython/pull/24254 ___ Python tracker ___

[issue42962] Windows: SystemError during os.kill(..., signal.CTRL_C_EVENT)

2021-01-18 Thread Eryk Sun
Eryk Sun added the comment: > 4. In console A, type the PID from console B and execute the command. In Windows, os.kill() is a rather confused function. In particular, it confuses a process ID (pid) with a process group ID (pgid). If the signal is CTRL_C_EVENT or CTRL_BREAK_EVENT, it first

[issue42959] AttributeError: module 'signal' has no attribute 'SIGHUP'

2021-01-18 Thread Eryk Sun
Eryk Sun added the comment: FYI, Windows is not a POSIX operating system and does not implement Unix signals in the kernel. That said, the C language serves as a base level of cross-platform support for language runtimes across most operating systems, and there's significant coupling

[issue42962] Windows: SystemError during os.kill(..., signal.CTRL_C_EVENT)

2021-01-18 Thread Petr Viktorin
Change by Petr Viktorin : -- nosy: -petr.viktorin ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42938] [security] ctypes double representation BoF

2021-01-18 Thread STINNER Victor
STINNER Victor added the comment: FYI I created https://python-security.readthedocs.io/vuln/ctypes-buffer-overflow-pycarg_repr.html to track fixes of this issue. -- ___ Python tracker

[issue42962] Windows: SystemError during os.kill(..., signal.CTRL_C_EVENT)

2021-01-18 Thread William Schwartz
New submission from William Schwartz : I don't have an automated test at this time, but here's how to get os.kill to raise SystemError. I did this on Windows 10 version 20H2 (build 19042.746) with Pythons 3.7.7, 3.8.5, and 3.9.1. os_kill_impl at Modules/posixmodule.c:7833 does not appear to

[issue42938] [security] ctypes double representation BoF

2021-01-18 Thread Ned Deily
Change by Ned Deily : -- keywords: +security_issue priority: normal -> high versions: +Python 3.6, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker ___

[issue42938] [security] ctypes double representation BoF

2021-01-18 Thread Benjamin Peterson
Benjamin Peterson added the comment: New changeset c347cbe694743cee120457aa6626712f7799a932 by Miss Islington (bot) in branch '3.9': closes bpo-42938: Replace snprintf with Python unicode formatting in ctypes param reprs. (GH-24247)

[issue42938] [security] ctypes double representation BoF

2021-01-18 Thread Benjamin Peterson
Benjamin Peterson added the comment: New changeset ece5dfd403dac211f8d3c72701fe7ba7b7aa5b5f by Miss Islington (bot) in branch '3.8': closes bpo-42938: Replace snprintf with Python unicode formatting in ctypes param reprs. (GH-24248)

[issue42957] os.readlink produces wrong result on windows

2021-01-18 Thread Eryk Sun
Eryk Sun added the comment: Symlinks and mountpoints (aka junctions) contain two forms of the target path. There's a path that's intended for display in the shell, and there's the actual substitute path to which the link resolves. os.readlink() was changed to return the substitute path

[issue42938] [security] ctypes double representation BoF

2021-01-18 Thread Benjamin Peterson
Benjamin Peterson added the comment: New changeset d9b8f138b7df3b455b54653ca59f491b4840d6fa by Benjamin Peterson in branch '3.7': [3.7] closes bpo-42938: Replace snprintf with Python unicode formatting in ctypes param reprs. (GH-24249)

[issue42961] Use-after-free (of a heap type) during finalization

2021-01-18 Thread Yannick Jadoul
Change by Yannick Jadoul : -- nosy: +YannickJadoul ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42961] Use-after-free (of a heap type) during finalization

2021-01-18 Thread Boris Staletic

[issue42938] [security] ctypes double representation BoF

2021-01-18 Thread Benjamin Peterson
Benjamin Peterson added the comment: New changeset 34df10a9a16b38d54421eeeaf73ec89828563be7 by Benjamin Peterson in branch '3.6': [3.6] closes bpo-42938: Replace snprintf with Python unicode formatting in ctypes param reprs. (GH-24250)

[issue42960] resources module, FreeBSD update adding RLIMIT_KQUEUES constant

2021-01-18 Thread David CARLIER
Change by David CARLIER : -- components: FreeBSD nosy: devnexen, koobs priority: normal pull_requests: 23073 severity: normal status: open title: resources module, FreeBSD update adding RLIMIT_KQUEUES constant versions: Python 3.10 ___ Python

[issue36143] Auto-generate Lib/keyword.py

2021-01-18 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42959] AttributeError: module 'signal' has no attribute 'SIGHUP'

2021-01-18 Thread Guido van Rossum
Guido van Rossum added the comment: As the docs explain, SIGHUP is not available on Windows. This is as designed. -- nosy: +gvanrossum resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue42938] [security] ctypes double representation BoF

2021-01-18 Thread Benjamin Peterson
Change by Benjamin Peterson : -- pull_requests: +23072 pull_request: https://github.com/python/cpython/pull/24250 ___ Python tracker ___

[issue42938] [security] ctypes double representation BoF

2021-01-18 Thread Benjamin Peterson
Change by Benjamin Peterson : -- pull_requests: +23071 pull_request: https://github.com/python/cpython/pull/24249 ___ Python tracker ___

[issue42959] AttributeError: module 'signal' has no attribute 'SIGHUP'

2021-01-18 Thread Joel Ewaldo
New submission from Joel Ewaldo : I have already tried uninstalling and reinstalling python 3.7.9 via the 64-bit installer on the official python website. Also, I am on the latest version of windows. I have also made sure that signal.py was not a file in my directory and when I import

[issue42938] [security] ctypes double representation BoF

2021-01-18 Thread miss-islington
Change by miss-islington : -- pull_requests: +23070 pull_request: https://github.com/python/cpython/pull/24248 ___ Python tracker ___

[issue42938] [security] ctypes double representation BoF

2021-01-18 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +23069 pull_request: https://github.com/python/cpython/pull/24247 ___ Python tracker

[issue42938] [security] ctypes double representation BoF

2021-01-18 Thread Benjamin Peterson
Benjamin Peterson added the comment: New changeset 916610ef90a0d0761f08747f7b0905541f0977c7 by Benjamin Peterson in branch 'master': closes bpo-42938: Replace snprintf with Python unicode formatting in ctypes param reprs. (24239)

[issue42958] filecmp.cmp(shallow=True) isn't actually shallow when only mtime differs

2021-01-18 Thread Alexander Vandenbulcke
Change by Alexander Vandenbulcke : -- keywords: +patch pull_requests: +23067 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24246 ___ Python tracker

[issue42958] filecmp.cmp(shallow=True) isn't actually shallow when only mtime differs

2021-01-18 Thread Alexander Vandenbulcke
New submission from Alexander Vandenbulcke : Consider the case where 2 files are shallow compared where only the mtime differs (i.e. the mode and size is identical). With filecmp.cmp(f1, f2, shallow=True) a deep compare would be performed behind the scenes since the guard clauses fell

[issue36143] Auto-generate Lib/keyword.py

2021-01-18 Thread STINNER Victor
STINNER Victor added the comment: New changeset 6a809fa01f59bb00f4029d35d132cd87553554c3 by Victor Stinner in branch 'master': bpo-36143: make regen-all now also runs regen-keyword (GH-24245) https://github.com/python/cpython/commit/6a809fa01f59bb00f4029d35d132cd87553554c3 --

[issue42725] PEP 563: Should the behavior change for yield/yield from's

2021-01-18 Thread Guido van Rossum
Guido van Rossum added the comment: I'm not keen on prohibiting nonlocal variable reference in annotations, since I can imagine uses for this (e.g. in tests). I'm not too worried about keeping the cell alive "forever", since with Larry's PEP 649 their lifetime would end when the object

[issue36143] Auto-generate Lib/keyword.py

2021-01-18 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +23066 pull_request: https://github.com/python/cpython/pull/24245 ___ Python tracker ___

[issue42923] Py_FatalError(): dump the list of extension modules

2021-01-18 Thread STINNER Victor
STINNER Victor added the comment: I created https://bugs.python.org/issue42955 to add sys.modules_names tuple: names of stdlib modules. Once it will be merged, I will updated this PR to filter the list of modules (ignore stdlib modules). -- ___

[issue42923] Py_FatalError(): dump the list of extension modules

2021-01-18 Thread STINNER Victor
STINNER Victor added the comment: New changeset 250035d134ad482e724f73ce654682254b513ee0 by Victor Stinner in branch 'master': bpo-42923: Dump extension modules on fatal error (GH-24207) https://github.com/python/cpython/commit/250035d134ad482e724f73ce654682254b513ee0 --

[issue42956] Easy conversion between range and slice

2021-01-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: Perhaps the indices() method will suffice: >>> slice(None, 10, 2).indices(8) (0, 8, 2) >>> range(8)[:10:2] range(0, 8, 2) -- nosy: +rhettinger ___ Python tracker

[issue42953] After the subclass of enum.Enum is imported in some diffenent ways, the same enumeration value is judged as False

2021-01-18 Thread Ethan Furman
Ethan Furman added the comment: This issue is not unique to Enum, and is not an Enum problem. What is happening is that "test.py" has the `__name__` of `__main__` because it is being directly executed from the command line, but when `test2.py` imports it, it is being re-executed and

[issue42957] os.readlink produces wrong result on windows

2021-01-18 Thread simon mackenzie
New submission from simon mackenzie : os.readlink gives wrong result on python 3.8 onwards for windows os.readlink("c:/users/simon/v1") '?\\d:\\v1' Should read d:\\v1 -- components: Windows messages: 385218 nosy: paul.moore, simon mackenzie, steve.dower, tim.golden, zach.ware

[issue42725] PEP 563: Should the behavior change for yield/yield from's

2021-01-18 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: > The use of nonlocal variables in an annotation will be a syntax error in > Python 3.10 What is the reasoning for forbidding nonlocal variables (https://bugs.python.org/msg383659), can't we just treat them like regular variables and leave the value to

[issue42944] random.Random.sample bug when counts is not None

2021-01-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the report and the PR. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue42944] random.Random.sample bug when counts is not None

2021-01-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset a90539f5723a4c34430761be8cba97daa8474abf by Miss Islington (bot) in branch '3.9': bpo-42944 Fix Random.sample when counts is not None (GH-24235) (GH-24243) https://github.com/python/cpython/commit/a90539f5723a4c34430761be8cba97daa8474abf

[issue31356] Add context manager to temporarily disable GC

2021-01-18 Thread Bar Harel
Bar Harel added the comment: I've taken a shot making this in pure Python, and took into account a few more factors such as starvation and reentrancy. As Nick said, one of the only ways it can truly work is if it's completely global, in which case we don't need to use the internal lock and

[issue31356] Add context manager to temporarily disable GC

2021-01-18 Thread Dennis Sweeney
Dennis Sweeney added the comment: https://bugs.python.org/issue41545 is a duplicate of this. In that report, there's an example of something that can go wrong with the save-a-boolean-per-context-manager approach even when threads are not used, but when concurrent generators are used, like

[issue41545] gc API requiring matching number of gc.disable - gc.enable calls

2021-01-18 Thread Dennis Sweeney
Dennis Sweeney added the comment: It looks like this was a duplicate of https://bugs.python.org/issue31356 -- ___ Python tracker ___

[issue42913] asyncio.ProactorEventLoop mishandles signal wakeup file descriptor

2021-01-18 Thread Guido van Rossum
Guido van Rossum added the comment: No pressure. If there's an API change needed you will have until 3.10 beta 1. Without API changes this can be fixed any time. -- ___ Python tracker

[issue42725] PEP 563: Should the behavior change for yield/yield from's

2021-01-18 Thread Guido van Rossum
Guido van Rossum added the comment: It'll probably be quicker if you leave me out of the loop (feel free to quote me though). I am currently quite overwhelmed with PEP-sized discussions. I expect that the SC can rule on this quickly (just use their tracker to send them the PEP). --

[issue42944] random.Random.sample bug when counts is not None

2021-01-18 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 2.0 -> 3.0 pull_requests: +23065 pull_request: https://github.com/python/cpython/pull/24243 ___ Python tracker

[issue42944] random.Random.sample bug when counts is not None

2021-01-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset f7b5bacd7a0b2084ce699eda6f6f4b1adfa16590 by jonanifranco in branch 'master': bpo-42944 Fix Random.sample when counts is not None (GH-24235) https://github.com/python/cpython/commit/f7b5bacd7a0b2084ce699eda6f6f4b1adfa16590 --

[issue31356] Add context manager to temporarily disable GC

2021-01-18 Thread Bar Harel
Change by Bar Harel : -- nosy: +bar.harel ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42955] Add sys.module_names: list of stdlib module names (Python and extension modules)

2021-01-18 Thread STINNER Victor
STINNER Victor added the comment: Note for myself: regen-keyword should be included in "make regen-all". -- ___ Python tracker ___

[issue42953] After the subclass of enum.Enum is imported in some diffenent ways, the same enumeration value is judged as False

2021-01-18 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +ethan.furman ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42923] Py_FatalError(): dump the list of extension modules

2021-01-18 Thread STINNER Victor
STINNER Victor added the comment: New changeset 314b8787e0c50985ba708034b84ff5b37a1d47de by Victor Stinner in branch 'master': bpo-42923: Py_FatalError() avoids fprintf() (GH-24242) https://github.com/python/cpython/commit/314b8787e0c50985ba708034b84ff5b37a1d47de --

[issue42923] Py_FatalError(): dump the list of extension modules

2021-01-18 Thread STINNER Victor
STINNER Victor added the comment: New changeset e232025025c8bd07c1d1b12a583a80c4a673f077 by Victor Stinner in branch 'master': bpo-42923: Add Py_FatalError() test in test_capi (GH-24240) https://github.com/python/cpython/commit/e232025025c8bd07c1d1b12a583a80c4a673f077 --

[issue42888] Not installed “libgcc_s.so.1” causes exit crash.

2021-01-18 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: I've made a PR to remove most calls to pthread_exit(). @xxm: could you test it in your environment? -- ___ Python tracker ___

[issue42923] Py_FatalError(): dump the list of extension modules

2021-01-18 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +23064 pull_request: https://github.com/python/cpython/pull/24242 ___ Python tracker ___

[issue42888] Not installed “libgcc_s.so.1” causes exit crash.

2021-01-18 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- keywords: +patch pull_requests: +23063 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24241 ___ Python tracker ___

[issue42923] Py_FatalError(): dump the list of extension modules

2021-01-18 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +23062 pull_request: https://github.com/python/cpython/pull/24240 ___ Python tracker ___

[issue42951] Random and infinite loop in dealing with recursion error for "try-except "

2021-01-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Funny. But the output is not random. You can generate the sequence of letters by the following simple loop: s = '' for i in range(n): s = f'a{s}b{s}' The length of this sequence is 2*(2**n-1). Finally, your code will raise a non-silenced

[issue42725] PEP 563: Should the behavior change for yield/yield from's

2021-01-18 Thread Mark Shannon
Mark Shannon added the comment: Draft PEP here https://github.com/markshannon/peps/blob/annotation-syntax-errors/pep-.rst Guido, would you like to be co-author as it was your idea to make these things a syntax error? -- ___ Python tracker

[issue42952] Incorrect handling of EC_KEY_new_by_curve_name() in the _ssl module

2021-01-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Okay. And I have doubts that someone would backport this change to 3.6. I do not see harm in merging PR 24237, although there is no use of it too. In any case thank you for finding this suspicious code Zackery. --

[issue42938] [security] ctypes double representation BoF

2021-01-18 Thread Benjamin Peterson
Change by Benjamin Peterson : -- keywords: +patch nosy: +benjamin.peterson nosy_count: 2.0 -> 3.0 pull_requests: +23061 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24239 ___ Python tracker

[issue42955] Add sys.module_names: list of stdlib module names (Python and extension modules)

2021-01-18 Thread STINNER Victor
STINNER Victor added the comment: Another way to gather the list of Python modules: pydoc help("modules") uses pkgutil.walk_packages(). pydoc uses ModuleScanner which uses sys.builtin_module_names and pkgutil.walk_packages(). pkgutil.walk_packages() calls pkgutil.iter_modules() which

[issue42955] Add sys.module_names: list of stdlib module names (Python and extension modules)

2021-01-18 Thread STINNER Victor
STINNER Victor added the comment: (...) This API uses objects.inv from the online Python documentation. By the way, there is also this documentation page listing Python stdlib modules: https://docs.python.org/dev/py-modindex.html -- ___ Python

[issue42938] [security] ctypes double representation BoF

2021-01-18 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +vstinner title: ctypes double representation BoF -> [security] ctypes double representation BoF ___ Python tracker ___

[issue39950] Add pathlib.Path.hardlink_to()

2021-01-18 Thread Jay Chu
Jay Chu added the comment: Maybe we could have the correct `Path.hardlink` implemented before removing or even deprecating the confusing `Path.link_to`? It will only help even if we don't remove the latter in a hurry. -- nosy: +tothesong ___

[issue42913] asyncio.ProactorEventLoop mishandles signal wakeup file descriptor

2021-01-18 Thread Michel Hidalgo
Michel Hidalgo added the comment: Sorry for taking so long to reply. Sure, I would be happy to contribute. We should probably take care of Unix event loops -- since I opened this ticket I found out those tend to not cooperate with other signal wakeup file descriptor users either. I am a

[issue42955] Add sys.module_names: list of stdlib module names (Python and extension modules)

2021-01-18 Thread STINNER Victor
STINNER Victor added the comment: Use cases for sys.module_names: * When computing dependencies of a project, ignore modules which are part of the stdlib: https://github.com/jackmaney/pypt/issues/3 * Trace the execution of third party code, but ignore stdlib, use --ignore-module option of

[issue42952] Incorrect handling of EC_KEY_new_by_curve_name() in the _ssl module

2021-01-18 Thread Christian Heimes
Christian Heimes added the comment: It really doesn't matter. The code is dead and will never trigger. Python 3.7 and newer all require OpenSSL 1.0.2, which always has defines SSL_CTX_set_ecdh_auto. In more recent versions SSL_CTX_set_ecdh_auto() is a no-op. I'll remove the code entirely

[issue42952] Incorrect handling of EC_KEY_new_by_curve_name() in the _ssl module

2021-01-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Will it be removed in master only or in all maintained version too? -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue42955] Add sys.module_names: list of stdlib module names (Python and extension modules)

2021-01-18 Thread STINNER Victor
STINNER Victor added the comment: I wrote PR 24238 which implements an hardcoded list of stdlib module names. The PR uses the CI to ensure that the list always remain up to date. If tomorrow a new module is added, a CI job fails ("file not up to date"). > What if set __author__ = 'PSF' in

[issue42955] Add sys.module_names: list of stdlib module names (Python and extension modules)

2021-01-18 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +23060 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24238 ___ Python tracker ___

[issue42862] Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module

2021-01-18 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: I need some help debugging the Windows issues. There are a handful of tests that fail because the sqlite3 is clinging on to objects or file descriptors. AFAICT, a GC bug. For example, test_open_uri fails with: PermissionError: [WinError 32] The

[issue42951] Random and infinite loop in dealing with recursion error for "try-except "

2021-01-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42950] Incorrect exception behavior in handling recursive call.

2021-01-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Maybe stdout.flush() or stdout.buffer.flush() raise a RecursionError? When run the interpreter with option -u the second error is gone. -- ___ Python tracker

[issue42717] The python interpreter crashed with "_enter_buffered_busy"

2021-01-18 Thread Mark Shannon
Mark Shannon added the comment: Please leave the issue open. This is a real bug. It may not be fixed right now, but that doesn't mean it won't ever be fixed. -- nosy: +Mark.Shannon ___ Python tracker

[issue42950] Incorrect exception behavior in handling recursive call.

2021-01-18 Thread Mark Shannon
Mark Shannon added the comment: If you make calls in an exception handler that is handling a RecursionError, without unwinding first, then it is likely that another RecursionError may occur. What is strange is that the second RecursionError is raised after `print(str(e))` has printed the

[issue42956] Easy conversion between range and slice

2021-01-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > s.start or 0 Why 0? start=None is not the same as start=0 in slice. For example: >>> 'abcdefgh'[slice(None, 3, -1)] 'hgfe' >>> 'abcdefgh'[slice(0, 3, -1)] '' Slices and range objects are very different in many ways. It depends on your application how

[issue42956] Easy conversion between range and slice

2021-01-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: All versions older than 3.10 are in feature freeze and cannot get new features or enhancements, only bugfixes. Slices are far more general than range objects. How do you propose to deal with slice objects such as this? slice('item', (23, {'key':

[issue42887] 100000 assignments of .__sizeof__ cause a segfault on del

2021-01-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, there is an overhead of using the trashcan mechanism. This is why it is only used in data collections, because it is expected that your data can contain arbitrary long chains of links. There is many ways to create arbitrary long chains with other

[issue42955] Add sys.module_names: list of stdlib module names (Python and extension modules)

2021-01-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is no technical difference between stdlib modules and other modules. Stdlib modules are only special in context of copyright and responsibility. What if set __author__ = 'PSF' in every stdib module? Or other attributes which would allow to group

[issue42956] Easy conversion between range and slice

2021-01-18 Thread Dávid Nemeskey
Dávid Nemeskey added the comment: s/to different/two different/ -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue42956] Easy conversion between range and slice

2021-01-18 Thread Dávid Nemeskey
New submission from Dávid Nemeskey : It would be nice if there was an easy way to convert a range to a slice and vice versa. At least superficially the two are almost the same(*), yet if one wants to convert a slice to a range, he has to go through hoops to avoid potential errors, ending up

[issue42954] new "if-as" syntax

2021-01-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm not having a good day :-( > the process to get new syntax added to the library The process to get new syntax added to the **language**. -- ___ Python tracker

[issue42954] new "if-as" syntax

2021-01-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: Oops sorry I got the operator precedence wrong: if (profile := users.get(uid, None)) is not None: The walrus operator was added in Python 3.8. Using the "as" key word was considered and rejected. See the PEP: https://www.python.org/dev/peps/pep-0572/

[issue42955] Add sys.module_names: list of stdlib module names (Python and extension modules)

2021-01-18 Thread STINNER Victor
STINNER Victor added the comment: On Fedora 33, the stdlib lives in two main directories: * /usr/lib64/python3.9: Python modules * /usr/lib64/python3.9/lib-dynload: C extension modules Example: >>> import os.path >>> os.path.dirname(os.__file__) # Python '/usr/lib64/python3.9' >>>

[issue42955] Add sys.module_names: list of stdlib module names (Python and extension modules)

2021-01-18 Thread STINNER Victor
New submission from STINNER Victor : Some use cases require to know if a module comes from the stdlib or not. For example, I would like to only dump extension modules which don't come from the stdlib in bpo-42923: "Py_FatalError(): dump the list of extension modules". Stdlib modules are

[issue42954] new "if-as" syntax

2021-01-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: Use the walrus operator: if profile := users.get(uid, None) is not None: print(f"user: {profile['name']}") -- nosy: +steven.daprano resolution: -> rejected stage: -> resolved status: open -> closed

[issue42954] new "if-as" syntax

2021-01-18 Thread Евгений Jen
New submission from Евгений Jen : # use if users.get(uid, None) as profile != None: ... # instead profile = users.get(uid, None) if profile != None: ... # full-sample: >>> users = {1: {"name": "Jen"}} ... uid = 1 ... ... # current syntax: ... profile = users.get(uid, None) ... if

[issue35212] Expressions with format specifiers in f-strings give wrong code position in AST

2021-01-18 Thread daniel hahler
Change by daniel hahler : -- nosy: +blueyed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42887] 100000 assignments of .__sizeof__ cause a segfault on del

2021-01-18 Thread Ronald Oussoren
Ronald Oussoren added the comment: Note that there is a way to avoid this crash using the trashcan API (see the use of Py_TRASHCAN_BEGIN in various implementation). This API is generally only used for recursive data structures and because it has a performance cost (based on what I've read

[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-01-18 Thread STINNER Victor
STINNER Victor added the comment: See also bpo-41618: [C API] How many slots of static types should be exposed in PyType_GetSlot(). -- ___ Python tracker ___

[issue7946] Convoy effect with I/O bound threads and New GIL

2021-01-18 Thread STINNER Victor
Change by STINNER Victor : -- nosy: -vstinner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

  1   2   >