STINNER Victor added the comment:
New changeset 80285ecc8deaa2b0e7351bf4be863d1a0ad3c188 by Miss Islington (bot)
in branch '3.10':
closes bpo-44751: Move crypt.h include from public header to _cryptmodule
(GH-27394) (GH-28636)
https://github.com/python/cpython/commit
Change by STINNER Victor :
--
pull_requests: +27009
pull_request: https://github.com/python/cpython/pull/28641
___
Python tracker
<https://bugs.python.org/issue43
STINNER Victor added the comment:
Another recent crash involving libffi, closure, fork and SELinux:
https://bugzilla.redhat.com/show_bug.cgi?id=1977410 This bug comes from libffi,
not from Python (but it can be easily reproducing using ctypes which uses
libffi).
--
nosy: +vstinner
STINNER Victor added the comment:
> "Assertion failed: Py_IS_TYPE(rl, _Type), file
> D:\a\1\s\Modules_asynciomodule.c, line 261"
The _asyncio extension uses static types and doesn't implement the multiphase
initialization API. It doesn't work well with your "de
STINNER Victor added the comment:
> but there is a catch -- the arguments should be a C int. If it is not, you
> can break a stack.
I never understood how "..." arguments work under the hood. What happens if you
pass a double, it is stored as a double on the C stack, and the
STINNER Victor added the comment:
I would be interested to see how the "p" format could be used in existing code.
I found a few places would benefit of it. Either create a new draft PR, or put
it in the same PR 28634.
Modules/_itertoolsmodule.c:
return Py_BuildValu
Change by STINNER Victor :
--
Removed message: https://bugs.python.org/msg402889
___
Python tracker
<https://bugs.python.org/issue36207>
___
___
Python-bug
Change by STINNER Victor :
--
keywords: +patch
pull_requests: +26999
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/28629
___
Python tracker
<https://bugs.python.org/issu
STINNER Victor added the comment:
> File
> "/home/abuild/rpmbuild/BUILD/Python-3.7.9/Lib/multiprocessing/queues.py",
> line 224 in _feed
Python 3.7 no longer accept bugfixes: I close the issue.
You can open a new issue if you can reproduce the issue on Python
Change by STINNER Victor :
--
nosy: +petr.viktorin, vstinner
___
Python tracker
<https://bugs.python.org/issue45319>
___
___
Python-bugs-list mailing list
Unsub
STINNER Victor added the comment:
I propose to only rename header files in Python 3.11.
For Python 3.9 and 3.10, I suggest to modify Include/cpython/pystate.h by
replacing:
#include "cpython/initconfig.h"
with:
#include "initconfig.h"
STINNER Victor added the comment:
I'm not sure why Include/cpython/ is part of the compiler include directories.
I am not sure why Include/ is *not* part of the compiler include directory.
Anyway, it's hard to control how people build Python and there are always legit
use cases where you
Change by STINNER Victor :
--
nosy: -vstinner
___
Python tracker
<https://bugs.python.org/issue45308>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by STINNER Victor :
--
title: pystate.h contains non-relative of initconfig.h include causing macOS
Framework include failure -> Include/cpython/pystate.h contains non-relative of
initconfig.h include causing macOS Framework include fail
Change by STINNER Victor :
--
pull_requests: +26982
pull_request: https://github.com/python/cpython/pull/28612
___
Python tracker
<https://bugs.python.org/issue39
STINNER Victor added the comment:
I marked bpo-40642 as a duplicate of this issue.
--
___
Python tracker
<https://bugs.python.org/issue39026>
___
___
Python-bug
STINNER Victor added the comment:
I mark this issue as a duplicate of bpo-39026.
--
resolution: -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder: -> pystate.h contains non-relative of initconfig.h include causing
macOS Framework inc
STINNER Victor added the comment:
Having two header files with the same name in two directories which are part of
the include directories is causing issues like this one :-(
For the internal C API, I solve the issue by adding "pycore_" prefix to
filenames.
Maybe pystate.h should
STINNER Victor added the comment:
See also bpo-45316: [C API] Functions not exported with PyAPI_FUNC().
--
nosy: +vstinner
___
Python tracker
<https://bugs.python.org/issue45
New submission from STINNER Victor :
The Python C API contains multiple functions which are not exported with
PyAPI_FUNC() and so are not usable.
Public functions:
---
void PyLineTable_InitAddressRange(const char *linetable, Py_ssize_t length, int
firstlineno, PyCodeAddressRange *range);
int
STINNER Victor added the comment:
> We could just forbid error handlers returning position not in the range
> (start , end]
Yeah, that sounds like a reasonable solution. I don't see the point of
returning a position outside this range. What would be the use case?
For me, the only
STINNER Victor added the comment:
> I still have some questions about is
The Python bug tracker is not a forum for asking help how to use Python. Please
stop reopening this issue.
--
resolution: -> not a bug
status: open -> closed
_
STINNER Victor added the comment:
> I would like to suggest making this change (or something similar) to the
> official version of "shlex.py". Would sending an email to
> "python-id...@python.org" be a good place to make this proposal?
Yes, python-ideas is a g
Change by STINNER Victor :
--
Removed message: https://bugs.python.org/msg394832
___
Python tracker
<https://bugs.python.org/issue42972>
___
___
Python-bug
STINNER Victor added the comment:
> Until 3.10 makes equivalent functionality available or another workaround is
> supported,
I don't understand which long term solution do you propose.
> a properly designed public API is probably a better solution
Can you propose a p
New submission from STINNER Victor :
AMD64 Fedora Stable LTO + PGO 3.10 (build 357):
https://buildbot.python.org/all/#/builders/651/builds/357
First test_multiprocessing_forkserver failed, then test_multiprocessing_spawn,
then test_multiprocessing_fork.
I confirm that these tests fail
STINNER Victor added the comment:
That's the principle of fork. You should use a different spawn method if you
don't want to inherit resources inherited from the parent process, like spawn
or forkserver:
https://docs.python.org/dev/library/multiprocessing.html#contexts-and-start-methods
STINNER Victor added the comment:
Better late than never. I only took 15 years to fix this old bug :-D
--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.2
___
Python tracker
<https://bugs.python.org/issue1596
STINNER Victor added the comment:
New changeset 94d19f606fa18a1c4d2faca1caf2f470a8ce6d46 by Victor Stinner in
branch '3.9':
bpo-1596321: Fix threading._shutdown() for the main thread (GH-28549) (GH-28589)
https://github.com/python/cpython/commit/94d19f606fa18a1c4d2faca1caf2f470a8ce6d46
STINNER Victor added the comment:
Eryk:
> SleepConditionVariableSRW() can't be interrupted in PyCOND_WAIT() and
> PyCOND_TIMEDWAIT().
Oh. A comment on StackOverlow says:
"The WaitForXxx functions accept parameters of the generic HANDLE type, which
represents a handle
Change by STINNER Victor :
--
pull_requests: +26971
pull_request: https://github.com/python/cpython/pull/28589
___
Python tracker
<https://bugs.python.org/issue1596
STINNER Victor added the comment:
New changeset 95d31370829b7d729667588e0a9943217401ea5b by Victor Stinner in
branch 'main':
bpo-1596321: Fix threading._shutdown() for the main thread (GH-28549)
https://github.com/python/cpython/commit/95d31370829b7d729667588e0a9943217401ea5b
STINNER Victor added the comment:
time.sleep() is now implemented with a waitable timer and
WaitForMultipleObjects() on Windows. It uses _PyOS_SigintEvent() so it can be
interrupted with CTRL+C.
commit 58f8adfda3c2b42f654a55500e8e3a6433cb95f2
Author: Victor Stinner
Date: Wed Sep 22 16:09
STINNER Victor added the comment:
See also bpo-29971 "Lock.acquire() not interruptible on Windows".
--
___
Python tracker
<https://bugs.python.o
STINNER Victor added the comment:
See also bpo-45301 "pycore_condvar.h: remove Windows conditonal variable
emulation".
--
___
Python tracker
<https://bugs.python.o
New submission from STINNER Victor :
I recently worked on time.sleep() enhancement (bpo-21302) and threading
bugfixes (bpo-45274, bpo-1596321). I saw one more time that Python emulates
conditional variables to support Windows XP and older. But Python 3.11 requires
Windows 8.1 or newer. IMO
STINNER Victor added the comment:
See also bpo-21822: some comments are about this issue. It's a duplicate of
bpo-45274 "Race condition in Thread._wait_for_tstate_lock()".
--
___
Python tracker
<https://bugs.python.o
STINNER Victor added the comment:
> This is the same as bpo-21822, so I suppose it should be closed as well with
> a reference to this issue.
You're right. I marked bpo-21822 as a duplicate of this issue.
--
___
Python tracker
STINNER Victor added the comment:
I mark this issue as a duplicate of bpo-45274.
--
I fixed bpo-45274 with this change:
New changeset a22be4943c119fecf5433d999227ff78fc2e5741 by Victor Stinner in
branch 'main':
bpo-45274: Fix Thread._wait_for_tstate_lock() race condition (GH-28532)
https
STINNER Victor added the comment:
> I am having the same blocked signal issue on Windows when using Thread.join.
> This program does not print "interrupted" after pressing Ctrl+C:
This is a different issue: bpo-29971. Currently, threading.Lock.acquire()
cannot be inter
STINNER Victor added the comment:
Copy of Antoine Pitrou's msg316024 (bpo-21822):
multiprocessing semaphores support Ctrl-C under Windows, so it should be doable
for regular locks as well (notice the `sigint_event`):
https://github.com/python/cpython/blob/master/Modules/_multiprocessing
New submission from STINNER Victor :
Build Python documentatioin with:
make -C Doc/ PYTHON=../python venv
LANG= PYTHONTRACEMALLOC=10 make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W
-j10" doctest 2>&1|tee log
See the logs:
/home/vstinner/python/main/Lib/socket.py:776
Change by STINNER Victor :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.9
___
Python tracker
<https://bugs.python.or
STINNER Victor added the comment:
New changeset fae2694bea5e9e5a114af8cb40b60e7131a6340c by Miss Islington (bot)
in branch '3.10':
bpo-45274: Fix Thread._wait_for_tstate_lock() race condition (GH-28532)
(GH-28580)
https://github.com/python/cpython/commit
STINNER Victor added the comment:
New changeset a22be4943c119fecf5433d999227ff78fc2e5741 by Victor Stinner in
branch 'main':
bpo-45274: Fix Thread._wait_for_tstate_lock() race condition (GH-28532)
https://github.com/python/cpython/commit/a22be4943c119fecf5433d999227ff78fc2e5741
Change by STINNER Victor :
--
resolution: -> not a bug
___
Python tracker
<https://bugs.python.org/issue45261>
___
___
Python-bugs-list mailing list
Un
STINNER Victor added the comment:
Storing the result of Thread.run() can keep Python objects alive longer than
expected and it may require a lock on it. I don't think that the additional
complexity is worth it. I suggest to reorganize your code to pass the result
differently to the caller
Change by STINNER Victor :
--
title: [threading] Executor#shutdown with timeout ->
concurrent.futures.threading: Add a timeout to Executor shutdown() method
___
Python tracker
<https://bugs.python.org/issu
STINNER Victor added the comment:
> As I first mentioned in my post[1] on comp.lang.python, it seems possible to
> modify a dict while a lookup is ongoing, without causing the lookup to
> restart.
That's a bad practice. Python dict raises an exception in some cases:
RuntimeEr
Change by STINNER Victor :
--
title: Implement PEP 654 -> Implement PEP 654: Exception Groups
___
Python tracker
<https://bugs.python.org/issue45292>
___
_
STINNER Victor added the comment:
Marc-Andre: I suppose that you're talking about LANDMARK in Modules/getpath.c
and PC/getpathp.c.
--
___
Python tracker
<https://bugs.python.org/issue45
STINNER Victor added the comment:
> Do you have any information about when will be it released in 3.11?
Here is a schedule of Python 3.11 releases:
https://www.python.org/dev/peps/pep-0664/
In the meanwhile, you can develop a C extension to get the feat
STINNER Victor added the comment:
Thanks Livius for all these nice enhancements!
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
STINNER Victor added the comment:
New changeset 7834ff26cbcd4d8394d64d80d9f51a364d38b1c6 by Victor Stinner in
branch 'main':
bpo-21302: Add nanosleep() implementation for time.sleep() in Unix (GH-28545)
https://github.com/python/cpython/commit/7834ff26cbcd4d8394d64d80d9f51a364d38b1c6
STINNER Victor added the comment:
> I am not sure that it can be solved at Python level.
Right. In pure Python, we cannot write code which works in all cases. My PR
28532 fix the most common case: application interrupted by a single CTRL+C.
> with suppress_interrupt(): (...)
It's imp
STINNER Victor added the comment:
I close the issue.
> bpo-41299: Fix EnterNonRecursiveMutex() (GH-28548)
I don't think that it's worth it to backport this change to 3.9 and 3.10. In
practice, Py_FatalError() will never be called, and _PyTime_GetMonotonicClock()
result must alw
STINNER Victor added the comment:
New changeset 6bc89116cb121c176453b9745e3daa2cc5df43ab by Victor Stinner in
branch 'main':
bpo-41299: Mark private thread_nt.h functions as static (GH-28553)
https://github.com/python/cpython/commit/6bc89116cb121c176453b9745e3daa2cc5df43ab
STINNER Victor added the comment:
Analysis use use_tracing usage in 3rd part code.
I see two main ways to add C API functions covering these use cases:
* Provide high-level functions like "call a trace function" (disable tracing,
call trace function, reenable tracing, increment
STINNER Victor added the comment:
New changeset d639e3170506a1a80c4b2f1b3a6250bb95ff190a by Victor Stinner in
branch 'main':
bpo-41299: Fix EnterNonRecursiveMutex() (GH-28548)
https://github.com/python/cpython/commit/d639e3170506a1a80c4b2f1b3a6250bb95ff190a
STINNER Victor added the comment:
New changeset f35ddf24227e834c9b6b39ad23a0ec382b4de48b by Victor Stinner in
branch 'main':
bpo-41299: QueryPerformanceFrequency() cannot fail (GH-28552)
https://github.com/python/cpython/commit/f35ddf24227e834c9b6b39ad23a0ec382b4de48b
Change by STINNER Victor :
--
pull_requests: +26936
pull_request: https://github.com/python/cpython/pull/28553
___
Python tracker
<https://bugs.python.org/issue41
Change by STINNER Victor :
--
pull_requests: +26935
pull_request: https://github.com/python/cpython/pull/28552
___
Python tracker
<https://bugs.python.org/issue41
STINNER Victor added the comment:
I fail to reproduce the leak using attached script.
I close the issue.
I get constant memory usage on Linux with the main branch of Python (future
3.11):
(...)
VmRSS: 11344 kB
VmRSS: 11344 kB
VmRSS: 11344 kB
VmRSS: 11344 kB
VmRSS: 11344
STINNER Victor added the comment:
You must join thread using thread.join().
If I add .join() calls, threading.active_count() stays around 2, it doesn't
grow.
It's not a bug in Python.
--
resolution: -> not a bug
stage: -> resolved
status: open -&g
STINNER Victor added the comment:
I cannot reproduce the issue. IMO it has been fixed.
Moreover, you must join timers using timer.join(): a timer remains a thread.
Code:
---
import os
import threading
os.system(f"grep ^VmRSS /proc/{os.getpid()}/status")
# warmup
for n in range(10):
STINNER Victor added the comment:
I proposed PR 28549 to fix this very old threading issue.
A C extension can spawn threads without using the threading module and then
then run Python code which imports the threading module. In this case,
threading._main_thread is the thread which imported
Change by STINNER Victor :
--
keywords: +patch
nosy: +vstinner
nosy_count: 14.0 -> 15.0
pull_requests: +26932
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/28549
___
Python tracker
<https://bugs.p
STINNER Victor added the comment:
Calling Py_FatalError() must be avoided by any mean. I spent significant time
to remove Py_FatalError() at Python startup in my PEP 587 implementation:
https://www.python.org/dev/peps/pep-0587/
I also removed Py_FatalError() calls to report errors
STINNER Victor added the comment:
I created PR #28548 to remove the Py_FatalError() code path.
--
___
Python tracker
<https://bugs.python.org/issue41
Change by STINNER Victor :
--
pull_requests: +26931
pull_request: https://github.com/python/cpython/pull/28548
___
Python tracker
<https://bugs.python.org/issue41
STINNER Victor added the comment:
Jeremy Maitin-Shepard: "In general, I view hanging threads as the least bad
thing to do when faced with either acquiring the GIL or not returning at all.
There is a lot of existing usage of Python that currently poses a risk of
random crashes and m
STINNER Victor added the comment:
Another example where a developer asks to call abort() to notice bugs, whereas
Python previously silently ignored it: bpo-36829. Calling abort() is a legit
use case, but not really the best default behavior. Again, the problem was
solved by letting
STINNER Victor added the comment:
Gregory P. Smith: Python has many API using callbacks:
PEP 445 added PyMem_SetAllocator() to set memory allocator. Adding
PyMem_GetAllocator() also made possible to chain allocators and to "hook" into
an existing allocator to execute code before
STINNER Victor added the comment:
> In this case that unexpected thread simply disappearing can lead to a
> deadlock in our process.
This problem also remains me the very complex case of bpo-6721: "Locks in the
standard library should be sanitized on fork". The issue ti
Change by STINNER Victor :
--
pull_requests: +26929
pull_request: https://github.com/python/cpython/pull/28545
___
Python tracker
<https://bugs.python.org/issue21
Change by STINNER Victor :
--
pull_requests: +26926
pull_request: https://github.com/python/cpython/pull/28542
___
Python tracker
<https://bugs.python.org/issue43
Change by STINNER Victor :
--
nosy: +pablogsal
stage: patch review ->
___
Python tracker
<https://bugs.python.org/issue45274>
___
___
Python-bugs-list mai
Change by STINNER Victor :
--
pull_requests: +26920
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/28532
___
Python tracker
<https://bugs.python.org/issu
STINNER Victor added the comment:
For curious people, see also bpo-44422 "Fix threading.enumerate() reentrant
call": another example of race condition recently fixed in the threading
module. But it's unrelated to this bug ;-)
--
Change by STINNER Victor :
Added file: https://bugs.python.org/file50300/threading_bug.py
___
Python tracker
<https://bugs.python.org/issue45274>
___
___
Python-bug
New submission from STINNER Victor :
Bernát Gábor found an interesting bug on Windows. Sometimes, when a process is
interrupted on Windows with CTRL+C, its parent process hangs in thread.join():
https://twitter.com/gjbernat/status/1440949682759426050
Reproducer:
* Install https://github.com
STINNER Victor added the comment:
New changeset f4ccb79d52ee726d58bbb038ea98b4deec52001d by Victor Stinner in
branch 'main':
bpo-43760: Document PyThreadState.use_tracing removal (GH-28527)
https://github.com/python/cpython/commit/f4ccb79d52ee726d58bbb038ea98b4deec52001d
STINNER Victor added the comment:
I'm not comfortable with PR 28525 which always hang threads which attempt to
acquire the GIL after Python exited.
I would prefer to keep the current behavior by default, but give the ability to
applications embedding Python to decide what to do.
With my
STINNER Victor added the comment:
New changeset ec7ffa4b5b262369f726a54e145e9c03eaeb4c1a by Victor Stinner in
branch 'main':
bpo-41137: Reorganize What's New in Python 3.11 (GH-28518)
https://github.com/python/cpython/commit/ec7ffa4b5b262369f726a54e145e9c03eaeb4c1a
STINNER Victor added the comment:
I created PR 28527 to document PyThreadState.use_tracing removal and explain
how to port existing code to Python 3.10.
--
___
Python tracker
<https://bugs.python.org/issue43
Change by STINNER Victor :
--
pull_requests: +26918
pull_request: https://github.com/python/cpython/pull/28527
___
Python tracker
<https://bugs.python.org/issue43
Change by STINNER Victor :
--
title: Remove the usage of the cstack in Python to Python calls -> Remove the
usage of the C stack in Python to Python calls
___
Python tracker
<https://bugs.python.org/issu
STINNER Victor added the comment:
I suggest to close this issue. timeit works as expected. It has limitations,
but that's ok. Previous attempts to enhance timeit were rejected.
--
___
Python tracker
<https://bugs.python.org/issue45
STINNER Victor added the comment:
> but you give no reason for why you should not use the minimum.
See https://pyperf.readthedocs.io/en/latest/analyze.html#minimum-vs-average
I'm not really interested to convince you. Use the minimum if you believe that
it better fits your ne
STINNER Victor added the comment:
See also bpo-19007: "precise time.time() under Windows 8: use
GetSystemTimePreciseAsFileTime".
--
___
Python tracker
<https://bugs.python.o
STINNER Victor added the comment:
Livius: do you care about using nanosleep(), or can I close the issue?
--
___
Python tracker
<https://bugs.python.org/issue21
STINNER Victor added the comment:
> On Windows with a Python 3.11 debug build, I get:
> Mean +- std dev: 21.9 ms +- 7.8 ms (228 values)
I wrote an optimization to cache the Windows timer handle between time.sleep()
calls (don't close it). I don't think that it's needed because they sh
STINNER Victor added the comment:
bench.py: measure the shortest possible sleep. Use time.sleep(1e-10): 0.1
nanosecond. It should be rounded to the resolution of the used sleep function,
like 1 ns on Linux.
On Linux with Fedora 34 Python 3.10 executable, I get:
Mean +- std dev: 60.5 us
STINNER Victor added the comment:
Livius: your first PR modified Sleep() in Modules/_tkinter.c to use
nanosleep(). I don't see the point since this function has a solution of 1 ms
(10^-3). Using select() on Unix is enough: resolution of 1 us (10^-6
STINNER Victor added the comment:
New changeset 58f8adfda3c2b42f654a55500e8e3a6433cb95f2 by Victor Stinner in
branch 'main':
bpo-21302: time.sleep() uses waitable timer on Windows (GH-28483)
https://github.com/python/cpython/commit/58f8adfda3c2b42f654a55500e8e3a6433cb95f2
Change by STINNER Victor :
--
nosy: +vstinner
___
Python tracker
<https://bugs.python.org/issue45256>
___
___
Python-bugs-list mailing list
Unsubscribe:
STINNER Victor added the comment:
commit a0bd9e9c11f5f52c7ddd19144c8230da016b53c6
Author: Serhiy Storchaka
Date: Sat May 8 22:33:10 2021 +0300
bpo-28307: Convert simple C-style formatting with literal format into
f-string. (GH-5012)
C-style formatting with literal format
STINNER Victor added the comment:
> But timing results are not like that, the measurement errors are
one-sided, not two: (..)
I suggest you to run tons of benchmarks and look at the distribution. The
reality is more complex than what you may think.
> measurement = true value +
Change by STINNER Victor :
--
nosy: +vstinner
nosy_count: 4.0 -> 5.0
pull_requests: +26909
pull_request: https://github.com/python/cpython/pull/28518
___
Python tracker
<https://bugs.python.org/issu
STINNER Victor added the comment:
PyPy emits a warning when the timeit module is used, suggesting to use pyperf.
timeit uses the minimum, whereas pyperf uses the average (arithmetic mean).
timeit uses a single process, pyperf spawns 21 processes: 1 just for the loop
calibration, 20
1501 - 1600 of 34965 matches
Mail list logo