summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* bpo-30977: make uuid.UUID use __slots__ (GH-9078)Tal Einat2018-09-063-2/+88
| | | Co-Authored-By: Wouter Bolsterlee.
* closes bpo-34581 : Conditionalize use of __pragma in Modules/socketmodule.c. ↵Erik Janssens2018-09-052-2/+6
| | | | | | (GH-9067)
* bpo-34565: Change a PC/launcher.c comment to accurately describe valid major ↵Brendan Gerrity2018-09-041-2/+2
| | | | versions. (GH-9037)
* bpo-34563: Fix for invalid assert on big output of multiprocessing.Process ↵Alexander Buchkovsky2018-09-043-9/+10
| | | | | | (GH-9027) Fix for invalid assert on big output of multiprocessing.Process.
* 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-043-3/+50
| | | | 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-043-12/+52
| | | | | | | | | | | | 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-033-3/+16
| | | 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-8/+19
| | | | | | | | | | * 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-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-034-3/+174
| | | | | | * Add _testcapi.get_coreconfig() to get the _PyCoreConfig of the interpreter * test.pythoninfo now gets the core configuration using _testcapi.get_coreconfig()
* _Py_CoerceLegacyLocale() restores LC_CTYPE on fail (GH-9044)Victor Stinner2018-09-031-1/+13
| | | | bpo-34544: If _Py_CoerceLegacyLocale() fails to coerce the C locale, restore the LC_CTYPE locale to the its previous value.
* 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.
* Fix struct sequence glossary entry grammar (GH-9030)Zachary Ware2018-09-021-1/+1
| | | | | ... by removing a superfluous "either". Reported by Никита Люшненко on docs@.
* closes bpo-34555: Fix incorrectly nested test for HAVE_LINUX_VM_SOCKETS_H ↵Thomas Herzog2018-09-012-24/+27
| | | | (GH-9016)
* 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-012-1/+2
| | | 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-34408: Prevent a null pointer dereference and resource leakage in ↵Pablo Galindo2018-08-312-6/+11
| | | | | | | `PyInterpreterState_New()` (GH-8767) * A pointer in `PyInterpreterState_New()` could have been `NULL` when being dereferenced. * Memory was leaked in `PyInterpreterState_New()` when taking some error-handling code path.
* 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-34062: Add missing launcher argument and make behavior consistent ↵Brendan Gerrity2018-08-312-8/+12
| | | | | | between short and long arguments (GH-8827) Added previously missing "--list" argument. Made "--list" and "--list-paths" behavior consistent with the corresponding "-0" and "-0p" arguments.
* Add VSTS status badge to readme (GH-8958)Steve Dower2018-08-311-1/+13
|
* bpo-34097: Polish API design (GH-8725)Marcel Plch2018-08-313-18/+19
| | | Move strict_timestamps to constructor.
* bpo-34427: Fix infinite loop when calling MutableSequence.extend() on self ↵Naris R2018-08-303-0/+15
| | | | (GH-8813)
* bpo-34542: Update test certs and keys (GH-8997)Christian Heimes2018-08-3020-726/+981
| | | | | | | | 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: Use _PyCoreConfig instead of globals (GH-9005)Victor Stinner2018-08-296-40/+50
| | | | | Use the core configuration of the interpreter, rather than using global configuration variables. For example, replace Py_QuietFlag with core_config->quiet.
* bpo-34523: Py_FileSystemDefaultEncoding NULL by default (GH-9003)Victor Stinner2018-08-292-21/+32
| | | | | | | | * Py_FileSystemDefaultEncoding and Py_FileSystemDefaultEncodeErrors default value is now NULL: initfsencoding() set them during Python initialization. * Document how Python chooses the filesystem encoding and error handler. * Add an assertion to _PyCoreConfig_Read().
* bpo-34485: Emit C locale coercion warning later (GH-9002)Victor Stinner2018-08-291-8/+7
| | | | PYTHONCOERCELOCALE=warn warning is now emitted later and written into sys.stderr, rather than being written into the C stderr stream.
* bpo-34523: Support surrogatepass in locale codecs (GH-8995)Victor Stinner2018-08-297-115/+421
| | | | | | | | | | | | | | | | | | | | 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-295-30/+55
| | | | | | | 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: Fix config_init_fs_encoding() (GH-8991)Victor Stinner2018-08-291-1/+1
| | | | Call config_init_fs_encoding() if filesystem_errors is not NULL but filesystem_encoding is NULL.
* bpo-34523: Add _PyCoreConfig.filesystem_encoding (GH-8963)Victor Stinner2018-08-2912-100/+296
| | | | | | | | | | | | | | | | | | | | | | | _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-296-135/+265
| | | | * Add stdio_encoding and stdio_errors fields to _PyCoreConfig. * Add unit tests on stdio_encoding and stdio_errors.
* bpo-34485, Windows: LC_CTYPE set to user preference (GH-8988)Victor Stinner2018-08-293-19/+13
| | | | | | | | | | | | | | 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).
* bpo-34485: stdout uses surrogateescape on POSIX locale (GH-8986)Victor Stinner2018-08-293-18/+40
| | | | | | | 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.
* 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-284-97/+111
| | | | | | | | | | * 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-283-13/+19
| | | | | | | | * _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-288-43/+91
| | | | | | | | | | | | | | | 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-34403: On HP-UX, force ASCII for C locale (GH-8969)Victor Stinner2018-08-285-52/+105
| | | | | | | | On HP-UX with C or POSIX locale, sys.getfilesystemencoding() now returns "ascii" instead of "roman8" (when the UTF-8 Mode is disabled and the C locale is not coerced). nl_langinfo(CODESET) announces "roman8" whereas it uses the Latin1 encoding in practice.
* bpo-34527: POSIX locale enables the UTF-8 Mode (GH-8972)Victor Stinner2018-08-285-11/+35
| | | | | | | | | | * 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-284-0/+256
| | | | | | 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-273-10/+48
|
* bpo-34347: Fix test_utf8_mode.test_cmd_line for AIX (GH-8923)Michael Felt2018-08-272-0/+3
| | | AIX uses ISO-8859-1 encoding for the C locale.
* bpo-34434: Update doc for bool(), float() and int() arguments (GH-8834)Louis Sautier2018-08-271-1/+9
|
* 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-274-12/+13
| | | | | | | 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.