Cody Maloney
974532e758
gh-138013: Move I/O tests to test_io ( #138365 )
...
Centralize `io` tests into the `test_io` module so they are easier to
find and work on. This will make it easier to split `test_general` which
takes 30+ seconds in a debug build on my machine.
This renames `test_bufio` to be `test_bufferedio` so that it matches
the implementation file name (`bufferedio.c`).
Validation performed:
Tests are run in parallel after change:
```bash
./python.exe -m test test_io -uall,largefile,extralargefile -M12G -j8
```
Docstring reformat in `test_io/__init__.py` looks reasonable:
```python
>>> import test.test_io
>>> help(test.test_io)
```
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-03 11:37:06 +02:00
Serhiy Storchaka
7274d07607
gh-78502: Add a trackfd parameter to mmap.mmap() on Windows (GH-138238)
...
If trackfd is False, the file handle corresponding to fileno
will not be duplicated.
2025-09-03 11:31:34 +03:00
Serhiy Storchaka
4a33077fdb
gh-138264: Fix gcc 14 compiler warnings (GH-138265)
2025-09-03 11:26:56 +03:00
Zackery Spytz
32032ee376
gh-87595: Support mmap.size() for anonymous mapping on Unix (GH-24781)
...
Previously, the size would be returned on Windows and an OSError would
be raised on Unix.
Also, raise ValueError instead of OSError for trackfd=False.
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-09-02 23:24:06 +03:00
Brian Schubert
5493b46462
gh-138372: Fix SyntaxWarning for erroneous t-string subscription ( #138375 )
2025-09-02 18:13:12 +01:00
AN Long
b3e785c76c
gh-138314: Add winreg.DeleteTree (GH-138388)
2025-09-02 17:04:57 +00:00
Pieter Eendebak
2d3711dc06
gh-136599: Add tests for long_hash ( #138335 )
...
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-09-02 18:42:12 +02:00
Serhiy Storchaka
33fcb0c4a0
gh-138204: Forbid expansion of a shared anonymous mmap on Linux (GH-138220)
...
This is a Linux kernel bug which caused a bus error.
https://bugzilla.kernel.org/show_bug.cgi?id=8691
2025-09-02 19:00:39 +03:00
jadonduff
c19db1d2b8
gh-138004: Fix setting a thread name on OpenIndiana (GH-138017)
...
Encode Solaris/Illumos thread names to ASCII, since
OpenIndiana does not support non-ASCII names.
Add tests for setting non-ASCII name for the main thread.
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-09-02 15:26:25 +00:00
Sebastian Rittau
3f23888fd7
gh-127647: Fix and enable I/O protocol tests ( #138369 )
2025-09-02 06:45:29 -07:00
Serhiy Storchaka
cb18269e1b
gh-138253: Fix compatibility of sub-interpreters queues with queue.Queue (GH-138256)
...
Add the block parameter in the put() and get() methods of
the concurrent.interpreters queues for compatibility with the
queue.Queue interface.
2025-09-02 08:59:20 +03:00
Gregory P. Smith
a2ba0a7552
gh-61206: Support zstandard compression in the zipimport module (GH-138254)
...
* gh-61206: support zstd in zipimport
* NEWS entry
* versionchanged doc
2025-09-01 17:14:23 -07:00
Christoph Walcher
47bc10e6b3
gh-135763: AC: Implement `allow_negative for Py_ssize_t` ( #138150 )
...
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-01 22:55:22 +01:00
Andrey
7c92497e5c
gh-138360: Fix test_free_threading for IO objects ( #138359 )
...
Fix typo in test_io.py
2025-09-01 19:53:13 +00:00
Tapeline
ea77feecbb
gh-138302: Specialize int ops only if ints are compact (GH-138347)
2025-09-02 01:33:15 +08:00
Marc Mueller
6528cf47a0
gh-90548: Fix musl version detection with --strip-all ( #137864 )
...
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-09-01 18:58:45 +02:00
Pieter Eendebak
0d02e4d7d3
gh-116738: Fix test_json_mutating_exact_dict ( #138339 )
...
Fix test_json_mutating_exact_dic
2025-09-01 21:44:19 +05:30
Jason R. Coombs
9b38c6698a
Reapply "gh-132947: Apply changes from importlib_metadata 8.7 ( #137885 )" ( #137924 ) ( #137930 )
...
* Reapply "gh-132947: Apply changes from importlib_metadata 8.7 (#137885 )" (#137924 )
This reverts commit 3706ef66ef .
* Skip the triggering test on buildbots only.
2025-09-01 11:27:01 -04:00
Hood Chatham
11a5fc8238
gh-138130: Fix return value of libc_ver() on Emscripten ( #138132 )
...
Emscripten's libc is a hybrid of musl and llvm libc; but it reports that it is
"glibc". This modifies the return value of `platform.libc_ver()` to return
something that is Emscripten-specific.
2025-09-01 06:50:29 +08:00
Cody Maloney
15e37ea6b7
gh-138013: Make `test.test_io` into a package ( #138153 )
2025-08-31 20:14:19 +01:00
Pieter Eendebak
43573028c6
gh-116738: Make _json module thread-safe in the free-threading ( #119438 )
...
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-08-31 09:42:45 +05:30
Ron Frederick
bacb7771fb
gh-137197: Add SSLContext.set_ciphersuites to set TLSv1.3 ciphers ( #137198 )
...
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-08-30 09:32:11 +00:00
Wulian233
5c6937ad20
gh-133656: Remove deprecated zipimport.zipimporter.load_module (GH-133662)
...
Remove deprecated `zipimport.zipimporter.load_module`.
2025-08-30 01:28:18 +00:00
Ju4tCode
025a2135ef
gh-137317: Fix inspect.signature() for class with wrapped __init__ or __new__ (GH-137862)
...
Fixed several cases where __init__, __new__ or metaclass` __call__ is a descriptor
that returns a wrapped function.
2025-08-28 17:57:53 +03:00
Semyon Moroz
f914e0ab09
gh-136438: Make sure test_compile pass with all optimization levels (GH-136478)
2025-08-28 11:30:15 +02:00
Pablo Galindo Salgado
56eb6b64a0
gh-138122: Implement PEP 799 ( #138142 )
2025-08-27 17:52:50 +01:00
Serhiy Storchaka
0dbbf61cc2
gh-71679: Improve tests for repr() of bytes and bytearray (GH-138180)
...
* Merge existing tests test_repr_str and test_to_str.
* Add more tests for non-printable and non-ASCII bytes.
* Add tests for special escape sequences ('\t\n\r').
* Add tests for slashes.
* Add more tests for quotes.
* Add tests for subclasses.
* Add test for non-ASCII class name.
* Only apply @check_bytes_warnings for str() tests.
2025-08-27 13:24:28 +03:00
Rani Pinchuk
fd8f42d3d1
gh-135427: Fix DeprecationWarning for os.fork when run in threads with -Werror (GH-136796)
...
Don't ignore errors raised by `PyErr_WarnFormat` in `warn_about_fork_with_threads`
Instead, ignore the warnings in all test code that forks. (That's a lot of functions.)
In `test_support`, make `ignore_warnings` a context manager (as well as decorator),
and add a `message` argument to it.
Also add a `ignore_fork_in_thread_deprecation_warnings` helper for the deadlock-in-fork
warning.
2025-08-26 15:33:21 +02:00
Jakub KulÃk
f60f8225ed
gh-137481: Fix test_calendar on Solaris and OpenIndiana (GH-138156)
...
In some locales (e.g. pt_PT.UTF-8), the abbreviated weekday names
are longer than three character.
2025-08-26 14:21:09 +03:00
Wulian233
81268a3e2a
gh-136507: Fix mimetypes CLI to handle multiple file parameters (GH-136508)
...
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-08-25 16:38:43 +02:00
Stan Ulbrych
a5530656c1
gh-133390: Extend completion for .commands in sqlite3 (GH-135432)
2025-08-25 14:58:00 +02:00
Serhiy Storchaka
6620ef0ff6
gh-137754: Fix import of zoneinfo if _datetime is not available (GH-137845)
...
Both modules should use the Python implementation in that case.
2025-08-23 12:12:13 +03:00
Kumar Aditya
b9bcd02e9f
gh-137384: fix crash when accessing warnings state late in runtime shutdown ( #138027 )
2025-08-22 19:10:43 +05:30
Serhiy Storchaka
5b0f00e616
gh-135386: Skip readonly tests for the root user (GH-138058)
2025-08-22 16:22:14 +03:00
Bénédikt Tran
766614f88a
gh-136134: smtplib: fix CRAM-MD5 on FIPS-only environments ( #136623 )
2025-08-22 11:45:01 +00:00
General_K1ng
c0ae92b7c0
gh-135386: Fix "unable to open database file" errors on readonly DB (GH-135566)
...
Add immutable=1 flag for read-only SQLite access to avoid WAL/SHM errors on readonly DB.
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-08-22 14:11:59 +03:00
Pranjal Prajapati
f27af8ba8e
gh-130425: Add "Did you mean [...]" suggestions for del obj.attr (GH-136588)
...
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-08-22 12:21:16 +02:00
Bénédikt Tran
4519b8acb5
gh-136134: imaplib: fix CRAM-MD5 on FIPS-only environments ( #136615 )
2025-08-22 12:08:55 +02:00
Pablo Galindo Salgado
539a4ca1b9
gh-137967: Restore suggestions on nested attribute access ( #137968 )
2025-08-21 16:56:57 +01:00
Scott Noyes
3143ceeb1d
gh-137481: Fix abbreviation of day names in TextCalendar (GH-137482)
...
Use the length of the longest day name in the current locale, rather
than a constant 9, to decide if the names should be abbreviated.
2025-08-20 19:55:50 +03:00
Serhiy Storchaka
eae9d7de1c
gh-137477: Fix inspect.getblock() for generator expressions (GH-137488)
...
This fixes also inspect.getsourcelines() and inspect.getsource().
2025-08-20 16:18:08 +03:00
Steve Dower
7d06a0af17
gh-120037: Disable user site packages when a ._pth file is used (GH-137428)
2025-08-19 21:28:28 +01:00
Serhiy Storchaka
ac37b77441
gh-137044: Fix test_resource on 32-bit Linux (GH-137941)
2025-08-19 15:22:30 +03:00
Petr Viktorin
719e5c3f71
gh-123681: Check NORMALIZE_CENTURY behavior at runtime; require C99 (GH-136022)
...
A runtime check is needed to support cross-compiling.
Remove the _Py_NORMALIZE_CENTURY macro.
Remove _pydatetime.py's _can_support_c99.
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-08-19 12:59:03 +02:00
Peter Bierma
b07a267953
gh-137883: Check the recursion limit for specialized keyword argument calls (GH-137887)
2025-08-19 09:53:38 +01:00
Mikhail Efimov
06dd63501a
gh-136438: Make sure test_dis pass with all optimization levels (GH-136593)
...
Now tests pass with all combinations of -OO and --without-doc-strings.
2025-08-19 10:48:35 +02:00
Serhiy Storchaka
6e2b9a2130
gh-137512: Add new constants in the resource module (GH-137513)
...
* RLIMIT_NTHR
* RLIMIT_THREADS
* RLIMIT_UMTXP
* RLIM_SAVED_CUR
* RLIM_SAVED_MAX
* Document RLIMIT_PIPEBUF. Other doc fixes.
2025-08-19 08:52:45 +02:00
Jason R. Coombs
3706ef66ef
Revert "gh-132947: Apply changes from importlib_metadata 8.7 ( #137885 )" ( #137924 )
...
This reverts commit 5292fc00f2 .
2025-08-18 20:57:36 +00:00
Jason R. Coombs
5292fc00f2
gh-132947: Apply changes from importlib_metadata 8.7 ( #137885 )
...
* Copied files from python/importlib_metadata@b67ac80c49 .
2025-08-18 10:54:10 -07:00
Adam Turner
918e3ba6c0
GH-137623: Use an AC decorator for docstring line length enforcement ( #137690 )
2025-08-18 18:29:00 +01:00