[issue42606] Support POSIX atomicity guarantee of O_APPEND on Windows

2021-01-19 Thread Eryk Sun
Eryk Sun added the comment: > os.write(fd) can't ... know that the fd was opened with O_APPEND It's possible to query the granted access of a kernel handle via NtQueryObject: ObjectBasicInformation -- not that I'm suggesting to use it. > the most serious one is rather silly: we need to

[issue42974] tokenize reports incorrect end col offset and line string when input ends without explicit newline

2021-01-19 Thread Brian Romanowski
Change by Brian Romanowski : -- keywords: +patch pull_requests: +23085 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24260 ___ Python tracker

[issue42974] tokenize reports incorrect end col offset and line string when input ends without explicit newline

2021-01-19 Thread Brian Romanowski
New submission from Brian Romanowski : The tokenize module's tokenizer functions output incorrect (or at least misleading) information when the content being tokenized does not end in a line ending character. This is related to the fix for issue<33899> which added the NEWLINE tokens for

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

2021-01-19 Thread STINNER Victor
STINNER Victor added the comment: Yet another use case: the friendly-traceback project detects typos on imports using the list of stdlib module names: https://aroberge.github.io/friendly-traceback-docs/docs/html/tracebacks_en_3.8.html#standard-library-module For example, it suggest to

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

2021-01-19 Thread STINNER Victor
STINNER Victor added the comment: The pants project also uses a list of stdlib module names, similar to isort, to infer dependencies: https://github.com/pantsbuild/pants/tree/master/src/python/pants/backend/python/dependency_inference/python_stdlib "Pants is a scalable build system for

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

2021-01-19 Thread STINNER Victor
STINNER Victor added the comment: sys.module_names also solves the following old StackOverflow question: "How to check if a module/library/package is part of the python standard library?"

[issue35829] datetime: parse "Z" timezone suffix in fromisoformat()

2021-01-19 Thread Daniel Lenski
Daniel Lenski added the comment: Like many others here, I've run into this issue because I'm trying to parse timestamps from JSON. (Specifically, I'm trying to parse timestamps from JSON serialization of Java POJOs and/or Kotlin data classes, as serialized by the Jackson serialization

[issue42957] os.readlink produces wrong result on windows

2021-01-19 Thread Eryk Sun
Eryk Sun added the comment: os.readlink() was generalized to support mountpoints (junctions) as well as symlinks, and it's more common for mountpoints to lack the print name field in the reparse data buffer [1]. For example, PowerShell's new-item creates junctions that only have a

[issue35829] datetime: parse "Z" timezone suffix in fromisoformat()

2021-01-19 Thread Daniel Lenski
Change by Daniel Lenski : -- nosy: +dlenski ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42864] Improve error messages regarding unclosed parentheses

2021-01-19 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue42864] Improve error messages regarding unclosed parentheses

2021-01-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset d6d6371447357c9c69b0936573977a3e60f2 by Pablo Galindo in branch 'master': bpo-42864: Improve error messages regarding unclosed parentheses (GH-24161) https://github.com/python/cpython/commit/d6d6371447357c9c69b0936573977a3e60f2

[issue42973] argparse: mixing optional and positional arguments... not again

2021-01-19 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +paul.j3, r.david.murray ___ Python tracker ___ ___ Python-bugs-list mailing list

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

2021-01-19 Thread STINNER Victor
STINNER Victor added the comment: More "real world" example using cinder which imports 220 modules (ctypes is used to simulate a crash): --- $ ./python -m venv env $ env/bin/python -m pip install wheel $ env/bin/python -m pip install cinder $ env/bin/python -X dev -c 'import

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

2021-01-19 Thread Eryk Sun
Eryk Sun added the comment: > That's what Lib/test/win_console_handler.py:39 does. No, that script is currently broken. SetConsoleCtrlHandler(None, False) clears the Ctrl+C ignore flag in the PEB ProcessParameters, which is normally inherited by child processes. But using the

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

2021-01-19 Thread Josh Rosenberg
Josh Rosenberg added the comment: This is a problem with the docstring. The actual docs for it are a bit more clear, https://docs.python.org/3/library/filecmp.html#filecmp.cmp : "If shallow is true, files with identical os.stat() signatures are taken to be equal. Otherwise, the contents of

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

