summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* gh-111495: Add tests for `PyCodec_*` C API (#123343)Bénédikt Tran2024-09-296-3/+250
|
* gh-123961: Add a global state to _curses (#124729)Bénédikt Tran2024-09-291-175/+271
|
* gh-123290: Fix decref in _curses update_lines_cols() (#124767)Bénédikt Tran2024-09-291-1/+1
|
* gh-123497: New limit for Python integers on 64-bit platforms (GH-123724)Serhiy Storchaka2024-09-293-19/+18
| | | | | | | | | | | Instead of be limited just by the size of addressable memory (2**63 bytes), Python integers are now also limited by the number of bits, so the number of bit now always fit in a 64-bit integer. Both limits are much larger than what might be available in practice, so it doesn't affect users. _PyLong_NumBits() and _PyLong_Frexp() are now always successful.
* gh-124665: Add `_PyCodec_UnregisterError` and `_codecs._unregister_error` ↵Bénédikt Tran2024-09-292-1/+76
| | | | (#124677)
* gh-124688: _decimal: Get module state from ctx for performance (#124691)neonene2024-09-281-48/+73
| | | Get a module state from ctx objects for performance.
* gh-123017: Add Android to the list of platforms where `strftime` doesn't ↵Malcolm Smith2024-09-271-1/+6
| | | | | support negative years (#124467) Add Android to the list of platforms where `strftime` doesn't support negative years
* gh-124153: Remove `_PyType_GetModuleByDef2` private function (GH-124261)neonene2024-09-262-17/+21
| | | Thank you!
* gh-124606: Fix reference leak in error path in `datetime_fromisoformat` in ↵Kirill Podoprigora2024-09-261-0/+2
| | | | | `_datetimemodule.c` (#124607) Previously `tzdata` and `dtstr_clean` were not decrefed in the `invalid_iso_midnight` error path of the `datetime_isoformat` function.
* gh-119127: Fix _functools.Placeholder singleton (#124601)Victor Stinner2024-09-261-13/+35
| | | | | | | * The module state now stores a strong reference to the Placeholder singleton. * Use a regular dealloc function. * Add Py_TPFLAGS_HAVE_GC flag and a traverse function to help the GC to collect the type when a _functools extension is unloaded.
* gh-119127: functools.partial placeholders (gh-119827)dgpb2024-09-261-53/+281
|
* gh-41431: Add `datetime.time.strptime()` and `datetime.date.strptime()` ↵Nice Zombies2024-09-251-2/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#120752) * Python implementation * C implementation * Test `date.strptime` * Test `time.strptime` * 📜🤖 Added by blurb_it. * Update whatsnew * Update documentation * Add leap year note * Update 2024-06-19-19-53-42.gh-issue-41431.gnkUc5.rst * Apply suggestions from code review Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> * Remove parentheses * Use helper function * Remove bad return * Link to github issue * Fix directive * Apply suggestions from code review Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com> * Fix test cases --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
* gh-102450: Add ISO-8601 alternative for midnight to `fromisoformat()` calls. ↵TizzySaurus2024-09-251-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#105856) * Add NEWS.d entry * Allow ISO-8601 24:00 alternative to midnight on datetime.time.fromisoformat() * Allow ISO-8601 24:00 alternative to midnight on datetime.datetime.fromisoformat() * Add NEWS.d entry * Improve error message when hour is 24 and minute/second/microsecond is not 0 * Add tests for 24:00 fromisoformat * Remove duplicate call to days_in_month() by storing in variable * Add Python implementation * Fix Lint * Fix differing error msg in datetime.fromisoformat implementations when 24hrs has non-zero time component(s) * Fix using time components inside tzinfo in Python implementation * Don't parse tzinfo in C implementation when invalid iso midnight * Remove duplicated variable in datetime test assertion line * Add self to acknowledgements * Remove duplicate NEWS entry * Linting * Add missing test case for when wrapping the year makes it invalid (too large)
* gh-123884 Tee of tee was not producing n independent iterators (gh-124490)Raymond Hettinger2024-09-251-27/+9
|
* gh-123014: Disable pidfd API on older Android versions (#124458)Malcolm Smith2024-09-254-8/+13
|
* gh-123923: Defer refcounting for `f_funcobj` in `_PyInterpreterFrame` (#124026)Sam Gross2024-09-241-3/+3
| | | | | | Use a `_PyStackRef` and defer the reference to `f_funcobj` when possible. This avoids some reference count contention in the common case of executing the same code object from multiple threads concurrently in the free-threaded build.
* gh-123978: Remove broken time.thread_time() on NetBSD (GH-124116)Serhiy Storchaka2024-09-241-3/+15
|
* gh-119333: Add C api to have contextvar enter/exit callbacks (#119335)Jason Fried2024-09-241-0/+152
| | | Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-100980: ctypes: Test, document, and fix finalizing _fields_ (GH-124292)Petr Viktorin2024-09-241-16/+15
| | | | | | | | - If setting `_fields_` fails, e.g. with AttributeError, don't set the attribute in `__dict__` - Document the “finalization” behaviour - Beef up tests: add `getattr`, test Union as well as Structure - Put common functionality in a common function Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* gh-124248: Fix crash in struct when processing 0p fields (#124251)Brian Schubert2024-09-201-4/+15
|
* gh-123880: Allow recursive import of single-phase-init modules (GH-123950)Petr Viktorin2024-09-201-2/+61
| | | | Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Co-authored-by: Brett Cannon <brett@python.org>
* gh-123797: Check for runtime availability of `ptsname_r` on macos (#123806)sobolevn2024-09-201-10/+36
|
* gh-120754: Fix memory leak in FileIO.__init__() (#124225)Victor Stinner2024-09-181-0/+1
| | | | | Free 'self->stat_atopen' before assigning it, since io.FileIO.__init__() can be called multiple times manually (especially by test_io).
* gh-120754: Refactor I/O modules to stash whole stat result rather than ↵Cody Maloney2024-09-181-26/+57
| | | | | | | | | | | | individual members (#123412) Multiple places in the I/O stack optimize common cases by using the information from stat. Currently individual members are extracted from the stat and stored into the fileio struct. Refactor the code to store the whole stat struct instead. Parallels the changes to _io. The `stat` Python object doesn't allow changing members, so rather than modifying estimated_size, just clear the value.
* gh-102511: Change the `os.path.splitroot` param name from `path` back to `p` ↵sobolevn2024-09-182-6/+6
| | | | (GH-124097)
* gh-124153: Implement `PyType_GetBaseByToken()` and `Py_tp_token` slot ↵neonene2024-09-183-8/+134
| | | | (GH-124163)
* Revert "gh-123974: Fix time.get_clock_info() on NetBSD (#123975)" (GH-124115)Serhiy Storchaka2024-09-181-5/+1
| | | This reverts commit b1d6f8a2ee04215c64aa8752cc515b7e98a08d28.
* gh-123836: workaround fmod(x, y) bug on Windows (#124171)Sergey B Kirpichev2024-09-171-0/+9
| | | | | | | | | | | | | | | | | | Buildbot failure on Windows 10 with MSC v.1916 64 bit (AMD64): FAIL: testFmod (test.test_math.MathTests.testFmod) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_math.py", line 605, in testFmod self.ftest('fmod(-10, 1)', math.fmod(-10, 1), -0.0) ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_math.py", line 258, in ftest self.fail("{}: {}".format(name, failure)) ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: fmod(-10, 1): expected -0.0, got 0.0 (zero has wrong sign) Here Windows loose sign of the result; if y is nonzero, the result should have the same sign as x. This amends commit 28aea5d07d.
* gh-110190: Fix ctypes structs with array on SPARC (GH-118233)Jakub Kulík2024-09-171-1/+1
|
* gh-121023: Improve `_xxtestfuzz/README.rst` (#121024)sobolevn2024-09-161-3/+5
| | | Co-authored-by: Illia Volochii <illia.volochii@gmail.com>
* gh-97588: remove unused functions in _ctypes/cfield.c (GH-124010)Irit Katriel2024-09-161-36/+0
|
* gh-123748: Add conditional compilation rules for HACL SIMD256 and SIMD128 on ↵Russell Keith-Magee2024-09-163-0/+39
| | | | | | macOS (#123989) Add conditional compilation rules to allow HACL SIMD256 and SIMD128 to be ignored on the ARM64 pass of universal2 macOS builds.
* gh-123974: Fix time.get_clock_info() on NetBSD (#123975)Furkan Onder2024-09-131-1/+5
| | | Fix OSError for thread_time clock on NetBSD by setting default resolution.
* gh-100554: Add ``Py_tp_vectorcall`` slot to set ↵Wenzel Jakob2024-09-131-0/+86
| | | | ``PyTypeObject.tp_vectorcall`` using the ``PyType_FromSpec`` function family. (#123332)
* closes gh-124016: update Unicode to 16.0.0 (#124017)Benjamin Peterson2024-09-132-18313/+19896
|
* gh-123961: Add `curses` prefix to global variables in `_cursesmodule.c` ↵Bénédikt Tran2024-09-131-14/+14
| | | | | (#124047) Use the `const char*` type instead of a `const *` for the encoding name.
* gh-124044: protect macros expansions in `_cursesmodules.c` using `do { ... } ↵Bénédikt Tran2024-09-131-19/+28
| | | | while (0)` (#124045)
* gh-123961: Remove global variable `ModDict` in `_cursesmodule.c` (#123962)Bénédikt Tran2024-09-131-35/+44
|
* gh-123923: Defer refcounting for `f_executable` in `_PyInterpreterFrame` ↵Sam Gross2024-09-121-3/+4
| | | | | | | | (#123924) Use a `_PyStackRef` and defer the reference to `f_executable` when possible. This avoids some reference count contention in the common case of executing the same code object from multiple threads concurrently in the free-threaded build.
* gh-123290: fix reference leaks in the error-branches of `_cursesmodule.c` ↵Bénédikt Tran2024-09-111-147/+211
| | | | (#123953)
* gh-122213: Add notes for pickle serialization errors (GH-122214)Serhiy Storchaka2024-09-091-35/+110
| | | | This allows to identify the source of the error.
* gh-84808: socket.connect_ex: Handle negative errno (GH-122304)Jérôme Duval2024-09-091-2/+17
| | | | | POSIX allows errno to be negative. Even though all currently supported platforms have non-negative errno, relying on a quirk like that would make Python less portable.
* Fix typos (#123775)algonell2024-09-091-2/+2
|
* gh-122311: Improve and unify pickle errors (GH-122771)Serhiy Storchaka2024-09-091-74/+90
| | | | | | | | | | | | | * Raise PicklingError instead of UnicodeEncodeError, ValueError and AttributeError in both implementations. * Chain the original exception to the pickle-specific one as __context__. * Include the error message of ImportError and some AttributeError in the PicklingError error message. * Unify error messages between Python and C implementations. * Refer to documented __reduce__ and __newobj__ callables instead of internal methods (e.g. save_reduce()) or pickle opcodes (e.g. NEWOBJ). * Include more details in error messages (what expected, what got). * Avoid including a potentially long repr of an arbitrary object in error messages.
* chore: decimal module macro cleanup (#123791)Bénédikt Tran2024-09-091-78/+79
| | | | | | | | | | | | | * protect macros expansion via `do { ... } while (0)` constructions in `_decimal.c` * Use public macro `Py_UNUSED` This replaces the usages of the `UNUSED` macro which was not consistent with the `Py_UNUSED` macro itself. In addition, this amends the parameter names so that they match their semantic meanings. * Remove redundant `PyCFunction` casts
* gh-123843: Remove broken links to the Zope DateTimeWiki (#123846)Adam Turner2024-09-091-4/+2
| | | Co-authored-by: Conrad Bhuiyan-Volkoff <hi@cbv.im>
* gh-123657: Fix crash and refleak in `decimal.getcontext()` (GH-123703)neonene2024-09-061-10/+16
|
* gh-123718: Fix implicit declaration of 'explicit_memset' for NetBSD 10.0 ↵Furkan Onder2024-09-061-1/+1
| | | | | (#123719) Fix implicit declaration of 'explicit_memset' for NetBSD 10.0 in Lib_Memzero0.c.
* gh-123476: Add support for TCP_QUICKACK socket setting to Windows (#123478)nkinnan2024-09-052-0/+25
| | | | | Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Steve Dower <steve.dower@microsoft.com>
* gh-123465: Allow Py_RELATIVE_OFFSET for __*offset__ members (GH-123474)Petr Viktorin2024-09-053-10/+229
|