[issue39913] Document warnings.WarningMessage ?

2020-03-09 Thread daniel hahler
New submission from daniel hahler : I've noticed that `warnings.WarningMessage` is not documented, i.e. it does not show up in the intersphinx object list. I'm not sure how to document it best, but maybe just describing its attributes? Ref:

[issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()`

2020-03-09 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: This is not how timeit works, you just measured the time taken by an empty loop, you can look at `python3 -m timeit -h` to get help how to call it. I think a correct invocation would be: (venv) ➜ ~ python3 -m timeit -s 'from os import scandir'

[issue35775] Add a general selection function to statistics

2020-03-09 Thread Rémi Lapeyre
Change by Rémi Lapeyre : -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list

[issue13077] Windows: Unclear behavior of daemon threads on main thread exit

2020-03-09 Thread STINNER Victor
STINNER Victor added the comment: I can only reproduce the behavior (other thread continues to run after CTRL+C) on Windows, not on Linux. -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, vstinner, zach.ware title: Unclear behavior of daemon threads on main thread

[issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()`

2020-03-09 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: This optimisation was also hinted at https://bugs.python.org/issue26032#msg257653 -- nosy: +pitrou, serhiy.storchaka, xtreak ___ Python tracker

[issue39659] pathlib calls `os.getcwd()` without using accessor

2020-03-09 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39822] Use NULL instead of None for empty attrib in C implementation of Element

2020-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset dccd41e29fb9e75ac53c04ed3b097f51f8f65c4e by Serhiy Storchaka in branch 'master': bpo-39822: Use NULL instead of None for empty attrib in Element. (GH-18735) https://github.com/python/cpython/commit/dccd41e29fb9e75ac53c04ed3b097f51f8f65c4e

[issue26037] Crash when reading sys.stdin.buffer in a daemon thread

2020-03-09 Thread STINNER Victor
STINNER Victor added the comment: The problem is that Py_FinalizeEx() tries to close the sys.stdin object in _PyImport_Cleanup(), but closing the buffered object requires the object lock which is hold by _thread(). _thread() is blocked on waiting for a newline character. I suggest to use

[issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

2020-03-09 Thread STINNER Victor
STINNER Victor added the comment: > So I changed 'pthread_cond_timedwait' to 'take_gil' and this didn't seem to > have an effect on the unit test. Maybe you forgot to run "make" to copy Tools/gdb/libpython.py as python-gdb.py. Anyway, I wrote PR 18873 and I tested manually that it does fix

[issue30519] [threading] Add daemon argument to Timer

2020-03-09 Thread STINNER Victor
STINNER Victor added the comment: Daemon threads are very fragile by design. I would prefer to not promote their usage. See for example bpo-39877 for a recent example. I would prefer to remove support for daemon threads, rather than adding more daemon threads! I reject the issue. Moreover,

[issue38691] importlib: PYTHONCASEOK should be ignored when using python3 -E

2020-03-09 Thread STINNER Victor
STINNER Victor added the comment: New changeset fc72ab6913f2b5337ae7fda711f2de846d38f479 by idomic in branch 'master': bpo-38691: importlib ignores PYTHONCASEOK if -E is used (GH-18627) https://github.com/python/cpython/commit/fc72ab6913f2b5337ae7fda711f2de846d38f479 --

[issue39906] pathlib.Path: add `follow_symlinks` argument to `stat()` and `chmod()`

2020-03-09 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39893] Add set_terminate() to logging

2020-03-09 Thread wyz23x2
Change by wyz23x2 : -- versions: +Python 3.5, Python 3.6, Python 3.7 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39903] Double decref in _elementtree.Element.__getstate__

2020-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 88944a44aa84b0f3674939019b1befbc7a9dc874 by Serhiy Storchaka in branch 'master': bpo-39903: Fix double decref in _elementtree.Element.__getstate__ (GH-18850) https://github.com/python/cpython/commit/88944a44aa84b0f3674939019b1befbc7a9dc874