2021-01-19 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

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

2021-01-19 Thread STINNER Victor
STINNER Victor added the comment: New changeset 66f77caca39ba39ebe1e4a95dba6d19b20d51951 by Victor Stinner in branch 'master': bpo-42923: _Py_DumpExtensionModules() ignores stdlib ext (GH-24254) https://github.com/python/cpython/commit/66f77caca39ba39ebe1e4a95dba6d19b20d51951 --

[issue42973] argparse: mixing optional and positional arguments... not again

2021-01-19 Thread Tadek Kijkowski
Change by Tadek Kijkowski : -- keywords: +patch pull_requests: +23083 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24259 ___ Python tracker ___

[issue14191] argparse doesn't allow optionals within positionals

2021-01-19 Thread Tadek Kijkowski
Change by Tadek Kijkowski : -- nosy: +monkeyman79 nosy_count: 9.0 -> 10.0 pull_requests: +23084 pull_request: https://github.com/python/cpython/pull/24259 ___ Python tracker

[issue42970] File path with blank causes open error in 3.8, not in 3.7

2021-01-19 Thread Doug Day
Doug Day added the comment: To clarify: either python version generates the same path. On 3.8.2 though an open error results -- ___ Python tracker ___

[issue42973] argparse: mixing optional and positional arguments... not again

2021-01-19 Thread Tadek Kijkowski
New submission from Tadek Kijkowski : I have following use case for argparse: ./prog --tracks=80 image1 --tracks=40 image2 --tracks=80 image3 ... I expected that the following parser would be able process that command line: parser = argparse.ArgumentParser() add = parser.add_argument

[issue42971] Some errnos for BSD/OSX are missing from errno module

2021-01-19 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +ned.deily, ronaldoussoren ___ Python tracker ___ ___ Python-bugs-list mailing list

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

2021-01-19 Thread STINNER Victor
STINNER Victor added the comment: New changeset cad8020cb83ec6d904f874c0e4f599e651022196 by Victor Stinner in branch 'master': bpo-42955: Add Python/module_names.h (GH-24258) https://github.com/python/cpython/commit/cad8020cb83ec6d904f874c0e4f599e651022196 --

