summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* bpo-32270: Don't close stdin/out/err in pass_fds (GH-6242)Gregory P. Smith2018-09-111-0/+30
| | | | | | | | | | | | | | 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-8110: Refactor platform detection in subprocess (GH-9053)Zachary Ware2018-09-101-55/+56
| | | | Check for functionality via imports rather than checking sys.platform specifically for Windows
* bpo-33217: Raise TypeError for non-Enum lookups in Enums (GH-6651)Rahul Jha2018-09-102-4/+59
| | | * bpo-33217: Raise TypeError for non-Enum lookups in Enums
* bpo-33604: Remove deprecated HMAC default value marked for removal in 3.8 ↵Matthias Bussonnier2018-09-102-31/+10
| | | | | (GH-7063) HMAC's digestmod was deprecated marked for removal, this removes it as planned.
* closes bpo-34525: Fix smtplib's authobject() documentation (GH-8965)Sebastian Rittau2018-09-101-1/+1
|
* bpo-26502: Implement FrameSummary.__len__() (GH-8632)Berker Peksag2018-09-102-0/+8
|
* bpo-34588: Fix an off-by-one error in traceback formatting. (GH-9077)Benjamin Peterson2018-09-102-12/+78
| | | | | | | | The recursive frame pruning code always undercounted the number of elided frames by one. That is, in the "[Previous line repeated N more times]" message, N would always be one too few. Near the recursive pruning cutoff, one frame could be silently dropped. That situation is demonstrated in the OP of the bug report. The fix is to start the identical frame counter at 1.
* bpo-30977: rework code changes according to post-merge code review (GH-9106)Tal Einat2018-09-102-68/+139
| | | | also mention the change and its consequences in What's New
* Test dict values iterator pickling with pickle.HIGHEST_PROTOCOL. (GH-9052)Sergey Fedoseev2018-09-101-1/+1
|
* bpo-34421 avoid unicode error in distutils logging (GH-8799)Julien Malard2018-09-081-1/+4
| | | | This caused installation errors in some cases on Windows. Patch by Julien Malard.
* bpo-20104: Change the file_actions parameter of os.posix_spawn(). (GH-6725)Serhiy Storchaka2018-09-081-29/+28
| | | | | * Make its default value an empty tuple instead of None. * Make it a keyword-only parameter.
* bpo-34246: Make sure test_smtplib always cleans resources when finished ↵Pablo Galindo2018-09-071-7/+47
| | | | | | | | (GH-9108) * Make sure that when some of the tests in test_smtplib fail, the allocated threads and sockets are not leaked. * Use support.join_thread() instead of thread.join() to avoid infinite blocks.
* bpo-34246: Use no mutable default args in smtplib (GH-8554)Pablo Aguiar2018-09-072-6/+34
| | | | | Some methods of the SMTP class use mutable default arguments. Specially `send_message` is affected as it mutates one of the args by appending items to it, which has side effects on further calls.
* bpo-34605: childs => children (GH-9102)Victor Stinner2018-09-071-1/+1
|
* bpo-34595: Add %T format to PyUnicode_FromFormatV() (GH-9080)Victor Stinner2018-09-071-0/+4
| | | | | | | | | * Add %T format to PyUnicode_FromFormatV(), and so to PyUnicode_FromFormat() and PyErr_Format(), to format an object type name: equivalent to "%s" with Py_TYPE(obj)->tp_name. * Replace Py_TYPE(obj)->tp_name with %T format in unicodeobject.c. * Add unit test on %T format. * Rename unicode_fromformat_write_cstr() to unicode_fromformat_write_utf8(), to make the intent more explicit.
* bpo-20104: Add flag capabilities to posix_spawn (GH-6693)Pablo Galindo2018-09-071-0/+143
| | | Implement the "attributes objects" parameter of `os.posix_spawn` to complete the implementation and fully cover the underlying API.
* bpo-34605: Avoid master/slave terms (GH-9101)Victor Stinner2018-09-074-4/+4
| | | | | | | * Replace "master process" with "parent process" * Replace "master option mappings" with "main option mappings" * Replace "master pattern object" with "main pattern object" * ssl: replace "master" with "server" * And some other similar changes
* bpo-34605, libregrtest: Rename --slaveargs to --worker-args (GH-9099)Victor Stinner2018-09-074-15/+15
| | | Rename also run_tests_slave() to run_tests_worker().
* closes bpo-34594: Don't hardcode errno values in the tests. (GH-9076)Zackery Spytz2018-09-062-3/+3
|
* bpo-30977: make uuid.UUID use __slots__ (GH-9078)Tal Einat2018-09-062-2/+86
| | | Co-Authored-By: Wouter Bolsterlee.
* bpo-26544: Add test for platform._comparable_version(). (GH-8973)Serhiy Storchaka2018-09-041-0/+36
|
* bpo-34530: Fix distutils find_executable() (GH-9049)Victor Stinner2018-09-042-3/+48
| | | | distutils.spawn.find_executable() now falls back on os.defpath if the PATH environment variable is not set.
* bpo-33613, test_semaphore_tracker_sigint: fix race condition (#7850)Pablo Galindo2018-09-042-12/+49
| | | | | | | | | | | | Fail `test_semaphore_tracker_sigint` if no warnings are expected and one is received. Fix race condition when the child receives SIGINT before it can register signal handlers for it. The race condition occurs when the parent calls `_semaphore_tracker.ensure_running()` (which in turn spawns the semaphore_tracker using `_posixsubprocess.fork_exec`), the child registers the signal handlers and the parent tries to kill the child. What seem to happen is that in some slow systems, the parent sends the signal to kill the child before the child protects against the signal.
* bpo-33083 - Make math.factorial reject arguments that are not int-like (GH-6149)Pablo Galindo2018-09-031-0/+5
| | | math.factorial() was accepting non-integral Decimal instances. This is inconsistent with the actual behaviour for floats, which are not accepted.
* bpo-26901: Fix the Argument Clinic test suite (GH-8879)Victor Stinner2018-09-031-0/+802
| | | | | | | | | | * Fix Tools/clinic/clinic_test.py: add missing FakeClinic.destination_buffers attribute and pass a file argument to Clinic(). * Rename Tools/clinic/clinic_test.py to Lib/test/test_clinic.py: add temporary Tools/clinic/ to sys.path to import the clinic module. Co-Authored-By: Pablo Galindo <pablogsal@gmail.com>
* bpo-34567: pythoninfo gets coreconfig (GH-9043)Victor Stinner2018-09-031-0/+12
| | | | | | * Add _testcapi.get_coreconfig() to get the _PyCoreConfig of the interpreter * test.pythoninfo now gets the core configuration using _testcapi.get_coreconfig()
* Fix typo in typing.py module docstring (#9014)Tim McNamara2018-09-011-1/+1
| | | "explicitelly" → "explicitly"
* bpo-34558: Add missing parentheses in _aix.py (GH-9017)Michael Felt2018-09-011-1/+1
| | | p.wait()
* bpo-34007: Skip traceback tests if the Program Counter is not available. ↵Pablo Galindo2018-08-311-0/+9
| | | | | | | | | (GH-9018) Sometimes some versions of the shared libraries that are part of the traceback are compiled in optimised mode and the Program Counter (PC) is not present, not allowing gdb to walk the frames back. When this happens, the Python bindings of gdb raise an exception, making the test impossible to succeed.
* bpo-34097: Polish API design (GH-8725)Marcel Plch2018-08-312-8/+8
| | | Move strict_timestamps to constructor.
* bpo-34427: Fix infinite loop when calling MutableSequence.extend() on self ↵Naris R2018-08-302-0/+14
| | | | (GH-8813)
* bpo-34542: Update test certs and keys (GH-8997)Christian Heimes2018-08-3019-726/+980
| | | | | | | | Update all test certs and keys to use future proof crypto settings: * 3072 bit RSA keys * SHA-256 signature Signed-off-by: Christian Heimes <christian@python.org>
* Fix TestPosixSpawn.test_close_file() (GH-8992)Victor Stinner2018-08-291-30/+34
| | | | | | | | Modify TestPosixSpawn to run Python using -I and -S options. Disable site module to avoid side effects. For example, on Fedora 28, if the HOME environment variable is not set, site._getuserbase() calls pwd.getpwuid() which opens /var/lib/sss/mc/passwd, but then leaves the file open which makes test_close_file() to fail.
* bpo-34523: Support surrogatepass in locale codecs (GH-8995)Victor Stinner2018-08-291-5/+113
| | | | | | | | | | | | | | | | | | | | 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-20/+19
| | | | | | | 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-292-2/+49
| | | | | | | | | | | | | | | | | | | | | | | _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: Add _PyCoreConfig.stdio_encoding (GH-8881)Victor Stinner2018-08-291-3/+33
| | | | * Add stdio_encoding and stdio_errors fields to _PyCoreConfig. * Add unit tests on stdio_encoding and stdio_errors.
* bpo-34485: stdout uses surrogateescape on POSIX locale (GH-8986)Victor Stinner2018-08-291-9/+15
| | | | | | | Standard streams like sys.stdout now use the "surrogateescape" error handler, instead of "strict", on the POSIX locale (when the C locale is not coerced and the UTF-8 Mode is disabled). Add tests on sys.stdout.errors with LC_ALL=POSIX.
* bpo-34485: Enhance init_sys_streams() (GH-8978)Victor Stinner2018-08-283-17/+17
| | | | | | | | | | | | | | | 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).
* bpo-34527: POSIX locale enables the UTF-8 Mode (GH-8972)Victor Stinner2018-08-281-6/+17
| | | | | | | | | | * The UTF-8 Mode is now also enabled by the "POSIX" locale, not only by the "C" locale. * On FreeBSD, Py_DecodeLocale() and Py_EncodeLocale() now also forces the ASCII encoding if the LC_CTYPE locale is "POSIX", not only if the LC_CTYPE locale is "C". * test_utf8_mode.test_cmd_line() checks also that the command line arguments are decoded from UTF-8 when the the UTF-8 Mode is enabled with POSIX locale or C locale.
* bpo-21145: Add cached_property decorator in functools (#6982)Carl Meyer2018-08-282-0/+221
| | | | | | Robust caching of calculated properties is harder than it looks at first glance, so add a solid, well-tested implementation to the standard library.
* bpo-33635: Handling Bad file descriptor in Path.is_file and related. (GH-8542)Przemysław Spodymek2018-08-272-10/+43
|
* bpo-34347: Fix test_utf8_mode.test_cmd_line for AIX (GH-8923)Michael Felt2018-08-271-0/+2
| | | AIX uses ISO-8859-1 encoding for the C locale.
* bpo-26544: Get rid of dependence from distutils in platform. (GH-8356)Serhiy Storchaka2018-08-271-1/+30
|
* bpo-34171: Fix test_trace. (GH-8940)Serhiy Storchaka2018-08-271-3/+6
| | | | Remove "trace.cover" left from previous test runs before testing that it is no longer created.
* bpo-32968: Make modulo and floor division involving Fraction and float ↵Elias Zamaria2018-08-272-12/+11
| | | | | | | consistent with other operations (#5956) Make mixed-type `%` and `//` operations involving `Fraction` and `float` objects behave like all other mixed-type arithmetic operations: first the `Fraction` object is converted to a `float`, then the `float` operation is performed as normal. This fixes some surprising corner cases, like `Fraction('1/3') % inf` giving a NaN. Thanks Elias Zamaria for the patch.
* Remove AIX workaround test_subprocess (GH-8939)Michael Felt2018-08-261-8/+2
| | | | An old apparent AIX behavior workaround in test_subprocess's test_undecodable_env is no longer needed.
* Fix upsizing of marks stack in pickle module. (GH-8860)Sergey Fedoseev2018-08-251-3/+3
| | | Previously marks stack was upsized even there was space for additional item.
* bpo-34171: Prevent creating Lib/trace.cover when run the trace module. (GH-8841)Serhiy Storchaka2018-08-252-10/+9
|
* bpo-13312: Avoid int underflow in time year. (GH-8912)Gregory P. Smith2018-08-251-6/+5
| | | Avoids an integer underflow in the time module's year handling code.