Commit graph

119098 commits

Author SHA1 Message Date
Nikita Sobolev
c49edd7d9c
gh-110525: Add CAPI tests for set and frozenset objects (GH-110526) 2023-10-09 11:57:48 +03:00
Tian Gao
dd4bb0529e
gh-110514: Add PY_THROW to sys.setprofile events (GH-110524) 2023-10-09 09:38:45 +01:00
Tian Gao
9f8282de6b
gh-106670: Set convenience variable for post mortem debugging (#110493) 2023-10-09 08:17:24 +00:00
Albert Villanova del Moral
0df772f555
Remove unused imports in multiprocessing docs example (#109984) 2023-10-08 22:36:01 -07:00
partev
892ee72b36
gh-110534 fix a URL redirect to wikipedia article on Fibonacci numbers (#110535) 2023-10-09 00:44:15 -04:00
Victor Stinner
7e30821b17
gh-108277: Fix test_os TimerfdTests (#110515)
* test_timerfd_TFD_TIMER_ABSTIME() and
  test_timerfd_ns_TFD_TIMER_ABSTIME() tolerate a difference of 50 us.
* test_timerfd_negative() checks if os.TFD_TIMER_CANCEL_ON_SET is
  defined.
2023-10-08 11:26:18 +00:00
Serhiy Storchaka
d96a8cdfe2
gh-89902: Deprecate non-standard format specifier "N" for Decimal (GH-110508)
It was not documented and only supported in the C implementation.
2023-10-08 10:01:39 +03:00
Nikita Sobolev
6780d63ae5
gh-110378: Move to IsolatedAsyncTestCase in test_contextlib_async.py (#110379) 2023-10-08 11:44:56 +05:30
zipperer
8e56d551ce
Update floatingpoint.rst (#110509)
This commit removes a ':'. I believe the extra colon causes a display error.

What I believe to be an error:
Above this expression
`round(math.pi, ndigits=2) == round(22 / 7, ndigits=2)`
the page displays `.. doctest::`.

What I observed:
After I remove the extra colon, the page does not display `.. doctest::`
2023-10-07 17:07:36 -07:00
denballakh
dd9d781da3
gh-110237: Check PyList_Append for errors in _PyEval_MatchClass (#110238) 2023-10-07 17:04:51 -07:00
Masaru Tsuchiyama
de2a4036cb
gh-108277: Add os.timerfd_create() function (#108382)
Add wrapper for timerfd_create, timerfd_settime, and timerfd_gettime to os module.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2023-10-07 19:33:22 +02:00
Victor Stinner
64f158e7b0
gh-110397: Add Py_IsFinalizing() to the stable ABI (#110441) 2023-10-07 17:59:16 +02:00
Serhiy Storchaka
b987fdb19b
gh-109848: Make test_rot13_func in test_codecs independent (GH-109850) 2023-10-07 16:01:39 +03:00
Serhiy Storchaka
1aad4fc5db
gh-109864: Make test_gettext tests order independent (GH-109866) 2023-10-07 16:00:28 +03:00
Eric Snow
92ca90b762
gh-76785: Support Running Some Functions in Subinterpreters (gh-110251)
This specifically refers to `test.support.interpreters.Interpreter.run()`.
2023-10-06 17:52:22 -06:00
Charlie Zhao
de1052245f
gh-106078: Suppress the warning caused by multi-phase initialization of decimal (#107524) 2023-10-07 00:15:19 +01:00
Brett Cannon
5fd8821cf8
GH-110455: Guard assert(tstate->thread_id > 0) with #ifndef HAVE_PTHREAD_STUBS (GH-110487) 2023-10-06 16:12:19 -07:00
Shantanu
f013b47504
gh-110489: Optimise math.ceil for known exact float (#108801)
This matches a similar optimisation done for math.floor in
https://github.com/python/cpython/pull/21072
2023-10-06 22:57:18 +00:00
jtranquilli
201dc11aeb
gh-109286: Update Windows installer to use SQLite 3.43.1 (#110403)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-10-06 17:12:15 +02:00
InSync
02cdaefe9a
Fix typo in Doc/library/textwrap.rst (#110328)
"One problem with this is algorithm is that [...]" -> "One problem with this algorithm is that [...]"
2023-10-06 14:25:02 +00:00
Victor Stinner
d023d4166b
gh-110184: Fix subprocess test_pipesize_default() (#110465)
For proc.stdin, get the size of the read end of the test pipe.

Use subprocess context manager ("with proc:").
2023-10-06 15:44:53 +02:00
Victor Stinner
a4baa9e8ac
gh-103053: Fix test_tools.test_freeze on FreeBSD (#110451)
Fix test_tools.test_freeze on FreeBSD: run "make distclean" instead
of "make clean" in the copied source directory to remove also the
"python" program.

Other test_freeze changes:

* Log executed commands and directories, and the current directory.
* No longer uses make -C option to change the directory, instead use
  subprocess cwd parameter.
2023-10-06 03:08:34 +02:00
Victor Stinner
a155f9f342
gh-103053: Fix make check-clean-src: check "python" program (#110449)
"make check-clean-src" now also checks if the "python" program is
found in the source directory: fail with an error if it does exist.
2023-10-06 00:46:52 +00:00
Victor Stinner
e0c4437793
Add support.MS_WINDOWS constant (#110446) 2023-10-06 02:37:28 +02:00
Carl Meyer
3c0f65ebce
gh-109287: fix overrides in cases generator (#110419) 2023-10-05 15:05:29 -07:00
Victor Stinner
bb057b3370
gh-85283: Add PySys_AuditTuple() function (#108965)
sys.audit() now has assertions to check that the event argument is
not NULL and that the format argument does not use the "N" format.

Add tests on PySys_AuditTuple().
2023-10-05 21:59:35 +00:00
Victor Stinner
aaf297c048
gh-109888: Fix test_os _kill_with_event() on Windows (#110421)
Replace os.kill() with proc.kill() which catchs PermissionError.

Rewrite _kill_with_event():

* Use subprocess context manager ("with proc:").
* Use sleeping_retry() to wait until the child process is ready.
* Replace SIGINT with proc.kill() on error.
* Replace 10 seconds with SHORT_TIMEOUT to wait until the process is
  ready.
* Replace 0.5 seconds with SHORT_TIMEOUT to wait for the process
  exit.
2023-10-05 21:40:49 +00:00
Victor Stinner
fb6c4ed2bb
gh-110429: Fix race condition in "make regen-all" (#110433)
"make regen-pegen" now creates a temporary file called "parser.c.new"
instead of "parser.new.c". Previously, if "make clinic" was run in
parallel with "make regen-all", clinic may try but fail to open
"parser.new.c" if the temporay file was removed in the meanwhile.
2023-10-05 22:26:37 +02:00
Bradley Reynolds
d257479c2f
gh-110383: Swap 'the all' -> 'all the' in socket docs (#110434) 2023-10-05 19:55:44 +00:00
Sam Gross
3c2f3215cc
gh-110119: Fix test_importlib --disable-gil Windows test failures (#110422)
Use "t" in the expected tag for `--disable-gil` builds in test_tagged_suffix.
2023-10-05 19:51:17 +00:00
Victor Stinner
5eae8dc2cb
gh-109840: Fix multiprocessing test_waitfor_timeout() (#110428)
Don't measure the CI performance: don't fail if cond.wait_for() takes
longer than 1 second on a slow CI.
2023-10-05 19:32:06 +00:00
Victor Stinner
0db2f1475e
gh-110167: Increase support.LOOPBACK_TIMEOUT to 10 seconds (#110413)
Increase support.LOOPBACK_TIMEOUT from 5 to 10 seconds. Also increase
the timeout depending on the --timeout option. For example, for a
test timeout of 40 minutes (ARM Raspbian 3.x), use LOOPBACK_TIMEOUT
of 20 seconds instead of 5 seconds before.
2023-10-05 20:54:27 +02:00
Victor Stinner
318f5df271
gh-110167: Fix test_socket deadlock in doCleanups() (#110416)
Fix a deadlock in test_socket when server fails with a timeout but
the client is still running in its thread. Don't hold a lock to call
cleanup functions in doCleanups(). One of the cleanup function waits
until the client completes, whereas the client could deadlock if it
called addCleanup() in such situation.

doCleanups() is called when the server completed, but the client can
still be running in its thread especially if the server failed with a
timeout. Don't put a lock on doCleanups() to prevent deadlock between
addCleanup() called in the client and doCleanups() waiting for
self.done.wait of ThreadableTest._setUp().
2023-10-05 20:53:03 +02:00
AN Long
1f3af03f83
gh-110147: test_msvcrt: run console I/O tests in new processes (#110268) 2023-10-05 19:52:26 +02:00
Harmen Stoppels
a13620685f
Fix env var typo in perf profiling docs (#110404)
Fix typo in docs
2023-10-05 20:27:19 +03:00
Towster15
a973bf0f97
gh-110383 TimeIt Docs Spelling Fix (#110407)
Make 0.2 second plural
2023-10-05 17:01:35 +00:00
Victor Stinner
e37d4557c3
gh-110391: socket NetworkConnectionAttributesTest always declare cli (#110401)
NetworkConnectionAttributesTest of test_socket now always declare the
'cli' attribute, so clientTearDown() cannot fail with AttributeError.
2023-10-05 18:31:02 +02:00
Sam Gross
6e97a9647a
gh-109549: Add new states to PyThreadState to support PEP 703 (gh-109915)
This adds a new field 'state' to PyThreadState that can take on one of three values: _Py_THREAD_ATTACHED, _Py_THREAD_DETACHED, or _Py_THREAD_GC.  The "attached" and "detached" states correspond closely to acquiring and releasing the GIL.  The "gc" state is current unused, but will be used to implement stop-the-world GC for --disable-gil builds in the near future.
2023-10-05 09:46:33 -06:00
Michael Droettboom
9eb2489266
gh-109329: Add stat for "trace too short" (GH-110402) 2023-10-05 16:12:06 +01:00
Victor Stinner
1328fa31fe
gh-110393: Remove watchdog with hardcoded timeout (#110400)
test_builtin and test_socketserver no longer use signal.alarm() to
implement a watchdog with a hardcoded timeout (2 and 60 seconds).
Python test runner regrtest has two watchdogs: faulthandler and
timeout on running worker processes. Tests using short hardcoded
timeout can fail on slowest buildbots just because the timeout is too
short.
2023-10-05 15:02:48 +00:00
박문식
d33aa18f15
gh-82367: Use FindFirstFile Win32 API in ntpath.realpath() (GH-110298)
* Use `FindFirstFile` Win32 API to fix a bug where `ntpath.realpath()`
breaks out of traversing a series of paths where a (handled)
`ERROR_ACCESS_DENIED` or `ERROR_SHARING_VIOLATION` occurs.
* Update docs to reflect that `ntpath.realpath()` eliminates MS-DOS
style names.
2023-10-05 09:49:07 -05:00
sunmy2019
2cb62c6437
gh-110309: Prune empty constant in format specs (#110320)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2023-10-05 14:08:42 +00:00
Pablo Galindo Salgado
cc389ef627
gh-110259: Fix f-strings with multiline expressions and format specs (#110271)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
2023-10-05 14:26:44 +01:00
Victor Stinner
af29282fce
gh-110367: Fix regrtest test_worker_output_on_failure() on ASAN build (#110387)
Set ASAN_OPTIONS="handle_segv=0" env var to run the test.
2023-10-05 14:42:36 +02:00
Nikita Sobolev
2bbbab212f
gh-110365: Fix error overwrite in termios.tcsetattr (#110366)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-10-05 11:02:52 +00:00
Victor Stinner
6592976061
gh-110367: Enhance regrtest -jN --verbose3 (#110368)
When using worker processes (-jN) with --verbose3 option, regrtest
can now display the worker output even if a worker process does
crash.  Previously, sys.stdout and sys.stderr were replaced and so
the worker output was lost on a crash.
2023-10-05 08:24:43 +02:00
Benjamin Peterson
313aa861ce
Remove duplicate word. (#110376) 2023-10-05 15:18:17 +11:00
Sam Gross
cf6f23b0e3
gh-88402: Add new sysconfig variables on Windows (GH-110049)
Co-authored-by: Filipe Laíns <filipe.lains@gmail.com>
2023-10-04 22:50:29 +00:00
Eric Snow
80dc39e1dc
gh-110310: Add a Per-Interpreter XID Registry for Heap Types (gh-110311)
We do the following:

* add a per-interpreter XID registry (PyInterpreterState.xidregistry)
* put heap types there (keep static types in _PyRuntimeState.xidregistry)
* clear the registries during interpreter/runtime finalization
* avoid duplicate entries in the registry (when _PyCrossInterpreterData_RegisterClass() is called more than once for a type)
* use Py_TYPE() instead of PyObject_Type() in _PyCrossInterpreterData_Lookup()

The per-interpreter registry helps preserve isolation between interpreters.  This is important when heap types are registered, which is something we haven't been doing yet but I will likely do soon.
2023-10-04 16:35:27 -06:00
Michael Droettboom
e561e98058
GH-109329: Add tier 2 stats (GH-109913) 2023-10-04 14:52:28 -07:00