Serhiy Storchaka
f8d7d41507
Issue #28511 : Use the "U" format instead of "O!" in PyArg_Parse*.
9 years ago
Serhiy Storchaka
523c449ca0
Issue #28504 : Cleanup unicode_decode_call_errorhandler_wchar/writer.
Patch by Xiang Zhang.
9 years ago
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]
9 years ago
Benjamin Peterson
8d761ff045
remove extra PyErr_Format arguments ( closes #28454 )
Patch from Xiang Zhang.
9 years ago
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.
9 years ago
Benjamin Peterson
b329e1bb5b
va_end vargs2 once ( closes #28417 )
9 years ago
Serhiy Storchaka
2e58f1a52a
Issue #28400 : Removed uncessary checks in unicode_char and resize_copy.
1. In resize_copy we don't need to PyUnicode_READY(unicode) since when
it's not PyUnicode_WCHAR_KIND it should be ready.
2. In unicode_char, PyUnicode_1BYTE_KIND is handled by get_latin1_char.
Patch by Xiang Zhang.
9 years ago
Serhiy Storchaka
9c0e1f83af
Issue #28379 : Added sanity checks and tests for PyUnicode_CopyCharacters().
Patch by Xiang Zhang.
9 years ago
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.
10 years ago
Christian Heimes
2f2fee19ec
va_end() all va_copy()ed va_lists.
10 years ago
Benjamin Peterson
0c21214f3e
replace usage of Py_VA_COPY with the (C99) standard va_copy
10 years ago
Christian Heimes
f051e43b22
Issue #28126 : Replace Py_MEMCPY with memcpy(). Visual Studio can properly optimize memcpy().
10 years ago
Benjamin Peterson
621b430a14
remove all usage of Py_LOCAL
10 years ago
Benjamin Peterson
33d2a492d0
promote some shifts to unsigned, so as not to invoke undefined behavior
10 years ago
R David Murray
110b6fecbb
#27364 : Deprecate invalid escape strings in str/byutes.
Patch by Emanuel Barry, reviewed by Serhiy Storchaka and Martin Panter.
10 years ago
Steve Dower
cc16be85c0
Issue #27781 : Change file system encoding on Windows to UTF-8 (PEP 529)
10 years ago
Benjamin Peterson
47ff0734b8
more PY_LONG_LONG to long long
10 years ago
Benjamin Peterson
2e7c5e9c11
replace some Py_LOCAL_INLINE with the inline keyword
10 years ago
Brett Cannon
a571120410
Issue #27182 : Add support for path-like objects to PyUnicode_FSDecoder().
10 years ago
Victor Stinner
62ec3317d2
Optimize unicode_escape and raw_unicode_escape
Issue #16334 . Patch written by Serhiy Storchaka.
10 years ago
Victor Stinner
2740e46089
_PyUnicodeWriter: assert that max character <= MAX_UNICODE
10 years ago
Brett Cannon
ec6ce879c7
Issue #26027 : Support path-like objects in PyUnicode-FSConverter().
This is to add support for os.exec*() and os.spawn*() functions. Part
of PEP 519.
10 years ago
Benjamin Peterson
9b3d77052f
replace Python aliases for standard integer types with the standard integer types ( #17884 )
10 years ago
Serhiy Storchaka
ea525a2d1a
Issue #27078 : Added BUILD_STRING opcode. Optimized f-strings evaluation.
10 years ago
Benjamin Peterson
af580dff4a
replace PY_LONG_LONG with long long
10 years ago
Benjamin Peterson
ed4aa83ff7
require a long long data type ( closes #27961 )
10 years ago
Victor Stinner
942889aae2
Issue #27938 : Add a fast-path for us-ascii encoding
Other changes:
* Rewrite _Py_normalize_encoding() as a C implementation of
encodings.normalize_encoding(). For example, " utf-8 " is now normalized to
"utf_8". So the fast path is now used for more name variants of the same
encoding.
* Avoid strcpy() when encoding is NULL: call directly the UTF-8 codec
10 years ago
Victor Stinner
1a05d6c04d
PEP 7 style for if/else in C
Add also a newline for readability in normalize_encoding().
10 years ago
Raymond Hettinger
15f44ab043
Issue #27895 : Spelling fixes (Contributed by Ville Skyttä).
10 years ago
Serhiy Storchaka
febc332056
Issue #26754 : Undocumented support of general bytes-like objects
as path in compile() and similar functions is now deprecated.
10 years ago
Berker Peksag
ced8d4c6eb
Issue #27454 : Use PyDict_SetDefault in PyUnicode_InternInPlace
Patch by INADA Naoki.
10 years ago
Serhiy Storchaka
9305d83425
Issue #26754 : PyUnicode_FSDecoder() accepted a filename argument encoded as
an iterable of integers. Now only strings and byte-like objects are accepted.
10 years ago
Martin Panter
e26da7c03a
Issue #27171 : Fix typos in documentation, comments, and test function names
10 years ago
Serhiy Storchaka
dd40fc3e57
Issue #26765 : Moved common code and docstrings for bytes and bytearray methods
to bytes_methods.c.
10 years ago
Martin Panter
6245cb3c01
Correct “an” → “a” with “Unicode”, “user”, “UTF”, etc
This affects documentation, code comments, and a debugging messages.
10 years ago
Serhiy Storchaka
21a663ea28
Issue #26057 : Got rid of nonneeded use of PyUnicode_FromObject().
10 years ago
Serhiy Storchaka
57a01d3a0e
Issue #26200 : Added Py_SETREF and replaced Py_XSETREF with Py_SETREF
in places where Py_DECREF was used.
10 years ago
Serhiy Storchaka
48842714b9
Issue #22570 : Renamed Py_SETREF to Py_XSETREF.
10 years ago
Serhiy Storchaka
fbb1c5ee06
Issue #26494 : Fixed crash on iterating exhausting iterators.
Affected classes are generic sequence iterators, iterators of str, bytes,
bytearray, list, tuple, set, frozenset, dict, OrderedDict, corresponding
views and os.scandir() iterator.
10 years ago
Victor Stinner
337986740f
Issue #26464 : Fix unicode_fast_translate() again
Initialize i variable if the string is non-ASCII.
10 years ago
Victor Stinner
6c9aa8f2bf
Fix str.translate()
Issue #26464 : Fix str.translate() when string is ASCII and first replacements
removes character, but next replacement uses a non-ASCII character or a string
longer than 1 character. Regression introduced in Python 3.5.0.
10 years ago
Victor Stinner
5bc03a6d4d
Fix resize_compact()
Issue #26217 : resize_compact() must set wstr_length to 0 after freeing the wstr
string. Otherwise, an assertion fails in _PyUnicode_CheckConsistency().
10 years ago
Serhiy Storchaka
191321d11b
Issue #20440 : More use of Py_SETREF.
This patch is manually crafted and contains changes that couldn't be handled
automatically.
10 years ago
Serhiy Storchaka
ef1585eb9a
Issue #25923 : Added more const qualifiers to signatures of static and private functions.
10 years ago
Serhiy Storchaka
2d06e84455
Issue #25923 : Added the const qualifier to static constant arrays.
10 years ago
Serhiy Storchaka
5a57ade58e
Issue #20440 : Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
10 years ago
Serhiy Storchaka
9b3a2eec1c
Issues #25890 , #25891 , #25892 : Removed unused variables in Windows code.
Reported by Alexander Riccio.
10 years ago
Serhiy Storchaka
31b9410654
Issue #25709 : Fixed problem with in-place string concatenation and utf-8 cache.
10 years ago
Serhiy Storchaka
e800941d66
Issue #25709 : Fixed problem with in-place string concatenation and utf-8 cache.
10 years ago
Serhiy Storchaka
7aa690860e
Issue #25709 : Fixed problem with in-place string concatenation and utf-8 cache.
10 years ago