summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* gh-101408: PyObject_GC_Resize should calculate preheader size. (gh-101741)Dong-hee Na2023-04-231-6/+7
|
* gh-84436: Implement Immortal Objects (gh-19474)Eddie Elizondo2023-04-221-1/+14
| | | | | | | | | This is the implementation of PEP683 Motivation: The PR introduces the ability to immortalize instances in CPython which bypasses reference counting. Tagging objects as immortal allows up to skip certain operations when we know that the object will be around for the entire execution of the runtime. Note that this by itself will bring a performance regression to the runtime due to the extra reference count checks. However, this brings the ability of having truly immutable objects that are useful in other contexts such as immutable data sharing between sub-interpreters.
* gh-83861: Fix datetime.astimezone() method (GH-101545)Alexander Belopolsky2023-04-191-2/+16
|
* gh-103583: Add ref. dependency between multibytecodec modules (#103589)Erlend E. Aasland2023-04-193-14/+58
|
* gh-103583: Always pass multibyte codec structs as const (#103588)Erlend E. Aasland2023-04-192-7/+7
|
* gh-103617: Fix compiler warning in _iomodule.c (#103618)Erlend E. Aasland2023-04-191-2/+3
|
* gh-103583: Add codecs and maps to _codecs_* module state (#103540)Erlend E. Aasland2023-04-178-94/+161
|
* gh-103532: Remove TKINTER_PROTECT_LOADTK code (GH-103535)Christopher Chavez2023-04-143-79/+0
| | | | This was only needed for Tk 8.4.13 and older, but Tkinter already requires at least 8.5.12.
* gh-67230: add quoting rules to csv module (GH-29469)Skip Montanaro2023-04-121-1/+15
| | | | | | Add two quoting styles for csv dialects. They will help to work with certain databases in particular. Automerge-Triggered-By: GH:merwok
* gh-103092: Isolate `_collections` (#103093)Erlend E. Aasland2023-04-122-278/+281
| | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-103092: Isolate `socket` module (#103094)Erlend E. Aasland2023-04-092-161/+234
|
* gh-103242: Migrate SSLContext.set_ecdh_curve not to use deprecated APIs ↵Dong-hee Na2023-04-081-3/+8
| | | | | (#103378) Migrate `SSLContext.set_ecdh_curve()` not to use deprecated OpenSSL APIs.
* gh-83004: Harden _socket init (GH-103261)Erlend E. Aasland2023-04-071-537/+581
| | | Automerge-Triggered-By: GH:erlend-aasland
* gh-103256: Fix hmac algorithm to support fallback implementation (gh-103286)Dong-hee Na2023-04-071-1/+1
| | | Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-101659: Add _Py_AtExit() (gh-103298)Eric Snow2023-04-064-32/+164
| | | | | The function is like Py_AtExit() but for a single interpreter. This is a companion to the atexit module's register() function, taking a C callback instead of a Python one. We also update the _xxinterpchannels module to use _Py_AtExit(), which is the motivating case. (This is inspired by pain points felt while working on gh-101660.)
* gh-101659: Use the Raw Allocator in the _xxinterpchannels Module (gh-103287)Eric Snow2023-04-051-22/+93
| | | Using the raw allocator for any of the global state makes sense, especially as we move to a per-interpreter obmalloc state (gh-101660).
* gh-103167: Fix `-Wstrict-prototypes` warnings by using `(void)` for ↵Nikita Sobolev2023-04-052-3/+3
| | | | functions with no args (GH-103168)
* GH-75586: Make shutil.which() on Windows more consistent with the OS (GH-103179)Charles Machalow2023-04-042-1/+62
|
* Fix a compiler warning in _xxsubinterpretermodule.c (#103245)T. Wouters2023-04-041-1/+1
| | | | | | | Fix a (correct) warning about potential uses of uninitialized memory in _xxsubinterpreter. Unlike newly allocated PyObject structs or global structs, stack-allocated structs are not initialised, and a few places in the code expect the _sharedexception struct data to be either NULL or initialised.
* gh-103092: Isolate `_pickle` module (#102982)Erlend E. Aasland2023-04-042-664/+674
| | | | Co-authored-by: Mohamed Koubaa <koubaa.m@gmail.com> Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-100062: Remove error code tables from _ssl and err_names_to_codes (GH-100063)David Benjamin2023-04-032-15/+0
| | | | | | | | | | Prior to https://github.com/python/cpython/pull/25300, the make_ssl_data.py script used various tables, exposed in _ssl, to update the error list. After that PR, this is no longer used. Moreover, the err_names_to_codes map isn't used at all. Clean those up. This gets them out of the way if, in the future, OpenSSL provides an API to do what the code here is doing directly. (https://github.com/openssl/openssl/issues/19848)
* GH-103182: use vectorcall in `_asyncio` instead of variadic calling APIs ↵Kumar Aditya2023-04-031-22/+17
| | | | (#103175)
* fix typo in _ssl.c (GH-103192)Ikko Eltociear Ashimine2023-04-021-1/+1
| | | | | seperated -> separated Automerge-Triggered-By: GH:AlexWaygood
* Add IPv6 into to the docstring for socket.getsockname (#102961)Brian Haley2023-03-301-1/+2
| | | Signed-off-by: Brian Haley <haleyb.dev@gmail.com>
* Fix typos in faulthandler, testcapi error messages (#103020)Liyang Zhang2023-03-252-3/+3
|
* GH-102833: Mention the key function in the docstrings (GH-103009)Raymond Hettinger2023-03-252-9/+25
|
* gh-100372: Use BIO_eof to detect EOF for SSL_FILETYPE_ASN1 (GH-100373)David Benjamin2023-03-241-4/+6
| | | | | | | In PEM, we need to parse until error and then suppress `PEM_R_NO_START_LINE`, because PEM allows arbitrary leading and trailing data. DER, however, does not. Parsing until error and suppressing `ASN1_R_HEADER_TOO_LONG` doesn't quite work because that error also covers some cases that should be rejected. Instead, check `BIO_eof` early and stop the loop that way. Automerge-Triggered-By: GH:Yhg1s
* GH-100989: remove annotation from docstring (GH-102991)Raymond Hettinger2023-03-241-2/+2
|
* GH-100989: Revert Improve the accuracy of collections.deque docstrings ↵Raymond Hettinger2023-03-241-24/+13
| | | | (GH-102979)
* GH-101291: Rearrange the size bits in PyLongObject (GH-102464)Mark Shannon2023-03-224-47/+24
| | | | | | | | | | * Eliminate all remaining uses of Py_SIZE and Py_SET_SIZE on PyLongObject, adding asserts. * Change layout of size/sign bits in longobject to support future addition of immortal ints and tagged medium ints. * Add functions to hide some internals of long object, and for setting sign and digit count. * Replace uses of IS_MEDIUM_VALUE macro with _PyLong_IsCompact().
* gh-96931: Fix incorrect results in ssl.SSLSocket.shared_ciphers (#96932)Benjamin Fogle2023-03-221-8/+28
|
* gh-102027: Fix macro name (#102124)Max Bachmann2023-03-221-1/+1
| | | | | This fixes the ssse3 / sse2 detection when sse4 is available. Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
* GH-95494: Fix transport EOF handling in OpenSSL 3.0 (GH-95495)David Benjamin2023-03-221-4/+10
| | | | | | | | | | | | | | | | | | | | | GH-25309 enabled SSL_OP_IGNORE_UNEXPECTED_EOF by default, with a comment that it restores OpenSSL 1.1.1 behavior, but this wasn't quite right. That option causes OpenSSL to treat transport EOF as the same as close_notify (i.e. SSL_ERROR_ZERO_RETURN), whereas Python actually has distinct SSLEOFError and SSLZeroReturnError exceptions. (The latter is usually mapped to a zero return from read.) In OpenSSL 1.1.1, the ssl module would raise them for transport EOF and close_notify, respectively. In OpenSSL 3.0, both act like close_notify. Fix this by, instead, just detecting SSL_R_UNEXPECTED_EOF_WHILE_READING and mapping that to the other exception type. There doesn't seem to have been any unit test of this error, so fill in the missing one. This had to be done with the BIO path because it's actually slightly tricky to simulate a transport EOF with Python's fd based APIs. (If you instruct the server to close the socket, it gets confused, probably because the server's SSL object is still referencing the now dead fd?)
* gh-100989: Improve the accuracy of collections.deque docstrings (#100990)Timo Ludwig2023-03-221-13/+24
| | | Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* GH-94808: Cover `PyOS_mystrnicmp` and `PyOS_mystricmp` (gh-102469)Artem Mukhin2023-03-224-1/+65
|
* gh-102839: remove AC for math.log (GH-102863)Sergey B Kirpichev2023-03-212-65/+15
|
* gh-94673: Isolate the _io module to Each Interpreter (gh-102663)Eric Snow2023-03-211-8/+32
| | | | | Aside from sys and builtins, _io is the only core builtin module that hasn't been ported to multi-phase init. We may do so later (e.g. gh-101948), but in the meantime we must at least take care of the module's static types properly. (This came up while working on gh-101660.) https://github.com/python/cpython/issues/94673
* gh-98608: Stop Treating All Errors from _Py_NewInterpreterFromConfig() as ↵Eric Snow2023-03-212-4/+13
| | | | | | | Fatal (gh-102657) Prior to this change, errors in _Py_NewInterpreterFromConfig() were always fatal. Instead, callers should be able to handle such errors and keep going. That's what this change supports. (This was an oversight in the original implementation of _Py_NewInterpreterFromConfig().) Note that the existing [fatal] behavior of the public Py_NewInterpreter() is preserved. https://github.com/python/cpython/issues/98608
* gh-102755: PyErr_DisplayException only in ABI >= 3.12. Tests cover ↵Irit Katriel2023-03-211-3/+13
| | | | PyErr_Display as well (GH-102849)
* gh-102255: Use GetVersionEx instead of GetVersionExW to match argument type ↵Max Bachmann2023-03-201-1/+1
| | | | | | (GH-102583) Since we pass a structure of type `OSVERSIONINFOEX`, we need to call `GetVersionEx` instead of `GetVersionExW`.
* Add more comments to hypot() (GH-102817)Raymond Hettinger2023-03-181-18/+12
|
* Simplify and improve accuracy for subnormals in hypot() (GH-102785)Raymond Hettinger2023-03-171-35/+28
|
* gh-102755: Add PyErr_DisplayException(exc) (#102756)Irit Katriel2023-03-161-10/+3
|
* gh-99726: Improves correctness of stat results for Windows, and uses faster ↵Steve Dower2023-03-161-45/+146
| | | | | API when available (GH-102149) This deprecates `st_ctime` fields on Windows, with the intent to change them to contain the correct value in 3.14. For now, they should keep returning the creation time as they always have.
* gh-102192: remove redundant exception fields from ssl module socket (#102466)Irit Katriel2023-03-162-23/+12
|
* gh-102594: PyErr_SetObject adds note to exception raised on normalization ↵Irit Katriel2023-03-161-0/+21
| | | | error (#102675)
* Simplify and speed-up math.hypot() and math.dist() (GH-102734)Raymond Hettinger2023-03-151-154/+139
|
* gh-102281: Fix potential nullptr dereference + use of uninitialized memory ↵Max Bachmann2023-03-151-1/+4
| | | | (gh-102282)
* gh-102013: Add PyUnstable_GC_VisitObjects (#102014)Jacob Bower2023-03-142-0/+93
|
* gh-101659: Avoid Allocation for Shared Exceptions in the _xxsubinterpreters ↵Eric Snow2023-03-131-74/+49
| | | | | Module (gh-102659) https://github.com/python/cpython/issues/101659