summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* Simplified implementation of _sre.ascii_iscased(). (GH-9097)Sergey Fedoseev2018-09-121-6/+1
|
* closes bpo-25041: Document AF_PACKET socket address format. (GH-4092)Cheryl Sabella2018-09-121-3/+3
|
* Delete old expat comment. (GH-9197)Benjamin Peterson2018-09-121-8/+0
|
* closes bpo-31903: Release the GIL when calling into SystemConfiguration ↵Max Bélanger2018-09-111-0/+6
| | | | (GH-4178)
* bpo-34636: Use fast path for more chars in SRE category macros. (GH-9170)Sergey Fedoseev2018-09-111-3/+3
| | | | | | | When handling \s, \d, or \w (and their inverse) escapes in bytes regexes this a small but measurable performance improvement. <!-- issue-number: [bpo-34636](https://www.bugs.python.org/issue34636) --> https://bugs.python.org/issue34636 <!-- /issue-number -->
* bpo-20180: convert most of itertoolsmodule.c to use Argument Clinic (GH-9164)Tal Einat2018-09-112-219/+694
|
* closes bpo-31608: Fix a crash in methods of a subclass of _collections.deque ↵Oren Milman2018-09-111-4/+13
| | | | with a bad __new__(). (GH-3788)
* bpo-29386: Pass -1 to epoll_wait() when timeout is < -1 (GH-9040)Berker Peksag2018-09-111-8/+15
| | | | | | | Although the kernel accepts any negative value for timeout, the documented value to block indefinitely is -1. This commit also makes the code similar to select.poll.poll().
* bpo-34622: Extract asyncio exceptions into a separate module (GH-9141)Andrew Svetlov2018-09-111-0/+2
|
* closes bpo-29832: Remove "getsockaddrarg" from error messages. (GH-3163)Oren Milman2018-09-111-60/+119
|
* bpo-34625: Update vendorized expat version to 2.2.6. (GH-9150)Benjamin Peterson2018-09-114-27/+69
|
* bpo-32270: Don't close stdin/out/err in pass_fds (GH-6242)Gregory P. Smith2018-09-111-10/+14
| | | | | | | | | | | | | | When subprocess.Popen() stdin= stdout= or stderr= handles are specified and appear in pass_fds=, don't close the original fds after dup'ing them. This implementation and unittest primarily came from @izbyshev (see the PR) See also https://github.com/izbyshev/cpython/commit/b89b52f28490b69142d5c061604b3a3989cec66c This also removes the old manual p2cread, c2pwrite, and errwrite closing logic as inheritable flags and _close_open_fds takes care of that properly today without special treatment. This code is within child_exec() where it is the only thread so there is no race condition between the dup and _Py_set_inheritable_async_safe call.
* bpo-20180: itertools.groupby Argument Clinic conversion (GH-4170)Tal Einat2018-09-102-23/+105
|
* Fix misleading mentions of tp_size in comments (GH-9093)Peter Eisentraut2018-09-1013-18/+18
| | | | Many type object initializations labeled a field "tp_size" in the comment, but the name of that field is tp_basicsize.
* bpo-20104: Change the file_actions parameter of os.posix_spawn(). (GH-6725)Serhiy Storchaka2018-09-082-9/+10
| | | | | * Make its default value an empty tuple instead of None. * Make it a keyword-only parameter.
* bpo-34604: Fix possible mojibake in pwd.getpwnam() and grp.getgrnam() (GH-9098)William Grzybowski2018-09-073-17/+17
| | | | Pass the user/group name as Unicode to the formatting function, instead of always decoding a bytes string from UTF-8.
* bpo-20104: Add flag capabilities to posix_spawn (GH-6693)Pablo Galindo2018-09-072-13/+166
| | | Implement the "attributes objects" parameter of `os.posix_spawn` to complete the implementation and fully cover the underlying API.
* bpo-33625: Release GIL for grp.getgr{nam,gid} and pwd.getpw{nam,uid} (GH-7081)William Grzybowski2018-09-072-12/+195
| | | | | | Release GIL on grp.getgrnam(), grp.getgrgid(), pwd.getpwnam() and pwd.getpwuid() if reentrant variants of these functions are available. Patch by William Grzybowski.
* _sre.c: Removed unused SRE_IS_ALNUM macro (GH-9090)Sergey Fedoseev2018-09-071-2/+0
|
* closes bpo-34581 : Conditionalize use of __pragma in Modules/socketmodule.c. ↵Erik Janssens2018-09-051-2/+5
| | | | | | (GH-9067)
* bpo-34563: Fix for invalid assert on big output of multiprocessing.Process ↵Alexander Buchkovsky2018-09-042-9/+9
| | | | | | (GH-9027) Fix for invalid assert on big output of multiprocessing.Process.
* bpo-33083 - Make math.factorial reject arguments that are not int-like (GH-6149)Pablo Galindo2018-09-031-3/+9
| | | math.factorial() was accepting non-integral Decimal instances. This is inconsistent with the actual behaviour for floats, which are not accepted.
* bpo-34544: pymain_read_conf() don't change LC_ALL (GH-9045)Victor Stinner2018-09-031-15/+3
| | | | bpo-34485, bpo-34544: Again, pymain_read_conf() leaves LC_ALL locale unchanged: only modify LC_CTYPE.
* bpo-34567: pythoninfo gets coreconfig (GH-9043)Victor Stinner2018-09-032-3/+158
| | | | | | * Add _testcapi.get_coreconfig() to get the _PyCoreConfig of the interpreter * test.pythoninfo now gets the core configuration using _testcapi.get_coreconfig()
* bpo-34544: Fix setlocale() in pymain_read_conf() (GH-9041)Victor Stinner2018-09-031-2/+13
| | | | | | | | bpo-34485, bpo-34544: On some FreeBSD, nl_langinfo(CODESET) fails if LC_ALL or LC_CTYPE is set to an invalid locale name. Replace _Py_SetLocaleFromEnv(LC_CTYPE) with _Py_SetLocaleFromEnv(LC_ALL) to initialize properly locales. Partially revert commit 177d921c8c03d30daa32994362023f777624b10d.
* Minor improvement to code clarity (GH-9036)Raymond Hettinger2018-09-021-1/+1
| | | Make it clear that the n==0 case is included. Otherwise, you have to know that max==0.0 whenever n==0.
* closes bpo-34555: Fix incorrectly nested test for HAVE_LINUX_VM_SOCKETS_H ↵Thomas Herzog2018-09-011-24/+25
| | | | (GH-9016)
* Simplify vector_norm() by eliminating special cases in the main loop (GH-9006)Raymond Hettinger2018-08-311-22/+18
| | | The *max* value is no longer treated as a special case in the main loop. Besides making the main loop simpler and branchless, this also lets us relax the input restriction of *vec* to contain only non-negative values.
* bpo-34523: Use _PyCoreConfig instead of globals (GH-9005)Victor Stinner2018-08-291-9/+9
| | | | | Use the core configuration of the interpreter, rather than using global configuration variables. For example, replace Py_QuietFlag with core_config->quiet.
* bpo-34523: Support surrogatepass in locale codecs (GH-8995)Victor Stinner2018-08-291-0/+94
| | | | | | | | | | | | | | | | | | | | Add support for the "surrogatepass" error handler in PyUnicode_DecodeFSDefault() and PyUnicode_EncodeFSDefault() for the UTF-8 encoding. Changes: * _Py_DecodeUTF8Ex() and _Py_EncodeUTF8Ex() now support the surrogatepass error handler (_Py_ERROR_SURROGATEPASS). * _Py_DecodeLocaleEx() and _Py_EncodeLocaleEx() now use the _Py_error_handler enum instead of "int surrogateescape" to pass the error handler. These functions now return -3 if the error handler is unknown. * Add unit tests on _Py_DecodeLocaleEx() and _Py_EncodeLocaleEx() in test_codecs. * Rename get_error_handler() to _Py_GetErrorHandler() and expose it as a private function. * _freeze_importlib doesn't need config.filesystem_errors="strict" workaround anymore.
* bpo-34523: Py_DecodeLocale() use UTF-8 on Windows (GH-8998)Victor Stinner2018-08-291-2/+11
| | | | | | | Py_DecodeLocale() and Py_EncodeLocale() now use the UTF-8 encoding on Windows if Py_LegacyWindowsFSEncodingFlag is zero. pymain_read_conf() now sets Py_LegacyWindowsFSEncodingFlag in its loop, but restore its value at exit.
* bpo-34523: Add _PyCoreConfig.filesystem_encoding (GH-8963)Victor Stinner2018-08-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | _PyCoreConfig_Read() is now responsible to choose the filesystem encoding and error handler. Using Py_Main(), the encoding is now chosen even before calling Py_Initialize(). _PyCoreConfig.filesystem_encoding is now the reference, instead of Py_FileSystemDefaultEncoding, for the Python filesystem encoding. Changes: * Add filesystem_encoding and filesystem_errors to _PyCoreConfig * _PyCoreConfig_Read() now reads the locale encoding for the file system encoding. * PyUnicode_EncodeFSDefault() and PyUnicode_DecodeFSDefaultAndSize() now use the interpreter configuration rather than Py_FileSystemDefaultEncoding and Py_FileSystemDefaultEncodeErrors global configuration variables. * Add _Py_SetFileSystemEncoding() and _Py_ClearFileSystemEncoding() private functions to only modify Py_FileSystemDefaultEncoding and Py_FileSystemDefaultEncodeErrors in coreconfig.c. * _Py_CoerceLegacyLocale() now takes an int rather than _PyCoreConfig for the warning.
* bpo-34485, Windows: LC_CTYPE set to user preference (GH-8988)Victor Stinner2018-08-291-15/+4
| | | | | | | | | | | | | | On Windows, the LC_CTYPE is now set to the user preferred locale at startup: _Py_SetLocaleFromEnv(LC_CTYPE) is now called during the Python initialization. Previously, the LC_CTYPE locale was "C" at startup, but changed when calling setlocale(LC_CTYPE, "") or setlocale(LC_ALL, ""). pymain_read_conf() now also calls _Py_SetLocaleFromEnv(LC_CTYPE) to behave as _Py_InitializeCore(). Moreover, it doesn't save/restore the LC_ALL anymore. On Windows, standard streams like sys.stdout now always use surrogateescape error handler by default (ignore the locale).
* Improve commutativity of math.hypot() and math.dist() (GH-8984)Raymond Hettinger2018-08-291-13/+19
|
* bpo-34485: Add _Py_ClearStandardStreamEncoding() (GH-8982)Victor Stinner2018-08-281-1/+1
| | | | | | | | | | * Move Py_SetStandardStreamEncoding() from pylifecycle.c to coreconfig.c * Add _Py_ClearStandardStreamEncoding() private function. * pymain_free() now calls _Py_ClearStandardStreamEncoding(). * Add assertions add the end of _PyCoreConfig_Read() * _PyCoreConfig_Copy(): rename COPY_STR_ATTR() macro to COPY_WSTR_ATTR(). * Fix get_stdio_errors() indentation.
* bpo-34485: Fix _Py_InitializeCore() for C locale coercion (GH-8979)Victor Stinner2018-08-281-1/+3
| | | | | | | | * _Py_InitializeCore() now sets the LC_CTYPE locale to the user preferred locale before checking if the C locale should be coerced or not in _PyCoreConfig_Read(). * Fix pymain_read_conf(): remember if the C locale has been coerced when the configuration should be read again if the encoding has changed.
* bpo-34485: Enhance init_sys_streams() (GH-8978)Victor Stinner2018-08-281-1/+1
| | | | | | | | | | | | | | | Python now gets the locale encoding with C code to initialize the encoding of standard streams like sys.stdout. Moreover, the encoding is now initialized to the Python codec name to get a normalized encoding name and to ensure that the codec is loaded. The change avoids importing _bootlocale and _locale modules at startup by default. When the PYTHONIOENCODING environment variable only contains an encoding, the error handler is now is now set explicitly to "strict". Rename also get_default_standard_stream_error_handler() to get_stdio_errors(). Reduce the buffer to format the "cpXXX" string (Windows locale encoding).
* Fast path for exact floats in math.hypot() and math.dist() (GH-8949)Raymond Hettinger2018-08-271-9/+21
|
* Remove unneeded PyErr_Clear() in _winapi_SetNamedPipeHandleState_impl() ↵Zackery Spytz2018-08-251-2/+0
| | | | (GH-8281)
* bpo-34395: Don't free allocated memory on realloc fail in load_mark() in ↵Sergey Fedoseev2018-08-251-15/+5
| | | | _pickle.c. (GH-8788)
* Fix upsizing of marks stack in pickle module. (GH-8860)Sergey Fedoseev2018-08-251-1/+1
| | | Previously marks stack was upsized even there was space for additional item.
* bpo-13312: Avoid int underflow in time year. (GH-8912)Gregory P. Smith2018-08-251-0/+6
| | | Avoids an integer underflow in the time module's year handling code.
* closes bpo-34471: _datetime: Add missing NULL check to ↵Alexey Izbyshev2018-08-241-1/+4
| | | | | tzinfo_from_isoformat_results. (GH-8869) Reported by Svace static analyzer.
* bpo-34454: fix .fromisoformat() methods crashing on inputs with surrogate ↵Paul Ganssle2018-08-231-9/+72
| | | | | | | | | | | | | | | | | | | | code points (GH-8862) The current C implementations **crash** if the input includes a surrogate Unicode code point, which is not possible to encode in UTF-8. Important notes: 1. It is possible to pass a non-UTF-8 string as a separator to the `.isoformat()` methods. 2. The pure-Python `datetime.fromisoformat()` implementation accepts strings with a surrogate as the separator. In `datetime.fromisoformat()`, in the special case of non-UTF-8 separators, this implementation will take a performance hit by making a copy of the input string and replacing the separator with 'T'. Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru> Co-authored-by: Paul Ganssle <paul@ganssle.io>
* bpo-34412: Make signal.strsignal() work on HP-UX (GH-8786)Michael Osipov2018-08-231-2/+20
| | | | | | Introduce a configure check for strsignal(3) which defines HAVE_STRSIGNAL for signalmodule.c. Add some common signals on HP-UX. This change applies for Windows and HP-UX.
* bpo-34207: Fix pymain_read_conf() for UTF-8 Mode (GH-8868)Victor Stinner2018-08-231-0/+6
| | | | | bpo-34170, bpo-34207: pymain_read_conf() now sets Py_UTF8Mode to config->utf8_mode. pymain_read_conf() calls indirectly Py_DecodeLocale() and Py_EncodeLocale() which depend on Py_UTF8Mode.
* bpo-34462: Add missing NULL check to _copy_raw_string() (GH-8863)Alexey Izbyshev2018-08-221-1/+1
| | | | Reported by Svace static analyzer.
* bpo-2122: Make mmap.flush() behave same on all platforms (GH-8692)Berker Peksag2018-08-221-4/+7
| | | | | Previously, its behavior was platform-dependent and there was no error checking under Windows.
* bpo-34456: pickle: Add missing NULL check to save_global(). (GH-8851)Alexey Izbyshev2018-08-221-0/+2
| | | Reported by Svace static analyzer.
* bpo-34441: Fix ABC.__subclasscheck__ crash on classes with invalid ↵Alexey Izbyshev2018-08-201-0/+3
| | | | | | __subclasses__ (GH-8835) The missing NULL check was reported by Svace static analyzer.