| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
| |
Fix the following warning:
Python/pystrtod.c: In function 'format_float_short':
Python/pystrtod.c:1007:13: warning: 'strncpy' output truncated before terminating nul copying 3 bytes from a string of the same length [-Wstringop-truncation]
strncpy(p, "ERR", 3);
(cherry picked from commit 9fb84157595a385f15799e5d0729c1e1b0ba9d38)
|
|
|
|
|
| |
(cherry picked from commit 2ec872b31e25cee1f983fe07991fb53f3fd1cbac)
Co-authored-by: Yury Selivanov <yury@magic.io>
|
|
|
|
|
| |
off by default (GH-9379)" (GH-9416)
This reverts commit 144f1e2c6f4a24bd288c045986842c65cc289684.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
default (GH-9379)
* bpo-34589: Make _PyCoreConfig.coerce_c_locale private (GH-9371)
_PyCoreConfig:
* Rename coerce_c_locale to _coerce_c_locale
* Rename coerce_c_locale_warn to _coerce_c_locale_warn
These fields are now private (name prefixed by "_").
(cherry picked from commit 188ebfa475a6f6aa2d0ea14ca8e1fbe7865b6d27)
* bpo-34589: C locale coercion off by default (GH-9073)
Py_Initialize() and Py_Main() cannot enable the C locale coercion
(PEP 538) anymore: it is always disabled. It can now only be enabled
by the Python program ("python3).
test_embed: get_filesystem_encoding() doesn't have to set PYTHONUTF8
nor PYTHONCOERCECLOCALE, these variables are already set in the
parent.
(cherry picked from commit 7a0791b6992d420dc52536257f2f093851ed7215)
* bpo-34589: Add -X coerce_c_locale command line option (GH-9378)
Add a new -X coerce_c_locale command line option to control C locale
coercion (PEP 538).
(cherry picked from commit dbdee0073cf0b88fe541980ace1f650900f455cc)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Followup to 90fc8980bbcc5c7dcced3627fe172b0bfd193a3b.
<!--
Thanks for your contribution!
Please read this comment in its entirety. It's quite important.
GH- Pull Request title
It should be in the following format:
```
bpo-NNNN: Summary of the changes made
```
Where: bpo-NNNN refers to the issue number in the https://bugs.python.org.
Most PRs will require an issue number. Trivial changes, like fixing a typo, do not need an issue.
GH- Backport Pull Request title
If this is a backport PR (PR made against branches other than `master`),
please ensure that the PR title is in the following format:
```
[X.Y] <title from the original PR> (GH-NNNN)
```
Where: [X.Y] is the branch name, e.g. [3.6].
GH-NNNN refers to the PR number from `master`.
-->
(cherry picked from commit d13e59c1b512069d90efe7ee9b613d3913e79c56)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
|
|
|
|
|
|
|
|
| |
to the "async" keyword. (GH-4175)
Previously, col_offset points to the keyword after "async".
(cherry picked from commit 90fc8980bbcc5c7dcced3627fe172b0bfd193a3b)
Co-authored-by: guoci <zguoci@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
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.
(cherry picked from commit d545869d084e70d4838310e79b52a25a72a1ca56)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
|
|
|
|
|
|
| |
bpo-34544: If _Py_CoerceLegacyLocale() fails to coerce the C locale,
restore the LC_CTYPE locale to the its previous value.
(cherry picked from commit 8ea09110d413829f71d979d8c7073008cb87fb03)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-34485: stdout uses surrogateescape on POSIX locale (GH-8986)
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.
Fix the error handler of standard streams like sys.stdout:
PYTHONIOENCODING=":" is now ignored instead of setting the error handler to
"strict".
(cherry picked from commit 315877dc361d554bec34b4b62c270479ad36a1be)
|
|
|
|
|
|
|
|
|
|
| |
* _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.
(cherry picked from commit 2c8ddcf4f14f3e4c87a6fe6678ab5ad09130c6ab)
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
(cherry picked from commit 5cb258950ce9b69b1f65646431c464c0c17b1510)
|
|
|
|
|
| |
(cherry picked from commit a2eefa67542c25617a58c03a27c17fd48e2a0856)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
|
|
|
|
|
|
|
|
| |
builtin_sum_impl() (GH-8872)
Reported by Svace static analyzer.
(cherry picked from commit 2b824b2538c4a5f9f520c5de8a1eae5a0c181a94)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
|
|
|
|
|
|
|
|
| |
(GH-8852)
Reported by Svace static analyzer.
(cherry picked from commit 28853a249b1d0c890b7e9ca345290bb8c1756446)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* -X dev: it is now possible to override the memory allocator using
PYTHONMALLOC even if the developer mode is enabled.
* Add _Py_InitializeFromConfig()
* Add _Py_Initialize_ReadEnvVars() to set global configuration
variables from environment variables
* Fix the code to initialize Python: Py_Initialize() now also reads
environment variables
* _Py_InitializeCore() can now be called twice: the second call
only replaces the configuration.
* Write unit tests on Py_Initialize() and the different ways to
configure Python
* The isolated mode now always sets Py_IgnoreEnvironmentFlag and
Py_NoUserSiteDirectory to 1.
* pymain_read_conf() now saves/restores the configuration
if the encoding changed
|
|
|
|
|
|
|
| |
(GH-8262) (GH-8423)
(cherry picked from commit aba24ff3601ddc86b85e01880a8be596fb799287)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 147d95511f59cfdd2d522f9d736f2335457bae20)
Co-authored-by: jdemeyer <jdemeyer@cage.ugent.be>
|
|
|
|
|
| |
(cherry picked from commit 56868f940e0cc0b35d33c0070107ff3bed2d8766)
Co-authored-by: jdemeyer <jdemeyer@cage.ugent.be>
|
|
|
|
|
|
|
|
| |
Py_Main() can again be called after Py_Initialize(), as in Python
3.6. The new configuration is ignored, except of
_PyMainInterpreterConfig.argv which is used to update sys.argv.
(cherry picked from commit fb47bca9ee2d07ce96df94b4e4abafd11826eb01)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
|
|
|
|
|
|
|
|
|
| |
`_PyUnicode_TransformDecimalAndSpaceToASCII()` missed trailing NUL char.
It caused buffer overflow in `_Py_string_to_number_with_underscores()`.
This bug is introduced in 9b6c60cb.
(cherry picked from commit 16dfca4d829e45f36e71bf43f83226659ce49315)
Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
|
|
|
|
|
| |
(cherry picked from commit 993030aac576710a46b3dd0b4864f819d4a94145)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 504373c59b48f1ea12132d515459022730db6047)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit f60bf0e168255b7675a4c049250ba6b202f8e647)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
(GH-8159)
This will prevent emitting a resource warning when the execution was
interrupted by Ctrl-C between calling open() and entering a 'with' block
in "with open()".
(cherry picked from commit 3f4d90d4d72921f16babd3f52d7df804916af224)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit d8c3e820b4fcdc45b80ba47f615c95e99e2e931b)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
|
|
|
|
| |
(GH-7918) (GH-8070)
PyErr_Print() will not return when the exception is a SystemExit, so
decref the __main__ module object in that case.
(cherry picked from commit d8cba5d16f1333fd625726fc72e66afbd45b8d00)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 41cb0baea96a80360971908a0bd79d9d40dd5e44)
Co-authored-by: Yury Selivanov <yury@magic.io>
|
|
|
|
|
|
| |
Directly executed pyc files were being kept open longer than necessary.
(cherry picked from commit ea737751b10fff752aafed0231e8a02b82ba365d)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
|
|
|
|
|
|
| |
Calling Py_Initialize() twice does nothing, instead of failing with a
fatal error: restore the Python 3.6 behaviour.
(cherry picked from commit 209abf746985526bce255e2fba97d3246924885d)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
|
|
|
|
|
| |
(cherry picked from commit 378c53cc3187dba57c7560ccc2557f516c8a7bc8)
Co-authored-by: Yury Selivanov <yury@magic.io>
|
|
|
|
|
| |
(cherry picked from commit 2a4a62ba4ae770bbc7b7fdec0760031c83fe1f7b)
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
|
|
|
|
|
| |
(cherry picked from commit a8eb58546b37a7cd5f332f019bb07388f5212c2d)
Co-authored-by: A. Jesse Jiryu Davis <jesse@emptysquare.net>
|
|
|
|
|
| |
(cherry picked from commit a5c42284e69fb309bdd17ee8c1c120d1be383012)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
| |
Remove the docstring attribute of AST types and restore docstring
expression as a first stmt in their body.
Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
|
|
|
|
|
|
|
|
| |
bpo-25612, bpo-33612: Remove an assertion from PyThreadState_Clear()
which failed at Python shutdown or on fork if a thread was running a
generator.
(cherry picked from commit b6dccf54fd3bac9c87348d96f9d6b571608c15bc)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
|
|
|
|
|
|
|
| |
(GH-6774). (GH-6927)
(cherry picked from commit 64fddc423fcbe90b8088446c63385ec0aaf3077c)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
| |
Don't crash on warnings.warn_explicit() if module_globals is not a dict.
(cherry picked from commit b056562860c227bad2e0ba7cd3130e115c007768)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
|
|
|
| |
Remove the interpreters testing helper (and xid registry).
|
|
|
|
|
|
|
|
|
|
| |
The hash implementation casts the input pointer to uint64_t* and directly reads
from this, which may cause unaligned accesses. Use memcpy() instead so this code
will not crash with SIGBUS on sparc.
https://bugs.gentoo.org/show_bug.cgi?id=636400
(cherry picked from commit 1e2ec8a996daec65d8d5a3d43b66a9909c6d0653)
Co-authored-by: Rolf Eike Beer <eike@sf-mail.de>
|
|
|
|
| |
functions (GH-6616). (GH-6619)
|
|
|
|
|
| |
(cherry picked from commit e9d9494d6b2a5e0c2d48d22c7f0d5e95504b4f7e)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-6273)
External importers were being added in both phases of the import
system initialisation.
They're only supposed to be added in the second phase, after the
import machinery has been appropriately configured.
(cherry picked from commit 0977091dca59709864b14cfc129388f1f0de7bf7)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 61f82e0e337f971da57f8f513abfe693edf95aa5)
Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>
|
|
|
|
|
|
| |
invalidating caches (GH-6402) (GH-6403)
An entry of None in sys.path_importer_cache represents a negative/missing finder for a path, so clearing it out makes sense.
(cherry picked from commit 9e2be60634914f23db2ae5624e4acc9335bf5fea)
|
|
|
|
|
| |
(cherry picked from commit 3a9ccee0e5dbf7d67f5ab79f6095755969db117c)
Co-authored-by: Marcel Plch <gmarcel.plch@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 0c1c4563a65ac451021d927058e4f25013934eb2)
Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
|
|
|
|
|
|
| |
when __aenter__() or __aexit__() return non-awaitable object.
(cherry picked from commit a68f2f0578bbf812fa2264d0e0bb388340d6e230)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit aa8e51f5ebb2a71c76059f050de01fc3c985376a)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Historically, -m added the empty string as sys.path
zero, meaning it resolved imports against the current
working directory, the same way -c and the interactive
prompt do.
This changes the sys.path initialisation to add the
*starting* working directory as sys.path[0] instead,
such that changes to the working directory while the
program is running will have no effect on imports
when using the -m switch.
(cherry picked from commit d5d9e02dd3c6df06a8dd9ce75ee9b52976420a8b)
|
|
|
|
|
|
|
|
|
|
|
| |
- new test case for pre-initialization of sys.warnoptions and sys._xoptions
- restored ability to call these APIs prior to Py_Initialize
- updated the docs for the affected APIs to make it clear they can be
called before Py_Initialize
- also enhanced the existing embedding test cases
to check for expected settings in the sys module
(cherry picked from commit bc77eff8b96be4f035e665ab35c1d06e22f46491)
Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
|