summaryrefslogtreecommitdiff
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix typo in thread_nt.h code comment (GH-5211) (GH-5226)Miss Islington (bot)2018-01-171-1/+1
| | | | | The comment for PyThread_allocate_lock says "It has too be implemented ...". There was an extra "o" in ".. to be implemented.." (cherry picked from commit 6027802ca7fae118bce6afead51d01a174600d40)
* [3.6] bpo-32555: Fix locale encodings (#5193)Victor Stinner2018-01-151-94/+157
| | | | | | | | | | | | | | | | | On FreeBSD and Solaris, os.strerror() now always decode the byte string from the current locale encoding, rather than using ASCII/surrogateescape in some cases. Changes: * Add _Py_DecodeLocaleEx() and _Py_EncodeLocaleEx() which has an additional current_locale parameter. * PyUnicode_DecodeLocale(), PyUnicode_DecodeLocaleAndSize() and * PyUnicode_EncodeLocale() now always use the current locale * encoding, instead of using Py_DecodeLocale()/Py_EncodeLocale(). * Document encoding in Py_DecodeLocale() and Py_EncodeLocale() documentations. * Add USE_FORCE_ASCII define to not define decode_ascii_surrogateescape() on Android.
* [3.6] bpo-31900: Fix localeconv() encoding for LC_NUMERIC (#4174) (#5192)Victor Stinner2018-01-152-11/+81
| | | | | | | | | | * Add _Py_GetLocaleconvNumeric() function: decode decimal_point and thousands_sep fields of localeconv() from the LC_NUMERIC encoding, rather than decoding from the LC_CTYPE encoding. * Modify locale.localeconv() and "n" formatter of str.format() (for int, float and complex to use _Py_GetLocaleconvNumeric() internally. (cherry picked from commit cb064fc2321ce8673fe365e9ef60445a27657f54)
* advance copyright years to 2018 (GH-5094) (#5104)Miss Islington (bot)2018-01-051-1/+1
| | | (cherry picked from commit 65f2a6dcc2bc28a8566b74c8e9273f982331ec48)
* bpo-32365: Fix a reference leak when compile __debug__. (GH-4916) (#4918)Miss Islington (bot)2017-12-181-4/+4
| | | | It was introduced in bpo-27169. (cherry picked from commit bd6ec4d79e8575df3d08f8a89ba721930032714c)
* compile.c: Remove unused varible (#4886)Victor Stinner2017-12-151-1/+0
| | | Fix a compiler warning.
* [3.6] bpo-30416: Protect the optimizer during constant folding. (#4865)Serhiy Storchaka2017-12-151-15/+131
| | | | | | | It no longer spends much time doing complex calculations and no longer consumes much memory for creating large constants that will be dropped later. This fixes also bpo-21074.
* [3.6] bpo-27169: The __debug__ constant is now optimized out at compile ↵Serhiy Storchaka2017-12-151-30/+15
| | | | | | time. (GH-4880) (#4882) This fixes also bpo-22091.. (cherry picked from commit 3325a6780c81f1ea51190370b5454879c4862a37)
* bpo-32329: Fix sys.flags.hash_randomization (#4875)Victor Stinner2017-12-152-4/+3
| | | | sys.flags.hash_randomization is now properly set to 0 when hash randomization is turned off by PYTHONHASHSEED=0.
* [3.6] bpo-32176: Set CO_NOFREE in the code object constructor (GH-4684)Nick Coghlan2017-12-031-12/+0
| | | | | | | | | Previously, CO_NOFREE was set in the compiler, which meant it could end up being set incorrectly when code objects were created directly. Setting it in the constructor based on freevars and cellvars ensures it is always accurate, regardless of how the code object is defined. (cherry picked from commit 078f1814f1a4413a2a0fdb8cf4490ee0fc98ef34)
* Don't hide unexpected errors in PyErr_WarnExplicitObject(). (GH-4585) (#4662)Miss Islington (bot)2017-12-011-9/+10
| | | (cherry picked from commit a561862048555d555fa4850eaf832ae5474c7e1f)
* bpo-20891: Fix PyGILState_Ensure() (#4650) (#4655)Victor Stinner2017-11-301-6/+17
| | | | | | | | | | | | | | | When PyGILState_Ensure() is called in a non-Python thread before PyEval_InitThreads(), only call PyEval_InitThreads() after calling PyThreadState_New() to fix a crash. Add an unit test in test_embed. Enhance also embedded tests, backport from master: * Add test_pre_initialization_api() * Set PYTHONIOENCODING environment variable in test_forced_io_encoding() (cherry picked from commit b4d1e1f7c1af6ae33f0e371576c8bcafedb099db)
* bpo-32011: Revert "Issue GH-15480: Remove the deprecated and unused ↵Miss Islington (bot)2017-11-151-0/+21
| | | | | | | | TYPE_INT64 code from marshal." (GH-4381) (#4405) Simplify the reverted code. This reverts commit e9bbe8b87ba2874efba0474af5cc7d5941dbf742. (cherry picked from commit 00987f6230fcdbecc8d9ab4b2b9fae8f99a1a4a9)
* [3.6] bpo-31949: Fixed several issues in printing tracebacks ↵Serhiy Storchaka2017-11-151-51/+51
| | | | | | | | | | | | (PyTraceBack_Print()). (GH-4289) (#4406) * Setting sys.tracebacklimit to 0 or less now suppresses printing tracebacks. * Setting sys.tracebacklimit to None now causes using the default limit. * Setting sys.tracebacklimit to an integer larger than LONG_MAX now means using the limit LONG_MAX rather than the default limit. * Fixed integer overflows in the case of more than 2**31 traceback items on Windows. * Fixed output errors handling.. (cherry picked from commit edad8eebeee3c99e324a7f1ac5073167c2b0b54d)
* [3.6] bpo-30696: Fix the REPL looping endlessly when no memory (GH-4160). ↵xdegaye2017-11-121-18/+42
| | | | | (#4379) (cherry picked from commit e0582a37c8d1776a2fd4968e9216f3a05f780276)
* [3.6] bpo-30697: Fix PyErr_NormalizeException() when no memory (GH-2327). ↵xdegaye2017-10-261-16/+30
| | | | | (#4135) (cherry picked from commit 56d1f5ca32892c7643eb8cee49c40c1644f1abfe)
* [3.6] bpo-21720: Restore the Python 2.7 logic in handling a fromlist. ↵Serhiy Storchaka2017-10-261-1583/+1593
| | | | | | | | (GH-4118) (#4128) BytesWarning no longer emitted when the fromlist argument of __import__() or the __all__ attribute of the module contain bytes instances.. (cherry picked from commit 41c56940c6edf3ea169332a6b039b6c8796f0475)
* [3.6] bpo-30817: Fix PyErr_PrintEx() when no memory (GH-2526). (#4107)xdegaye2017-10-241-3/+9
| | | (cherry picked from commit 66caacf2f0d6213b049a3097556e28e30440b900)
* bpo-31825: Fixed OverflowError in the 'unicode-escape' codec (GH-4058) (#4059)Miss Islington (bot)2017-10-201-1/+1
| | | | and in codecs.escape_decode() when decode an escaped non-ascii byte. (cherry picked from commit 56cb465cc93dcb35aaf7266ca3dbe2dcff1fac5f)
* [3.6] bpo-31786: Make functions in the select module blocking when timeout ↵Pablo Galindo2017-10-181-8/+28
| | | | | is a small negative value. (GH-4003). (#4022) (cherry picked from commit 2c15b29aea5d6b9c61aa42d2c24a07ff1edb4b46)
* [3.6] bpo-28603: Fix formatting tracebacks for unhashable exceptions ↵Miss Islington (bot)2017-10-181-3/+18
| | | | | (GH-4014) (#4024) (cherry picked from commit de86073a761cd3539aaca6f886a1f55effc0d9da)
* [3.6] bpo-31780: Fix incorrect error message for ',x', ',b', ',o' specs ↵Miss Islington (bot)2017-10-151-2/+2
| | | | | | (GH-4002) (#4004) Patch by Pablo. (cherry picked from commit 28773ca7a7aa58a28e42a9eb0066acf71b5a8dc4)
* [3.6] bpo-31642: Restore blocking "from" import by setting None in ↵Serhiy Storchaka2017-10-081-238/+241
| | | | | sys.modules. (GH-3834). (#3923) (cherry picked from commit f07e2b64df6304a36fb5e29397d3c77a7ba17704)
* [3.6] remove tabs from getcompiler.c (GH-3892) (#3893)Miss Islington (bot)2017-10-051-1/+1
| | | (cherry picked from commit a8ed11742b4c2115597977ce04fa8e043d9e0792)
* [3.6] bpo-31592: Fix an assertion failure in Python parser in case of a bad ↵Miss Islington (bot)2017-09-301-12/+16
| | | | | unicodedata.normalize(). (GH-3767) (#3836) (cherry picked from commit 7dc46d8cf5854d9f4ce3271b29c21aea4872e8ad)
* [3.6] bpo-31285: Remove splitlines identifier from Python/_warnings.c ↵Miss Islington (bot)2017-09-291-3/+0
| | | | | | (GH-3803) (#3829) (forgot to remove it in GH-3219) (cherry picked from commit 8b4ff53c440dfcde40fbeb02c5e666c85190528f)
* [3.6] bpo-31588: Validate return value of __prepare__() methods (GH-3790)Miss Islington (bot)2017-09-281-0/+7
| | | | | | | | | | | Class execution requires that __prepare__() methods return a proper execution namespace. Check for that immediately after calling __prepare__(), rather than passing it through to the code execution machinery and potentially triggering SystemError (in debug builds) or a cryptic TypeError (in release builds). Patch by Oren Milman. (cherry picked from commit 5837d0418f47933b2e3c139bdee8a79c248a943c)
* [3.6] bpo-31285: Fix an assertion failure and a SystemError in ↵Serhiy Storchaka2017-09-271-3/+1
| | | | | warnings.warn_explicit. (GH-3219) (#3775) (cherry picked from commit 91fb0afe181986b48abfc6092dcca912b39de51d)
* [3.6] bpo-31492: Fix assertion failures in case of a module with a bad ↵Serhiy Storchaka2017-09-271-0/+4
| | | | | __name__ attribute. (GH-3620). (#3773) (cherry picked from commit 6db7033192cd537ca987a65971acb01206c3ba82)
* [3.6] bpo-31566: Fix an assertion failure in _warnings.warn() in case of a ↵Miss Islington (bot)2017-09-241-3/+4
| | | | | bad __name__ global. (GH-3717) (#3730) (cherry picked from commit 5d3e80021ab33360191eb0fbff34e0246c913884)
* [3.6] bpo-31315: Fix an assertion failure in imp.create_dynamic(), when ↵Miss Islington (bot)2017-09-191-0/+5
| | | | | spec.name is not a string. (GH-3257) (#3653) (cherry picked from commit 9974e1bcf3d0cec9b38b39b39b7ec8a1ebd9ef54)
* [3.6] bpo-31418: Fix an assertion failure in PyErr_WriteUnraisable() in case ↵Miss Islington (bot)2017-09-141-1/+1
| | | | | of an exception with a bad __module__ attribute. (GH-3539) (#3556) (cherry picked from commit f6e61df01536493f1280cd07639c7ff9bffb2cdc)
* [3.6] bpo-30923: Silence fall-through warnings included in -Wextra since ↵Victor Stinner2017-09-129-14/+27
| | | | | | | | | | | | | | | | gcc-7.0 (#3518) * bpo-30923: Disable warning that has been part of -Wextra since gcc-7.0. (#3142) (cherry picked from commit d73a960c575207539c3f9765cff26d4fff400b45) * bpo-30923: Silence fall-through warnings included in -Wextra since gcc-7.0. (#3157) (cherry picked from commit f432a3234f9f2ee09bd40be03e06bf72865ee375) * bpo-31275: Small refactoring to silence a fall-through warning. (#3206) (cherry picked from commit 138753c1b96b5e06a5c5d409fa4cae5e2fe1108b)
* [3.6] bpo-31416: Fix assertion failures in case of a bad warnings.filters or ↵Serhiy Storchaka2017-09-121-3/+16
| | | | | | warnings.defaultaction. (GH-3496) (#3509) Patch by Oren Milman.. (cherry picked from commit 9d984fd2b097c8c29479d1c3eb740995fe1ccb0d)
* [3.6] bpo-31373: remove overly strict float range checks (GH-3486) (#3495)Benjamin Peterson2017-09-111-4/+0
| | | | | | This undoes a853a8ba7850381d49b284295dd6f0dc491dbe44 except for the pytime.c parts. We want to continue to allow IEEE 754 doubles larger than FLT_MAX to be rounded into finite floats. Tests were added to very this behavior. (cherry picked from commit 2bb69a5b4e7f96cb35d1b28aa7b7b3974b351f59)
* [3.6] bpo-31411: Prevent raising a SystemError in case warnings.onceregistry ↵Serhiy Storchaka2017-09-111-1/+7
| | | | | is not a dictionary. (GH-3485). (#3494) (cherry picked from commit 252033d50effa08046ac34fcc406bc99796ab88b)
* [3.6] bpo-29526: Add reference to help('FORMATTING') in format() builtin ↵Serhiy Storchaka2017-09-112-4/+8
| | | | | (GH-166). (#3491) (cherry picked from commit 2e6bb4484ee1b0da67d1dfcf0816c58602daa5a0)
* [3.6] bpo-26669: Fix nan arg value error in pytime.c (GH-3085) (GH-3467) Miss Islington (bot)2017-09-081-0/+14
| | | | | | * Modify NaN check function and error message * Fix pytime.c when arg is nan * fix whitespace (cherry picked from commit 829dacce4fca60fc3c3367980e75e21dfcdbe6be)
* [3.6] bpo-31393: Fix the use of PyUnicode_READY(). (GH-3451). (#3453)Serhiy Storchaka2017-09-081-7/+10
| | | (cherry picked from commit e3b2b4b8d9e751b49e3550cb83ba39b54fdc377c)
* [3.6] bpo-30640: Fix undefined behavior in _PyFunction_FastCallDict() and ↵Zackery Spytz2017-09-081-2/+3
| | | | | | PyEval_EvalCodeEx() (GH-2919) (#2964) k + 1 was calculated with k = NULL.. (cherry picked from commit c6ea8974e2d939223bfd6d64ee13ec89c090d2e0)
* [3.6] fixes bpo-31373: fix undefined floating-point demotions (GH-3396) (#3424)Miss Islington (bot)2017-09-072-16/+21
| | | (cherry picked from commit a853a8ba7850381d49b284295dd6f0dc491dbe44)
* bpo-30465: Fix lineno and col_offset in fstring AST nodes (GH-1800) (gh-3409)Miss Islington (bot)2017-09-061-5/+67
| | | | For f-string ast nodes, fix the line and columns so that tools such as flake8 can identify them correctly. (cherry picked from commit e7c566caf177afe43b57f0b2723e723d880368e8)
* bpo-31095: fix potential crash during GC (GH-3195)INADA Naoki2017-09-041-0/+2
| | | (cherry picked from commit a6296d34a478b4f697ea9db798146195075d496c)
* [3.6] bpo-31070: Fix a race condition in importlib _get_module_lock(). ↵Serhiy Storchaka2017-08-091-1477/+1481
| | | | | (GH-3033). (#3038) (cherry picked from commit 9b0d1d647e3d2ec9d299e5c9f49b02fbbb810a5a)
* Fix a shadow-compatible-local warning (#2181)Yuan Chao Chou2017-08-041-165/+165
| | | | Change the shadowing naming, 'value' (Python-ast.c:4686), to 'val' to prevent the variables from being misused.
* [3.6] bpo-31071: Avoid masking original TypeError in call with * unpacking ↵Serhiy Storchaka2017-08-031-29/+34
| | | | | | (GH-2957) (#2991) when other arguments are passed. (cherry picked from commit 25e4f77)
* bpo-30891: Fix again importlib _find_and_load() (#2665) (#2801)Victor Stinner2017-07-211-341/+342
| | | | | | | | | | Use sys.modules.get() in the "with _ModuleLockManager(name):" block to protect the dictionary key with the module lock and use an atomic get to prevent race condition. Remove also _bootstrap._POPULATE since it was unused (_bootstrap_external now has its own _POPULATE object), add a new _SENTINEL object instead. (cherry picked from commit e72b1359f81d1dd42bd8a5c5cc2b3928b74f8023)
* [3.6] bpo-30876: Relative import from unloaded package now reimports the ↵Serhiy Storchaka2017-07-162-371/+356
| | | | | | | | | package (GH-2639) (#2676) instead of failing with SystemError. Relative import from non-package now fails with ImportError rather than SystemError. (cherry picked from commit 8a9cd20edca7d01b68292036029ae3735ce65edd)
* bpo-30891: Fix importlib _find_and_load() race condition (#2646) (#2651)Victor Stinner2017-07-102-1530/+1518
| | | | | | | * Rewrite importlib _get_module_lock(): it is now responsible to hold the imp lock directly. * _find_and_load() now holds the module lock to check if name is in sys.modules to prevent a race condition (cherry picked from commit 4f9a446f3fb42f800e73cd9414dd1eccb3ca4fa7)
* [3.6] bpo-30814: Fixed a race condition when import a submodule from a ↵Serhiy Storchaka2017-07-062-311/+294
| | | | | package. (GH-2580). (#2598) (cherry picked from commit b4baacee1adc06edbe30ac7574d17a8cd168e2e0)