Christian Heimes
f051e43b22
Issue #28126 : Replace Py_MEMCPY with memcpy(). Visual Studio can properly optimize memcpy().
9 years ago
Benjamin Peterson
621b430a14
remove all usage of Py_LOCAL
9 years ago
Benjamin Peterson
33d2a492d0
promote some shifts to unsigned, so as not to invoke undefined behavior
9 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.
9 years ago
Steve Dower
cc16be85c0
Issue #27781 : Change file system encoding on Windows to UTF-8 (PEP 529)
9 years ago
Benjamin Peterson
47ff0734b8
more PY_LONG_LONG to long long
9 years ago
Benjamin Peterson
2e7c5e9c11
replace some Py_LOCAL_INLINE with the inline keyword
9 years ago
Brett Cannon
a571120410
Issue #27182 : Add support for path-like objects to PyUnicode_FSDecoder().
9 years ago
Victor Stinner
62ec3317d2
Optimize unicode_escape and raw_unicode_escape
Issue #16334 . Patch written by Serhiy Storchaka.
9 years ago
Victor Stinner
2740e46089
_PyUnicodeWriter: assert that max character <= MAX_UNICODE
9 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.
9 years ago
Benjamin Peterson
9b3d77052f
replace Python aliases for standard integer types with the standard integer types ( #17884 )
9 years ago
Serhiy Storchaka
ea525a2d1a
Issue #27078 : Added BUILD_STRING opcode. Optimized f-strings evaluation.
9 years ago
Benjamin Peterson
af580dff4a
replace PY_LONG_LONG with long long
9 years ago
Benjamin Peterson
ed4aa83ff7
require a long long data type ( closes #27961 )
9 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
9 years ago
Victor Stinner
1a05d6c04d
PEP 7 style for if/else in C
Add also a newline for readability in normalize_encoding().
9 years ago
Raymond Hettinger
15f44ab043
Issue #27895 : Spelling fixes (Contributed by Ville Skyttä).
9 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
Benjamin Peterson
a4d33b3428
make the PyUnicode_FSConverter cleanup set the decrefed argument to NULL ( closes #25630 )
10 years ago
Serhiy Storchaka
413fdcea21
Issue #24821 : Refactor STRINGLIB(fastsearch_memchr_1char) and split it on
STRINGLIB(find_char) and STRINGLIB(rfind_char) that can be used independedly
without special preconditions.
10 years ago
Serhiy Storchaka
d65c9496da
Issue #25523 : Further a-to-an corrections.
10 years ago
Victor Stinner
358af13526
Issue #25353 : Optimize unicode escape and raw unicode escape encoders to use
the new _PyBytesWriter API.
10 years ago
Victor Stinner
6c2cdae9e6
Writer APIs: use empty string singletons
Modify _PyBytesWriter_Finish() and _PyUnicodeWriter_Finish() to return the
empty bytes/Unicode string if the string is empty.
10 years ago
Victor Stinner
6bd525b656
Optimize error handlers of ASCII and Latin1 encoders when the replacement
string is pure ASCII: use _PyBytesWriter_WriteBytes(), don't check individual
character.
Cleanup unicode_encode_ucs1():
* Rename repunicode to rep
* Clear rep object on error
* Factorize code between bytes and unicode path
10 years ago
Victor Stinner
ce179bf6ba
Add _PyBytesWriter_WriteBytes() to factorize the code
10 years ago
Victor Stinner
ad7715891e
_PyBytesWriter: simplify code to avoid "prealloc" parameters
Substract preallocate bytes from min_size before calling
_PyBytesWriter_Prepare().
10 years ago
Victor Stinner
3fa36ff5e4
Issue #25318 : Fix backslashreplace()
Fix code to estimate the needed space.
10 years ago
Victor Stinner
797485e101
Issue #25318 : Avoid sprintf() in backslashreplace()
Rewrite backslashreplace() to be closer to PyCodec_BackslashReplaceErrors().
Add also unit tests for non-BMP characters.
10 years ago
Victor Stinner
0016507c16
Issue #25318 : Move _PyBytesWriter to bytesobject.c
Declare also the private API in bytesobject.h.
10 years ago