[issue39903] Double decref in _elementtree.Element.__getstate__

2020-03-09 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +18232 pull_request: https://github.com/python/cpython/pull/18874 ___ Python tracker

[issue39903] Double decref in _elementtree.Element.__getstate__

2020-03-09 Thread miss-islington
Change by miss-islington : -- pull_requests: +18233 pull_request: https://github.com/python/cpython/pull/18875 ___ Python tracker ___

[issue39903] Double decref in _elementtree.Element.__getstate__

2020-03-09 Thread miss-islington
miss-islington added the comment: New changeset 80be9c344f9fa619c24712c699b70126fc202315 by Miss Islington (bot) in branch '3.7': bpo-39903: Fix double decref in _elementtree.Element.__getstate__ (GH-18850) https://github.com/python/cpython/commit/80be9c344f9fa619c24712c699b70126fc202315

[issue39903] Double decref in _elementtree.Element.__getstate__

2020-03-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue36475] PyEval_AcquireLock() and PyEval_AcquireThread() do not handle runtime finalization properly.

2020-03-09 Thread STINNER Victor
STINNER Victor added the comment: I marked bpo-23592 as duplicate of this issue. -- ___ Python tracker ___ ___ Python-bugs-list

[issue23592] SIGSEGV on interpreter shutdown, with daemon threads running wild

2020-03-09 Thread STINNER Victor
STINNER Victor added the comment: I believe that this issue cannot occur in Python 3.8 thanks for bpo-36475. According to the backtrace, a thread does crash in PyEval_EvalFrameEx(). I understand that it's a daemon thread. To execute PyEval_EvalFrameEx(), a daemon thread must hold the GIL.

[issue37951] Disallow fork in a subinterpreter broke subprocesses in mod_wsgi daemon mode

2020-03-09 Thread STINNER Victor
STINNER Victor added the comment: > I'm reducing the severity from release blocker to high and keep the ticket in > pending to give Eric a change to review the commits. Python 3.8.0 is released with the fix. It's now time to close the issue. -- stage: commit review -> resolved

[issue39910] os.ftruncate on Windows should be sparse

2020-03-09 Thread Mingye Wang
New submission from Mingye Wang : Consider this interaction: cmd> echo > 1.txt cmd> python -c "__import__('os').truncate('1.txt', 1024 ** 3)" cmd> fsutil sparse queryFlag 1.txt Not only takes a long time as is typical for a zero-write, but also reports non-sparse as an actual write would

[issue38691] importlib: PYTHONCASEOK should be ignored when using python3 -E

