Miss Islington (bot)
310b424c47
bpo-32827: Fix usage of _PyUnicodeWriter_Prepare() in decoding errors handler. (GH-5636)
...
(cherry picked from commit b7e2d67f7c )
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-02-13 01:32:46 -08:00
Xiang Zhang
ea94fce696
[3.6] bpo-32583: Fix possible crashing in builtin Unicode decoders (GH-5325) ( #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 2c7fd46e11 )
2018-01-31 21:34:17 +08:00
Miss Islington (bot)
d7274c6638
Fix wrong assert in unicodeobject (GH-5340)
...
(cherry picked from commit 7cc95f5069 )
2018-01-28 02:41:24 +09:00
Victor Stinner
b92c159efa
[3.6] bpo-32555: Fix locale encodings ( #5193 )
...
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.
2018-01-15 23:43:24 +01:00
Miss Islington (bot)
1e78ed6825
bpo-31825: Fixed OverflowError in the 'unicode-escape' codec (GH-4058) ( #4059 )
...
and in codecs.escape_decode() when decode an escaped non-ascii byte.
(cherry picked from commit 56cb465cc9 )
2017-10-20 17:41:29 +03:00
Victor Stinner
c0e77364ca
[3.6] bpo-30923: Silence fall-through warnings included in -Wextra since gcc-7.0 ( #3518 )
...
* bpo-30923: Disable warning that has been part of -Wextra since gcc-7.0. (#3142 )
(cherry picked from commit d73a960c57 )
* bpo-30923: Silence fall-through warnings included in -Wextra since gcc-7.0. (#3157 )
(cherry picked from commit f432a3234f )
* bpo-31275: Small refactoring to silence a fall-through warning. (#3206 )
(cherry picked from commit 138753c1b9 )
2017-09-12 16:09:44 -07:00
Serhiy Storchaka
ddb536ba7b
[3.6] bpo-31393: Fix the use of PyUnicode_READY(). (GH-3451). ( #3453 )
...
(cherry picked from commit e3b2b4b8d9 )
2017-09-08 10:43:54 +03:00
Serhiy Storchaka
82a9075600
[3.6] bpo-22207: Add checks for possible integer overflows in unicodeobject.c. (GH-2623) ( #2658 )
...
Based on patch by Victor Stinner.
(cherry picked from commit 64e461b )
2017-07-11 07:27:56 +03:00
Serhiy Storchaka
0834905d9b
[3.6] bpo-13617: Reject embedded null characters in wchar* strings. (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 f7eae0adfc )
2017-06-28 09:27:35 +03:00
Serhiy Storchaka
0edffa3073
[3.6] bpo-30708: Check for null characters in PyUnicode_AsWideCharString(). (GH-2285) ( #2443 )
...
Raise a ValueError if the second argument is NULL and the wchar_t\*
string contains null characters..
(cherry picked from commit e613e6add5 )
2017-06-27 21:08:58 +03:00
Serhiy Storchaka
7a113a0cbf
bpo-29802: Fix the cleaning up issue in PyUnicode_FSDecoder(). ( #1217 )
2017-04-20 22:55:06 +03:00
Mariatta
577fc04a71
[3.6] bpo-29549: Fixes docstring for str.index (GH-256) (GH-1028)
...
(cherry picked from commit 43ba8861e0 )
2017-04-09 15:17:06 -07:00
Serhiy Storchaka
c26b19d5c7
Expand the PySlice_GetIndicesEx macro. ( #1023 ) ( #1044 )
...
(cherry picked from commit b879fe82e7 )
2017-04-08 11:18:14 +03:00
Xiang Zhang
95403d74d7
Issue #29145 : Merge 3.5.
2017-01-10 10:54:19 +08:00
Xiang Zhang
b0541f4cdf
Issue #29145 : Fix overflow checks in str.replace() and str.join().
...
Based on patch by Martin Panter.
2017-01-10 10:52:00 +08:00
Xiang Zhang
437a5d2c25
Issue #29044 : Merge 3.5.
2016-12-22 15:31:22 +08:00
Xiang Zhang
ea1cf87030
Issue #29044 : Fix a use-after-free in string '%c' formatter.
2016-12-22 15:30:47 +08:00
Xavier de Gaye
76febd0792
Issue #26919 : On Android, operating system data is now always encoded/decoded
...
to/from UTF-8, instead of the locale encoding to avoid inconsistencies with
os.fsencode() and os.fsdecode() which are already using UTF-8.
2016-12-15 20:59:58 +01:00
Serhiy Storchaka
419967b832
Issue #28808 : PyUnicode_CompareWithASCIIString() now never raises exceptions.
2016-12-06 00:13:34 +02:00
Serhiy Storchaka
9a953dbb34
Issue #28808 : PyUnicode_CompareWithASCIIString() now never raises exceptions.
2016-12-06 00:17:45 +02:00
Serhiy Storchaka
ac0720eaa4
Issue #28760 : Clean up and fix comments in PyUnicode_AsUnicodeEscapeString().
...
Patch by Xiang Zhang.
2016-11-21 11:46:51 +02:00
Serhiy Storchaka
a83a6a3275
Issue #28701 : _PyUnicode_EqualToASCIIId and _PyUnicode_EqualToASCIIString now
...
require ASCII right argument and assert this condition in debug build.
2016-11-16 20:02:44 +02:00
Serhiy Storchaka
df66b9c425
Fixed an off-by-one error in _PyUnicode_EqualToASCIIString (issue #28701 ).
2016-11-16 16:12:56 +02:00
Serhiy Storchaka
292dd1b2ad
Fixed an off-by-one error in _PyUnicode_EqualToASCIIString (issue #28701 ).
2016-11-16 16:12:34 +02:00
Serhiy Storchaka
dddec81b2d
Issue #21449 : Removed private function _PyUnicode_CompareWithId.
2016-11-16 15:56:27 +02:00
Serhiy Storchaka
fab6acd9f5
Issue #28701 : Replace _PyUnicode_CompareWithId with _PyUnicode_EqualToASCIIId.
...
The latter function is more readable, faster and doesn't raise exceptions.
Based on patch by Xiang Zhang.
2016-11-16 15:41:11 +02:00
Serhiy Storchaka
f5894dd646
Issue #28701 : Replace _PyUnicode_CompareWithId with _PyUnicode_EqualToASCIIId.
...
The latter function is more readable, faster and doesn't raise exceptions.
Based on patch by Xiang Zhang.
2016-11-16 15:40:39 +02:00
Serhiy Storchaka
3b73ea1278
Issue #28701 : Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString.
...
The latter function is more readable, faster and doesn't raise exceptions.
2016-11-16 10:19:20 +02:00
Serhiy Storchaka
f4934ea77d
Issue #28701 : Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString.
...
The latter function is more readable, faster and doesn't raise exceptions.
2016-11-16 10:17:58 +02:00
Serhiy Storchaka
babe4f8e5e
Issue #28648 : Fixed crash in Py_DecodeLocale() in debug build on Mac OS X
...
when decode astral characters.
2016-11-12 14:36:02 +02:00
Serhiy Storchaka
6b4b6e956e
Issue #28648 : Fixed crash in Py_DecodeLocale() in debug build on Mac OS X
...
when decode astral characters.
2016-11-12 14:35:46 +02:00
Serhiy Storchaka
84293aff9f
Issue #28648 : Fixed crash in Py_DecodeLocale() in debug build on Mac OS X
...
when decode astral characters.
2016-11-12 14:29:48 +02:00
Serhiy Storchaka
b626643734
Issue #28648 : Fixed crash in Py_DecodeLocale() in debug build on Mac OS X
...
when decode astral characters.
2016-11-12 14:28:06 +02:00
Steve Dower
78057b4159
Closes #27781 : Removes special cases for the experimental aspect of PEP 529
2016-11-06 19:35:08 -08:00
Eric V. Smith
5646648678
Issue 28128: Print out better error/warning messages for invalid string escapes. Backport to 3.6.
2016-10-31 14:46:26 -04:00
Serhiy Storchaka
0093907f0e
Issue #28426 : Deprecated undocumented functions PyUnicode_AsEncodedObject(),
...
PyUnicode_AsDecodedObject(), PyUnicode_AsDecodedUnicode() and
PyUnicode_AsEncodedUnicode().
2016-10-27 21:05:49 +03:00
Serhiy Storchaka
c8bc3d1c07
Issue #28408 : Fixed a leak and remove redundant code in _PyUnicodeWriter_Finish().
...
Patch by Xiang Zhang.
2016-10-25 13:23:56 +03:00
Serhiy Storchaka
c4a3e90aa8
Issue #28426 : Fixed potential crash in PyUnicode_AsDecodedObject() in debug build.
2016-10-25 10:17:33 +03:00
Serhiy Storchaka
839023f12c
Issue #28426 : Fixed potential crash in PyUnicode_AsDecodedObject() in debug build.
2016-10-25 10:13:43 +03:00
Serhiy Storchaka
77eede35fc
Issue #28426 : Fixed potential crash in PyUnicode_AsDecodedObject() in debug build.
2016-10-25 10:07:51 +03:00
Serhiy Storchaka
467ab194fc
Issue #28410 : Added _PyErr_FormatFromCause() -- the helper for raising
...
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]
2016-10-21 17:09:17 +03:00
Benjamin Peterson
3aa75528a1
merge 3.5 ( #28454 )
2016-10-16 15:42:24 -07:00
Benjamin Peterson
8d761ff045
remove extra PyErr_Format arguments ( closes #28454 )
...
Patch from Xiang Zhang.
2016-10-16 15:41:46 -07:00
Victor Stinner
ebe17e0347
Fix _Py_normalize_encoding() command
...
It's not exactly the same than encodings.normalize_encoding(): the C function
also converts to lowercase.
2016-10-12 13:57:45 +02:00
Benjamin Peterson
b329e1bb5b
va_end vargs2 once ( closes #28417 )
2016-10-11 23:00:58 -07:00
Serhiy Storchaka
21d9f10c94
Merge from 3.5.
2016-10-08 22:46:01 +03:00
Serhiy Storchaka
9c0e1f83af
Issue #28379 : Added sanity checks and tests for PyUnicode_CopyCharacters().
...
Patch by Xiang Zhang.
2016-10-08 22:45:38 +03:00
Victor Stinner
44f4874e68
Merge 3.5
2016-09-21 14:13:53 +02:00
Victor Stinner
1ddf53d496
Fix PyUnicode_FromFormatV() error handling
...
Issue #28233 : Fix a memory leak if the format string contains a non-ASCII
character, destroy the unicode writer.
2016-09-21 14:13:14 +02:00
Christian Heimes
2f2fee19ec
va_end() all va_copy()ed va_lists.
2016-09-21 11:37:27 +02:00