[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-01-19 Thread STINNER Victor
STINNER Victor added the comment: In June 2020, I create PR 20983 to attempt to automatically traverse the type: "Provide a default tp_traverse implementation for the base object type for heap types which have no tp_traverse function. The traverse function visits the type if the type is a heap

[issue41036] Visit the type of instance of heap types if tp_traverse is not implemented

2021-01-19 Thread STINNER Victor
STINNER Victor added the comment: I created bpo-42972 instead. -- resolution: -> duplicate stage: patch review -> resolved status: open -> closed superseder: -> [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol ___ Python

[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-01-19 Thread STINNER Victor
New submission from STINNER Victor : Copy of my email sent to python-dev: https://mail.python.org/archives/list/python-...@python.org/thread/C4ILXGPKBJQYUN5YDMTJOEOX7RHOD4S3/ Hi, In the Python stdlib, many heap types currently don't "properly" (fully?) implement the GC protocol which can

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

2021-01-19 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +23082 pull_request: https://github.com/python/cpython/pull/24258 ___ Python tracker ___

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

2021-01-19 Thread William Schwartz
William Schwartz added the comment: >For a new process group, the cancel event is initially ignored, but the break >event is always handled. To enable the cancel event, the process must call >SetConsoleCtrlHandler(NULL, FALSE), such as via ctypes with >kernel32.SetConsoleCtrlHandler(None,

[issue42971] Some errnos for BSD/OSX are missing from errno module

2021-01-19 Thread Enji Cooper
Enji Cooper added the comment: Some items that I've noted so far that are missing: - ENOATTR (BSD/OSX) - ENOLINK (BSD; is reserved on OSX) - ENOTSUP (NetBSD, OpenBSD, OSX) -- ___ Python tracker

[issue36344] install_certificates.command too complicated

2021-01-19 Thread Ned Deily
Ned Deily added the comment: > What exactly is the backport status for this issue, and is there anything > with more info for this user? Python 3.6 has been in the security-fix-only phase of its life cycle since 2018-12 which means that python.org binary installers for Mac or Windows

[issue42971] Some errnos for BSD/OSX are missing from errno module

2021-01-19 Thread Enji Cooper
New submission from Enji Cooper : Some errnos for BSD/OSX are currently not supported by the errno module. It would be helpful for these to be exposed to the end-user so they could programmatically use them instead of reinventing the wheel in a separate module/C extension, or hardcoding the

[issue36344] install_certificates.command too complicated

2021-01-19 Thread Steve Arnold
Steve Arnold added the comment: I can't seem to find a usable answer for a user on Sierra with a (supposedly) working python 3.6 install. From what I can tell all the related bugs are closed except this one, and this one doesn't include python 3.6. Running the install_certificates.command

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

2021-01-19 Thread Eryk Sun
Eryk Sun added the comment: > Should there be a `return NULL;` between these two lines? In 3.x, os.kill() has always fallen back on TerminateProcess() when GenerateConsoleCtrlEvent() fails, and I assumed that was intentional. But I misunderstood that it's not actually chaining the exception

[issue42970] File path with blank causes open error in 3.8, not in 3.7

2021-01-19 Thread Doug Day
New submission from Doug Day : The following code generates a path that works in Pythons 3.7.6 on macOS Big Sur but not in Catalina with 3.8.2.. mySrcFldr="~/Library/Mobile Documents/com~apple~CloudDocs/Utilities/" srcFldr=os.path.expanduser(mySrcFldr) f=os.path.join(srcFldr,"mortgage.py")

[issue42969] pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful

2021-01-19 Thread Gregory P. Smith
Change by Gregory P. Smith : -- title: pthread_exit & PyThread_exit_thread are harmful -> pthread_exit & PyThread_exit_thread from PyEval_RestoreThread etc. are harmful ___ Python tracker

[issue42969] pthread_exit & PyThread_exit_thread are harmful

2021-01-19 Thread Gregory P. Smith
Gregory P. Smith added the comment: C-APIs such as `PyEval_RestoreThreads()` are insufficient for the task they are asked to do. They return void, yet have a failure mode. They call pthread_exit() on failure today. Instead, they need to return an error to the calling application to

[issue42969] pthread_exit & PyThread_exit_thread are harmful

2021-01-19 Thread Gregory P. Smith
New submission from Gregory P. Smith : ## BACKGROUND `PyThread_exit_thread()` calls `pthread_exit(`) and is in turn called from a variety of APIs as documented in the C-API doc update from https://bugs.python.org/issue36427. The `pthread_exit()` call was originally introduced as a way

[issue42957] os.readlink produces wrong result on windows

2021-01-19 Thread simon mackenzie
simon mackenzie added the comment: I note os.path.realpath("v1") does produce the right path in windows. Maybe that is what you meant. Will that work cross-platform? On Tue, 19 Jan 2021 at 18:48, simon mackenzie wrote: > For most people the expectation would be that it returns a path in the

[issue42957] os.readlink produces wrong result on windows

2021-01-19 Thread simon mackenzie
simon mackenzie added the comment: For most people the expectation would be that it returns a path in the same format as any other path. Furthermore it seems odd to change the default behaviour after years when it worked as expected. I never heard of this substitute path before and it does not

[issue42968] multiprocessing handle leak on Windows when child process is killed during startup/unpickling

2021-01-19 Thread Daniel Grunwald
Daniel Grunwald added the comment: Fix idea: get_spawning_popen().pid could be used to directly copy the handle into the child process, thus avoiding the temporary copy in the main process. This would help at least in our case (where we pass all connections during startup). I don't know if

[issue42968] multiprocessing handle leak on Windows when child process is killed during startup/unpickling

2021-01-19 Thread Daniel Grunwald
New submission from Daniel Grunwald : Running the attached script deadlocks. Uncommenting the `time.sleep(1)` in the script makes the deadlock disappear. For context: our application uses multiple child processes (multiprocessing.Process) and uses pipes (multiprocessing.Pipe) to communicate

[issue42896] Solaris 11.4 crle output not handled correctly

2021-01-19 Thread David Murphy
Change by David Murphy : -- pull_requests: +23080 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24226 ___ Python tracker ___

[issue42035] [C API] PyType_GetSlot cannot get tp_name

2021-01-19 Thread STINNER Victor
STINNER Victor added the comment: A type has different names: * short name: "name" * qualified name: "module.name" Which one should be returned by PyType_GetName()? Is there a warranty that it's always short or always qualified? -- ___ Python

[issue42035] [C API] PyType_GetSlot cannot get tp_name

2021-01-19 Thread STINNER Victor
STINNER Victor added the comment: New C API functions must not return borrowed references, but strong references. -- ___ Python tracker ___

[issue41713] _signal module leak: test_interpreters leaked [1424, 1422, 1424] references

2021-01-19 Thread STINNER Victor
STINNER Victor added the comment: New changeset e8e66eab941b983b6e85cd0d57cd45838880c568 by Victor Stinner in branch 'master': bpo-41713: Remove PyOS_InitInterrupts() from python3dll.c (GH-24257) https://github.com/python/cpython/commit/e8e66eab941b983b6e85cd0d57cd45838880c568 --

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

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

[issue41701] Buildbot web page: connection lost after 1 minute, then display "Connection restored" popup

2021-01-19 Thread STINNER Victor
STINNER Victor added the comment: Ee: > Apologies, I gisted a version that was from attempts to debug the timeouts. > It's been updated. Aaaah :-D No problem. Can you please try: * replace "timeout client 30s" with "timeout client 1d" * replace "timeout server 30s" with "timeout server 1d"

[issue41701] Buildbot web page: connection lost after 1 minute, then display "Connection restored" popup

2021-01-19 Thread STINNER Victor
STINNER Victor added the comment: > "timeout server 1d" Hum. I'm not sure if "1d" syntax is accepted. Maybe use "3600s". -- ___ Python tracker ___

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

2021-01-19 Thread William Schwartz
William Schwartz added the comment: > Fixing the SystemError should be simple. Just clear an existing error if > TerminateProcess() succeeds. Should there be a `return NULL;` between these two lines?

[issue41701] Buildbot web page: connection lost after 1 minute, then display "Connection restored" popup

2021-01-19 Thread Ee W. Durbin III
Ee W. Durbin III added the comment: Apologies, I gisted a version that was from attempts to debug the timeouts. It's been updated. -- ___ Python tracker ___

[issue41713] _signal module leak: test_interpreters leaked [1424, 1422, 1424] references

2021-01-19 Thread STINNER Victor
STINNER Victor added the comment: Petr Viktorin: > The PyOS_InitInterrupts function is still listed in PC/python3dll.c. Ooops, I proposed PR 24257 to remove it. -- ___ Python tracker

[issue41713] _signal module leak: test_interpreters leaked [1424, 1422, 1424] references

2021-01-19 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +23079 pull_request: https://github.com/python/cpython/pull/24257 ___ Python tracker ___

[issue42035] [C API] PyType_GetSlot cannot get tp_name

2021-01-19 Thread Petr Viktorin
Petr Viktorin added the comment: Now that I see the implementation (and now that I'm spending a lot of time trying to formalize what is good stable API), I see a problem with PyType_GetName: it effectively returns a borrowed reference. The proposed docs say: Callers can hold [the

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

2021-01-19 Thread STINNER Victor
STINNER Victor added the comment: > One (poorly thought out) option is to add sys._stdlib_path with the > subsection of sys.path that contains the stdlib, and a function in importlib > that returns if a spec is for a stdlib module. There is already sysconfig.get_paths()['stdlib']. Maybe we

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

2021-01-19 Thread STINNER Victor
STINNER Victor added the comment: Ronald: > I think we agree on that point: my counter proposal won’t work in the > faulthandler scenario, and may be problematic in the Py_FatalError case as > well. The API providing a tuple of str (sys.module_names) works with the 4 use cases that I

[issue41701] Buildbot web page: connection lost after 1 minute, then display "Connection restored" popup

2021-01-19 Thread STINNER Victor
STINNER Victor added the comment: I looked at these files. HAProxy configuration, "defaults" section contains: timeout connect 5000 timeout client 5 timeout server 5 These timeouts are not overriden in "frontend main" nor in "backend buildbot-master" sections.

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

2021-01-19 Thread STINNER Victor
STINNER Victor added the comment: Ronald: > BTW. A list of stdlib module names is not sufficient to determine if a module > is in the stdlib, thanks to .pth files it is possible to have entries on > sys.path before the stdlib. Yeah, I wrote it in my first message. I solved this issue with

[issue42392] remove the deprecated 'loop' parameter asyncio API

2021-01-19 Thread Ken Jin
Change by Ken Jin : -- nosy: +kj nosy_count: 5.0 -> 6.0 pull_requests: +23078 pull_request: https://github.com/python/cpython/pull/24256 ___ Python tracker ___

[issue41701] Buildbot web page: connection lost after 1 minute, then display "Connection restored" popup

2021-01-19 Thread Ee W. Durbin III
Ee W. Durbin III added the comment: OK, I've confirmed that HAProxy seems to be the issue. WebSockets opened to the nginx proxy on the server or directly to the twisted server successfully remain indefinitely. If anyone familiar with HAProxy would be interested in helping debug, the

[issue41713] _signal module leak: test_interpreters leaked [1424, 1422, 1424] references

2021-01-19 Thread Petr Viktorin
Petr Viktorin added the comment: The PyOS_InitInterrupts function is still listed in PC/python3dll.c. -- nosy: +petr.viktorin ___ Python tracker ___

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

2021-01-19 Thread Mark Shannon
Mark Shannon added the comment: It won't solve the problem. Maybe make it would make it easier to avoid the segfault, but some sort of recursion/overflow check is needed. It might make the use of the trashcan cheaper, as it only need be used when stack space is running low. Ultimately,

[issue42967] Web cache poisoning - `;` as a query args separator

2021-01-19 Thread Adam Goldschmidt
New submission from Adam Goldschmidt : The urlparse module treats semicolon as a separator (https://github.com/python/cpython/blob/master/Lib/urllib/parse.py#L739) - whereas most proxies today only take ampersands as separators. Link to a blog post explaining this vulnerability:

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

2021-01-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: Mark, would your proposal in PEP-651 fix this case? -- nosy: +Mark.Shannon ___ Python tracker ___

[issue42965] Optional callable raises TypeError

2021-01-19 Thread Ofek Lev
Ofek Lev added the comment: Ah I see, thanks! -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

[issue42966] argparse: customizable help formatter

2021-01-19 Thread Tadek Kijkowski
Change by Tadek Kijkowski : -- title: argpare: customizable help formatter -> argparse: customizable help formatter ___ Python tracker ___

[issue42966] argpare: customizable help formatter

2021-01-19 Thread Tadek Kijkowski
New submission from Tadek Kijkowski : Current implementation of the argparse module doesn't make it easy for developers to customize the help text message format. On one hand the module doesn't provide any builtin ways to do it, and the only way is to provide developer's own formatter class,

[issue42965] Optional callable raises TypeError

2021-01-19 Thread Ken Jin
Ken Jin added the comment: Hello, this issue is a byproduct of issue42195. It has already been fixed on Python 3.10, and on Python 3.9.2 (which isn't out yet). You can see the what's new for it here https://docs.python.org/3/whatsnew/3.9.html#notable-changes-in-python-3-9-2. The expected

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

2021-01-19 Thread Xinmeng Xia
Xinmeng Xia added the comment: oh,I see. By the way, I set the argument of sys.setrecursionlimit to 10 in this program and a segmentation fault is reported. Is that normal? -- ___ Python tracker

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

2021-01-19 Thread Mark Shannon
Mark Shannon added the comment: Try setting the recursion limit to 10 or so and it should terminate. The reason ctrl-C doesn't work is that you are catching the KeyboardInterrupt. Never use a plain `except:`, use `except Exception:` -- nosy: +Mark.Shannon

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

2021-01-19 Thread Boris Staletic
Boris Staletic added the comment: Oops... I uploaded (and pasted) the wrong file. The /correct/ example can be found here: https://github.com/pybind/pybind11/pull/2797/#pullrequestreview-570541151 However, I have just realized that the example doesn't really need the embedded module. The

[issue42606] Support POSIX atomicity guarantee of O_APPEND on Windows

2021-01-19 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Could anybody provide their thoughts on this RFE? Thanks. -- ___ Python tracker ___ ___

[issue41818] Lib/pty.py major revision

2021-01-19 Thread Petr Viktorin
Petr Viktorin added the comment: New changeset 65cf1ad6723b6b4489fa7dda04283bb2466be531 by Petr Viktorin in branch 'master': bpo-41818: Close file descriptors in test_openpty (#GH-24119) https://github.com/python/cpython/commit/65cf1ad6723b6b4489fa7dda04283bb2466be531 --

[issue41701] Buildbot web page: connection lost after 1 minute, then display "Connection restored" popup

2021-01-19 Thread Petr Viktorin
Change by Petr Viktorin : -- keywords: +patch pull_requests: +23077 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24119 ___ Python tracker ___

[issue41701] Buildbot web page: connection lost after 1 minute, then display "Connection restored" popup

2021-01-19 Thread Petr Viktorin
Petr Viktorin added the comment: Is there anything I can help with to move this forward? Investigating buildbot failures continues to be very annoying. -- nosy: +petr.viktorin ___ Python tracker

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

2021-01-19 Thread Ronald Oussoren
Ronald Oussoren added the comment: BTW. A list of stdlib module names is not sufficient to determine if a module is in the stdlib, thanks to .pth files it is possible to have entries on sys.path before the stdlib. -- ___ Python tracker

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

2021-01-19 Thread Ronald Oussoren
Ronald Oussoren added the comment: > On 19 Jan 2021, at 12:30, STINNER Victor wrote: > > Ronald: >> You wouldn't necessarily have to import a module to test, this is something >> that could be added to importlib. One (poorly thought out) option is to add >> sys._stdlib_path with the

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

2021-01-19 Thread STINNER Victor
STINNER Victor added the comment: Myself: > Having to actually import modules to check if it's a stdlib module or not is > not convenient. Many stdlib modules have side effects on import. The "trace" usecase needs an exhaustive list of all module names. It is even less convenient to have to

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

2021-01-19 Thread Ronald Oussoren
Ronald Oussoren added the comment: >> Wouldn't it be sufficient to somehow mark the stdlib entries on sys.path? >> Although that might give misleading answers with tools like >> pyinstaller/py2exe/py2app that package an application and its dependencies >> into a single zipfile. > Having to

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

2021-01-19 Thread STINNER Victor
STINNER Victor added the comment: Ronald Oussoren: > A list of stdlib modules/extensions is IMHO problematic for maintenance, esp. > if you consider that not all modules/extensions are installed on all systems > (both because dependencies aren't present and because packagers have decided >

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

2021-01-19 Thread Ronald Oussoren
Ronald Oussoren added the comment: A list of stdlib modules/extensions is IMHO problematic for maintenance, esp. if you consider that not all modules/extensions are installed on all systems (both because dependencies aren't present and because packagers have decided to unbundle parts of the

[issue39291] "pathlib.Path.link_to()" and "pathlib.Path.symlink_to()" have reversed usage

2021-01-19 Thread yota moteuchi
yota moteuchi added the comment: one option to could be to create a hardlink_to() method which is link.hardlink_to(target) and in a few release, deprecate link_to ? :) -- nosy: +yota moteuchi ___ Python tracker

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

2021-01-19 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2021-01-19 Thread Eryk Sun
Eryk Sun added the comment: > I just reported it because the SystemError indicates that a C-API function > was returning non-NULL even after PyErr_Occurred() returns true Fixing the SystemError should be simple. Just clear an existing error if TerminateProcess() succeeds. > Windows Command

[issue42965] Optional callable raises TypeError

2021-01-19 Thread Ofek Lev
Ofek Lev added the comment: I'm using the deprecated typing.Callable instead now and that works -- ___ Python tracker ___ ___

[issue42965] Optional callable raises TypeError

2021-01-19 Thread Ofek Lev
New submission from Ofek Lev : https://docs.python.org/3.9/library/typing.html#callable ``` Python 3.9.1 (default, Jan 12 2021, 16:45:25) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from typing import Optional >>> from collections.abc import