2020-03-09 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()`

2020-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is not so easy. There was reason why it was not done earlier. scandir() wastes more limited resource than memory -- file descriptors. It should also be properly closed and do not depend on the garbage collector. Consider the example: def

[issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

2020-03-09 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +18231 pull_request: https://github.com/python/cpython/pull/18873 ___ Python tracker ___

[issue39903] Double decref in _elementtree.Element.__getstate__

2020-03-09 Thread miss-islington
miss-islington added the comment: New changeset 97bbdb28b4ab9519780f924e3267ac70af1cd5b8 by Miss Islington (bot) in branch '3.8': bpo-39903: Fix double decref in _elementtree.Element.__getstate__ (GH-18850) https://github.com/python/cpython/commit/97bbdb28b4ab9519780f924e3267ac70af1cd5b8

[issue39822] Use NULL instead of None for empty attrib in C implementation of Element

2020-03-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue39914] logging.config: '.' (dot) as a key is not documented

2020-03-09 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +vinay.sajip ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39829] __len__ called twice in the list() constructor

2020-03-09 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Thanks Kim and Eric! I think it still makes sense to do some quick benchmarking and research on passing down the calculated length. I can try to produce a draft PR so we can discuss with something more tangible. --

[issue39829] __len__ called twice in the list() constructor

2020-03-09 Thread Eric Snow
Eric Snow added the comment: I'm not opposed. :) I just don't want to impose on your time. -- assignee: -> pablogsal resolution: not a bug -> stage: resolved -> status: closed -> open ___ Python tracker

[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-03-09 Thread Michael Felt
Michael Felt added the comment: Almost. The command is run, but not enough of the bootstrap is finished - it seems. File "/data/prj/python/git/python3-3.9/Lib/_aix_support.py", line 54, in _aix_bosmp64 out = out.decode("utf-8").strip().split(":") # type: ignore AttributeError: 'str'

[issue39911] "AMD64 Windows7 SP1 3.x" buildbot doesn't build anymore

2020-03-09 Thread Jeremy Kloth
Jeremy Kloth added the comment: Well, it only doesn't build on 3.9+ (master) due to not being supported going forward. The *buildmaster* needs to be fixed to stop submitting those jobs to unsupported platforms. We need to continue testing 3.7 and 3.8 on Win7 until they go EOL to ensure

[issue39911] "AMD64 Windows7 SP1 3.x" buildbot doesn't build anymore

2020-03-09 Thread STINNER Victor
STINNER Victor added the comment: Ah, "x86 Windows7 3.x" worker has the same issue: https://buildbot.python.org/all/#/builders/150/builds/434 -- ___ Python tracker ___

[issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()`

2020-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Less reliable how? See issue39916. > so it looks like scandir as a small overhead when accumulating all results > and not using the extra info it returns. Try with larger directories. The difference may be not so small. $ python3 -m timeit -s 'from os

[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-03-09 Thread STINNER Victor
STINNER Victor added the comment: > AttributeError: 'str' object has no attribute 'decode' Oops, it should now be fixed by my second commit. Please retry PR 18872. -- ___ Python tracker

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2020-03-09 Thread Guido van Rossum
Change by Guido van Rossum : -- versions: -Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12782] Multiple context expressions do not support parentheses for continuation across lines

2020-03-09 Thread Guido van Rossum
Guido van Rossum added the comment: If we introduce a PEG-based parser, we can do this without hacking the tokenizer. See https://github.com/gvanrossum/pegen/issues/229 I'd propose to aim for Python 3.10 (if the PEG parser happens). -- nosy: +gvanrossum

[issue39914] logging.config: '.' (dot) as a key is not documented

2020-03-09 Thread Yuta Okamoto
New submission from Yuta Okamoto : I noticed that Configurators in logging.config module accepts '.' (dot) as a key to fill attributes for filters, formatters, and handlers directly like the following: handlers: syslog: class: logging.handlers.SysLogHandler .:

[issue39829] __len__ called twice in the list() constructor

2020-03-09 Thread Eric Snow
Eric Snow added the comment: FWIW, I encouraged Kim to file this. Thanks Kim! While it isn't part of any specification, it is an unexpected change in behavior that led to some test failures. So I figured it would be worth bringing up. :) I did find it surprising that we were not caching

[issue39915] AsyncMock doesn't work with asyncio.gather

2020-03-09 Thread Mads Sejersen
New submission from Mads Sejersen : When calling asyncio.gather the await_args_list is not correct. In the attached minimal example it contains only the latest call and not each of the three actual calls. Expected output: [call(0), call(1), call(2)] [call(1), call(2), call(3)] # or any

[issue39916] More reliable use of scandir in Path.glob()

2020-03-09 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Path.glob() uses os.scandir() in the following code. entries = list(scandir(parent_path)) It properly closes the internal file descriptor opened by scandir() if success because it is automatically closed closed when the iterator is exhausted. But

[issue21041] pathlib.PurePath.parents rejects negative indexes

2020-03-09 Thread Julin
Julin added the comment: Can't this be implemented? This is something that a user would expect. Intuitive. And it looks as if it is an easy change to make that doesn't disturb anything else. -- nosy: +ju-sh ___ Python tracker

