| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
(GH-6060)
and remove redundant code.
(cherry picked from commit 67ee07795bcd84b679c000780212d4d81a1490a3)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 9e94c0d3c78d1bc582c865240ed9353fe9689b2a)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
| |
(#5504)" (#5911)
This reverts commit a71397fb6603d0fe673acd7765c74699cd28fe7b.
|
|
|
|
|
|
|
| |
This function expects the destination buffer size to be given
in wide characters, not bytes.
(cherry picked from commit b3b4a9d3001f1fc7df8efcccdce081de54fa5eab)
Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-5563)
Fix a rare but potential pre-exec child process deadlock in subprocess on POSIX systems when marking file descriptors inheritable on exec in the child process. This bug appears to have been introduced in 3.4 with the inheritable file descriptors support.
This also changes Python/fileutils.c `set_inheritable` to use the "slow" two `fcntl` syscall path instead of the "fast" single `ioctl` syscall path when asked to be async signal safe (by way of being asked not to raise exceptions). `ioctl` is not a POSIX async-signal-safe approved function.
ref: http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html
(cherry picked from commit c1e46e94de38a92f98736af9a42d89c3975a9919)
Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
| |
Fix typos found by codespell in docs, docstrings, and comments.
Fixes for the following files were in post-3.6 code and not backported:
Lib/ctypes/_aix.py (new), Lib/test/test_concurrent_futures.py,
Modules/_asynciomodule.c, Modules/_pickle.c, Objects/obmalloc.c.
(cherry picked from commit c3d9508ff22ece9a96892b628dd5813e2fb0cd80)
|
|
|
|
|
|
|
|
|
|
| |
* Make sure ``__spec__.loader`` matches ``__loader__`` for namespace packages.
* Make sure ``__spec__.origin` matches ``__file__`` for namespace packages.
https://bugs.python.org/issue32303
https://bugs.python.org/issue32305.
(cherry picked from commit bbbcf8693b876daae4469765aa62f8924f39a7d2)
Co-authored-by: Barry Warsaw <barry@python.org>
|
|
|
|
|
|
|
|
| |
Clarify that the level argument is used to determine whether to
perform absolute or relative imports: 0 is absolute, while a positive number
is the number of parent directories to search relative to the current module.
(cherry picked from commit 461d225b195eec5269f317323b41115516144c41)
Co-authored-by: oldk <oldk1331@users.noreply.github.com>
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
* 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)
|
|
|
| |
(cherry picked from commit 65f2a6dcc2bc28a8566b74c8e9273f982331ec48)
|
|
|
|
| |
It was introduced in bpo-27169.
(cherry picked from commit bd6ec4d79e8575df3d08f8a89ba721930032714c)
|
|
|
| |
Fix a compiler warning.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
time. (GH-4880) (#4882)
This fixes also bpo-22091..
(cherry picked from commit 3325a6780c81f1ea51190370b5454879c4862a37)
|
|
|
|
| |
sys.flags.hash_randomization is now properly set to 0 when hash
randomization is turned off by PYTHONHASHSEED=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)
|
|
|
| |
(cherry picked from commit a561862048555d555fa4850eaf832ae5474c7e1f)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
| |
TYPE_INT64 code from marshal." (GH-4381) (#4405)
Simplify the reverted code.
This reverts commit e9bbe8b87ba2874efba0474af5cc7d5941dbf742.
(cherry picked from commit 00987f6230fcdbecc8d9ab4b2b9fae8f99a1a4a9)
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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)
|
|
|
|
|
| |
(#4379)
(cherry picked from commit e0582a37c8d1776a2fd4968e9216f3a05f780276)
|
|
|
|
|
| |
(#4135)
(cherry picked from commit 56d1f5ca32892c7643eb8cee49c40c1644f1abfe)
|
|
|
|
|
|
|
|
| |
(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)
|
|
|
| |
(cherry picked from commit 66caacf2f0d6213b049a3097556e28e30440b900)
|
|
|
|
| |
and in codecs.escape_decode() when decode an escaped non-ascii byte.
(cherry picked from commit 56cb465cc93dcb35aaf7266ca3dbe2dcff1fac5f)
|
|
|
|
|
| |
is a small negative value. (GH-4003). (#4022)
(cherry picked from commit 2c15b29aea5d6b9c61aa42d2c24a07ff1edb4b46)
|
|
|
|
|
| |
(GH-4014) (#4024)
(cherry picked from commit de86073a761cd3539aaca6f886a1f55effc0d9da)
|
|
|
|
|
|
| |
(GH-4002) (#4004)
Patch by Pablo.
(cherry picked from commit 28773ca7a7aa58a28e42a9eb0066acf71b5a8dc4)
|
|
|
|
|
| |
sys.modules. (GH-3834). (#3923)
(cherry picked from commit f07e2b64df6304a36fb5e29397d3c77a7ba17704)
|
|
|
| |
(cherry picked from commit a8ed11742b4c2115597977ce04fa8e043d9e0792)
|
|
|
|
|
| |
unicodedata.normalize(). (GH-3767) (#3836)
(cherry picked from commit 7dc46d8cf5854d9f4ce3271b29c21aea4872e8ad)
|
|
|
|
|
|
| |
(GH-3803) (#3829)
(forgot to remove it in GH-3219)
(cherry picked from commit 8b4ff53c440dfcde40fbeb02c5e666c85190528f)
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
| |
warnings.warn_explicit. (GH-3219) (#3775)
(cherry picked from commit 91fb0afe181986b48abfc6092dcca912b39de51d)
|
|
|
|
|
| |
__name__ attribute. (GH-3620). (#3773)
(cherry picked from commit 6db7033192cd537ca987a65971acb01206c3ba82)
|
|
|
|
|
| |
bad __name__ global. (GH-3717) (#3730)
(cherry picked from commit 5d3e80021ab33360191eb0fbff34e0246c913884)
|
|
|
|
|
| |
spec.name is not a string. (GH-3257) (#3653)
(cherry picked from commit 9974e1bcf3d0cec9b38b39b39b7ec8a1ebd9ef54)
|
|
|
|
|
| |
of an exception with a bad __module__ attribute. (GH-3539) (#3556)
(cherry picked from commit f6e61df01536493f1280cd07639c7ff9bffb2cdc)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
| |
warnings.defaultaction. (GH-3496) (#3509)
Patch by Oren Milman..
(cherry picked from commit 9d984fd2b097c8c29479d1c3eb740995fe1ccb0d)
|
|
|
|
|
|
| |
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)
|
|
|
|
|
| |
is not a dictionary. (GH-3485). (#3494)
(cherry picked from commit 252033d50effa08046ac34fcc406bc99796ab88b)
|
|
|
|
|
| |
(GH-166). (#3491)
(cherry picked from commit 2e6bb4484ee1b0da67d1dfcf0816c58602daa5a0)
|
|
|
|
|
|
| |
* Modify NaN check function and error message
* Fix pytime.c when arg is nan
* fix whitespace
(cherry picked from commit 829dacce4fca60fc3c3367980e75e21dfcdbe6be)
|
|
|
| |
(cherry picked from commit e3b2b4b8d9e751b49e3550cb83ba39b54fdc377c)
|
|
|
|
|
|
| |
PyEval_EvalCodeEx() (GH-2919) (#2964)
k + 1 was calculated with k = NULL..
(cherry picked from commit c6ea8974e2d939223bfd6d64ee13ec89c090d2e0)
|
|
|
| |
(cherry picked from commit a853a8ba7850381d49b284295dd6f0dc491dbe44)
|
|
|
|
| |
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)
|
|
|
| |
(cherry picked from commit a6296d34a478b4f697ea9db798146195075d496c)
|