| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
Fix an assertion error in format() in debug build for floating point
formatting with "n" format, zero padding and small width. Release build is
not impacted. Patch by Karthikeyan Singaravelan.
(cherry picked from commit 3f7983a25a3d19779283c707fbdd5bc91b1587ef)
Co-authored-by: Xtreak <tir.karthi@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit 4013c179117754b039957db4730880bf3285919d)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
| |
Copy code from master: add assertions on start and value, replace 'i'
iterator with 'end' pointer for the loop stop condition.
_PyUnicode_FastFill(): fix type of 'data', it must not be constant,
since data is modified by FILL().
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-10720)
Fix str.format(), float.__format__() and complex.__format__() methods
for non-ASCII decimal point when using the "n" formatter.
Rewrite _PyUnicode_InsertThousandsGrouping(): it now requires
a _PyUnicodeWriter object for the buffer and a Python str object
for digits.
(cherry picked from commit 59423e3ddd736387cef8f7632c71954c1859bed0)
(cherry picked from commit 6f5fa1b4be735159e964906ab608dc467476e47c)
|
| |
|
|
|
|
|
|
|
| |
Discovered using clang's MemorySanitizer when it ran python3's
test_fstring test_misformed_unicode_character_name.
An msan build will fail by simply executing: ./python -c 'u"\N"'
(cherry picked from commit 746b2d35ea47005054ed774fecaed64fab803d7d)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
| |
|
|
|
|
| |
Reported by Svace static analyzer.
(cherry picked from commit 74a307d48ef8b278c4629ca0ef2139be1c9a34e6)
Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
|
| |
|
|
|
|
|
| |
handler. (GH-5636)
(cherry picked from commit b7e2d67f7c035f09c921ca4e7a36529cd502ccf7)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
| |
(#5459)
When using customized decode error handlers, it is possible for builtin decoders
to write out-of-bounds and then crash..
(cherry picked from commit 2c7fd46e11333ef5e5cce34212f7d087694f3658)
|
| |
|
| |
(cherry picked from commit 7cc95f5069c8983afb8a55928db6956abe2d5afa)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
and in codecs.escape_decode() when decode an escaped non-ascii byte.
(cherry picked from commit 56cb465cc93dcb35aaf7266ca3dbe2dcff1fac5f)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
| |
|
| |
(cherry picked from commit e3b2b4b8d9e751b49e3550cb83ba39b54fdc377c)
|
| |
|
|
|
|
| |
unicodeobject.c. (GH-2623) (#2658)
Based on patch by Victor Stinner.
(cherry picked from commit 64e461b)
|
| |
|
|
|
|
|
|
|
|
| |
(GH-2302) (#2462)
Based on patch by Victor Stinner.
Add private C API function _PyUnicode_AsUnicode() which is similar to
PyUnicode_AsUnicode(), but checks for null characters..
(cherry picked from commit f7eae0adfcd4c50034281b2c69f461b43b68db84)
|
| |
|
|
|
|
|
| |
(GH-2285) (#2443)
Raise a ValueError if the second argument is NULL and the wchar_t\*
string contains null characters..
(cherry picked from commit e613e6add5f07ff6aad5802924596b631b707d2a)
|
| | |
|
| |
|
| |
(cherry picked from commit 43ba8861e0ad044efafa46a7cc04e12ac5df640e)
|
| |
|
| |
(cherry picked from commit b879fe82e7e5c3f7673c9a7fa4aad42bd05445d8)
|
| |\ |
|
| | |
| |
| |
| | |
Based on patch by Martin Panter.
|
| |\ \
| |/ |
|
| | | |
|
| | |
| |
| |
| |
| | |
to/from UTF-8, instead of the locale encoding to avoid inconsistencies with
os.fsencode() and os.fsdecode() which are already using UTF-8.
|
| |\ \
| |/ |
|
| | | |
|
| | |
| |
| |
| | |
Patch by Xiang Zhang.
|
| | |
| |
| |
| | |
require ASCII right argument and assert this condition in debug build.
|
| |\ \
| |/ |
|
| | | |
|
| | | |
|
| |\ \
| |/
| |
| |
| |
| | |
The latter function is more readable, faster and doesn't raise exceptions.
Based on patch by Xiang Zhang.
|
| | |
| |
| |
| |
| |
| | |
The latter function is more readable, faster and doesn't raise exceptions.
Based on patch by Xiang Zhang.
|
| |\ \
| |/
| |
| |
| |
| | |
_PyUnicode_EqualToASCIIString.
The latter function is more readable, faster and doesn't raise exceptions.
|
| | |
| |
| |
| |
| |
| | |
_PyUnicode_EqualToASCIIString.
The latter function is more readable, faster and doesn't raise exceptions.
|
| |\ \
| |/
| |
| | |
when decode astral characters.
|
| | |\
| | |
| | |
| | | |
when decode astral characters.
|
| | | |\
| | | |
| | | |
| | | | |
when decode astral characters.
|
| | | | |
| | | |
| | | |
| | | | |
when decode astral characters.
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | |
| | | |
| | | | |
escapes. Backport to 3.6.
|
| | | | |
| | | |
| | | |
| | | |
| | | | |
PyUnicode_AsDecodedObject(), PyUnicode_AsDecodedUnicode() and
PyUnicode_AsEncodedUnicode().
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
_PyUnicodeWriter_Finish().
Patch by Xiang Zhang.
|
| |\ \ \ \
| |/ / /
| | | |
| | | | |
build.
|
| | |\ \ \
| | |/ /
| | | |
| | | | |
build.
|
| | | | |
| | | |
| | | |
| | | | |
build.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
new exception with setting current exception as __cause__.
_PyErr_FormatFromCause(exception, format, args...) is equivalent to Python
raise exception(format % args) from sys.exc_info()[1]
|
| |\ \ \ \
| |/ / / |
|
| | | | |
| | | |
| | | |
| | | | |
Patch from Xiang Zhang.
|