[issue39916] More reliable use of scandir in Path.glob()

2020-03-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +18237 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18880 ___ Python tracker

[issue38249] Optimize out Py_UNREACHABLE in the release mode

2020-03-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue38249] Optimize out Py_UNREACHABLE in the release mode

2020-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset eebaa9bfc593d5a46b293c1abd929fbfbfd28199 by Serhiy Storchaka in branch 'master': bpo-38249: Expand Py_UNREACHABLE() to __builtin_unreachable() in the release mode. (GH-16329)

[issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

2020-03-09 Thread miss-islington
miss-islington added the comment: New changeset 5854d451cb35ac38bc07b95afeb077e8a35d5c7d by Miss Islington (bot) in branch '3.8': bpo-36184: Port python-gdb.py to FreeBSD (GH-18873) https://github.com/python/cpython/commit/5854d451cb35ac38bc07b95afeb077e8a35d5c7d --

[issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

2020-03-09 Thread miss-islington
miss-islington added the comment: New changeset 1695836123609a8ae97f2cfbe180a028dcd650a3 by Miss Islington (bot) in branch '3.7': bpo-36184: Port python-gdb.py to FreeBSD (GH-18873) https://github.com/python/cpython/commit/1695836123609a8ae97f2cfbe180a028dcd650a3 --

[issue36184] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

2020-03-09 Thread STINNER Victor
Change by STINNER Victor : -- keywords: -easy resolution: -> fixed stage: patch review -> resolved status: open -> closed title: [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD -> test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

[issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()`

2020-03-09 Thread Barney Gale
Change by Barney Gale : -- resolution: -> not a bug stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue39907] `pathlib.Path.iterdir()` wastes memory by using `os.listdir()` rather than `os.scandir()`

2020-03-09 Thread Barney Gale
Barney Gale added the comment: Thanks Rémi and Serhiy! Closing this ticket as the patch doesn't provide any sort of improvement. -- ___ Python tracker ___

[issue39915] AsyncMock doesn't work with asyncio.gather

2020-03-09 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +lisroach, xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39904] Move handling of one-argument call of type() from type.__new__() to type.__call__()

2020-03-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

2020-03-09 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 3.0 -> 4.0 pull_requests: +18238 pull_request: https://github.com/python/cpython/pull/18881 ___ Python tracker

[issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

2020-03-09 Thread miss-islington
Change by miss-islington : -- pull_requests: +18239 pull_request: https://github.com/python/cpython/pull/18882 ___ Python tracker ___

[issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD

2020-03-09 Thread STINNER Victor
STINNER Victor added the comment: New changeset 6d0ee60740f2862a878f009671b1aaa75aeb0c2a by Victor Stinner in branch 'master': bpo-36184: Port python-gdb.py to FreeBSD (GH-18873) https://github.com/python/cpython/commit/6d0ee60740f2862a878f009671b1aaa75aeb0c2a --

[issue34822] Simplify AST for slices

2020-03-09 Thread Guido van Rossum
Guido van Rossum added the comment: I'm going to review the actual code next. Regarding the omission of parentheses in various contexts, I am all for that, but I consider it a separate issue (as it only pertains to ast.unparse()). The fix in https://github.com/python/cpython/pull/17892

[issue39904] Move handling of one-argument call of type() from type.__new__() to type.__call__()

2020-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 413f01352a8268fb62bb47bde965462d7b82a06a by Serhiy Storchaka in branch 'master': bpo-39904: Move handling of one-argument call of type() from type.__new__() to type.__call__(). (GH-18852)

[issue38643] Assertion failures when calling PyNumber_ToBase() with an invalid base

2020-03-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset e5ccc94bbb153431698b2391df625e8d47a93276 by Serhiy Storchaka in branch 'master': bpo-38643: Raise SystemError instead of crashing when PyNumber_ToBase is called with invalid base. (GH-18863)

<    1   2