Serhiy Storchaka
5e61f14c6d
Issue #12983 : Bytes literals with invalid \x escape now raise a SyntaxError
and a full traceback including line number.
13 years ago
Serhiy Storchaka
f458a03617
Issue #17034 : Use Py_CLEAR() in bytesobject.c.
13 years ago
Serhiy Storchaka
ace3ad3bf7
Issue #16975 : Fix error handling bug in the escape-decode bytes decoder.
13 years ago
Benjamin Peterson
5ff3f73d94
try to call __bytes__ before __index__ ( closes #16722 )
13 years ago
Gregory P. Smith
27cbcd6241
Fix the internals of our hash functions to used unsigned values during hash
computation as the overflow behavior of signed integers is undefined.
In practice we require compiling everything with -fwrapv which forces overflow
to be defined as twos compliment but this keeps the code cleaner for checkers
or in the case where someone has compiled it without -fwrapv or their
compiler's equivalent.
Found by Clang trunk's Undefined Behavior Sanitizer (UBSan).
Cleanup only - no functionality or hash values change.
13 years ago
Stefan Krah
7d12d9df13
Issue #12834 : Fix PyBuffer_ToContiguous() for non-contiguous arrays.
14 years ago
Larry Hastings
ca28e99202
Issue #14889 : PyBytes_FromObject(bytes) now just increfs and returns.
Previously, if you passed in a bytes object, it would create a whole
new object.
14 years ago
Victor Stinner
d0880d57b0
Simplify and optimize formatlong()
* Remove _PyBytes_FormatLong(): inline it into formatlong()
* the input type is always a long, so remove the code for bool
* don't duplicate the string if the length does not change
* Use PyUnicode_DATA() instead of _PyUnicode_AsString()
14 years ago
Victor Stinner
8f825060f1
Check newly created consistency using _PyUnicode_CheckConsistency(str, 1)
* In debug mode, fill the string data with invalid characters
* Simplify also reference counting in PyCodec_BackslashReplaceErrors()
and PyCodec_XMLCharRefReplaceError()
14 years ago
Benjamin Peterson
f6622c8a3e
fix build without Py_DEBUG and DNDEBUG ( closes #14509 )
14 years ago
Antoine Pitrou
a701388de1
Rename _PyIter_GetBuiltin to _PyObject_GetBuiltin, and do not include it in the stable ABI.
14 years ago
Kristján Valur Jónsson
31668b8f7a
Issue #14288 : Serialization support for builtin iterators.
14 years ago
Ezio Melotti
cda6b6d60d
#14081 : The sep and maxsplit parameter to str.split, bytes.split, and bytearray.split may now be passed as keyword arguments.
14 years ago
Benjamin Peterson
69e9727657
ensure no one tries to hash things before the random seed is found
14 years ago
Georg Brandl
2daf6ae249
Issue #13703 : add a way to randomize the hash values of basic types (str, bytes, datetime)
in order to make algorithmic complexity attacks on (e.g.) web apps much more complicated.
The environment variable PYTHONHASHSEED and the new command line flag -R control this
behavior.
14 years ago
Georg Brandl
beca27a394
Fix #13834 : strip() strips leading and trailing whitespace.
14 years ago
Gregory P. Smith
63e6c3222f
Consolidate the occurrances of the prime used as the multiplier when hashing
to a single #define instead of having several copies in several files.
This excludes the Modules/ tree (datetime and expat both have a copy
for their own purposes with no need for it to be the same).
14 years ago
Victor Stinner
bb2e9c477d
Issue #11231 : Fix bytes and bytearray docstrings
Patch written by Brice Berna.
14 years ago
Antoine Pitrou
ce4a9da705
Issue #13411 : memoryview objects are now hashable when the underlying object is hashable.
14 years ago
Victor Stinner
9e30aa52fd
Fix misuse of PyUnicode_GET_SIZE() => PyUnicode_GET_LENGTH()
And PyUnicode_GetSize() => PyUnicode_GetLength()
14 years ago
Antoine Pitrou
ac65d96777
Issue #12170 : The count(), find(), rfind(), index() and rindex() methods
of bytes and bytearray objects now accept an integer between 0 and 255
as their first argument. Patch by Petri Lehtinen.
14 years ago
Victor Stinner
f5cff56a1b
Issue #13088 : Add shared Py_hexdigits constant to format a number into base 16
14 years ago
Victor Stinner
6430fd56b4
Fix hex_digit_to_int() prototype: expect Py_UCS4, not Py_UNICODE
14 years ago
Martin v. Löwis
d63a3b8beb
Implement PEP 393.
14 years ago
Mark Dickinson
57e683e53e
Issue #1621 : Fix undefined behaviour in bytes.__hash__, str.__hash__, tuple.__hash__, frozenset.__hash__ and set indexing operations.
14 years ago
Mark Dickinson
0d5f6adbb3
Issue #13012 : Allow 'keepends' to be passed as a keyword argument in str.splitlines, bytes.splitlines and bytearray.splitlines.
14 years ago
Senthil Kumaran
53516a82df
Fix closes Issue12621 - Fix docstrings of find and rfind methods of bytes/bytearry/unicodeobject.
15 years ago
Ezio Melotti
ba42fd5801
#6780 : fix starts/endswith error message to mention that tuples are accepted too.
15 years ago
Jesus Cea
ac4515063c
startswith and endswith don't accept None as slice index. Patch by Torsten Becker. ( closes #11828 )
15 years ago
Eli Bendersky
1aef6b6e1e
Issue #11634 : Remove misleading paragraph from a comment
15 years ago
Ezio Melotti
42da663e6f
#11515 : fix several typos. Patch by Piotr Kasprzyk.
15 years ago
Benjamin Peterson
28a4dce6a8
remove (un)transform methods
15 years ago
Martin v. Löwis
4d0d471a80
Merge branches/pep-0384.
15 years ago
Georg Brandl
02524629f3
#7475 : add (un)transform method to bytes/bytearray and str, add back codecs that can be used with them from Python 2.
15 years ago
Victor Stinner
c911bbfd5d
str, bytes, bytearray docstring: remove unnecessary [...]
15 years ago
Victor Stinner
e14e212221
Fix encode/decode method doc of str, bytes, bytearray types
* Specify the default encoding: write 'utf-8' instead of
sys.getdefaultencoding(), because the default encoding is now constant
* Specify the default errors value
15 years ago
David Malcolm
9696088b6d
Issue #10288 : The deprecated family of "char"-handling macros
(ISLOWER()/ISUPPER()/etc) have now been removed: use Py_ISLOWER() etc
instead.
15 years ago
Benjamin Peterson
8f67d0893f
make hashes always the size of pointers; introduce Py_hash_t #9778
15 years ago
Senthil Kumaran
f77342076e
Merged revisions 84629 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r84629 | senthil.kumaran | 2010-09-08 18:20:29 +0530 (Wed, 08 Sep 2010) | 3 lines
Revert the doc change done in r83880. str.replace with negative count value is not a feature.
........
16 years ago
Senthil Kumaran
9a9dd1c140
Revert the doc change done in r83880. str.replace with negative count value is not a feature.
16 years ago
Antoine Pitrou
bc760d9f45
Merged revisions 84070,84074 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r84070 | antoine.pitrou | 2010-08-15 19:12:55 +0200 (dim., 15 août 2010) | 5 lines
Fix some compilation warnings under 64-bit Windows (issue #9566 ).
Some of these are genuine bugs with objects bigger than 2GB, but
my system doesn't allow me to write tests for it.
........
r84074 | antoine.pitrou | 2010-08-15 19:41:31 +0200 (dim., 15 août 2010) | 3 lines
Fix (harmless) warning with MSVC.
........
16 years ago
Antoine Pitrou
0010d37a43
Fix some compilation warnings under 64-bit Windows (issue #9566 ).
Some of these are genuine bugs with objects bigger than 2GB, but
my system doesn't allow me to write tests for it.
16 years ago
Alexander Belopolsky
f0f45142d5
Issue #2443 : Added a new macro, Py_VA_COPY, which is equivalent to C99
va_copy, but available on all python platforms. Untabified a few
unrelated files.
16 years ago
Mark Dickinson
cf940c701f
Issue #9530 : Fix undefined-behaviour-inducing overflow checks in bytes and bytearray implementations.
16 years ago
Senthil Kumaran
c3ce882c75
Merged revisions 83882 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r83882 | senthil.kumaran | 2010-08-09 14:33:57 +0530 (Mon, 09 Aug 2010) | 3 lines
spelling mistake.
........
16 years ago
Senthil Kumaran
f2de1ffc88
spelling mistake.
16 years ago
Senthil Kumaran
a3aee53776
Merged revisions 83880 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r83880 | senthil.kumaran | 2010-08-09 14:26:25 +0530 (Mon, 09 Aug 2010) | 3 lines
Fix Issue5416 - explain negative value for count in bytes object replace.
........
16 years ago
Senthil Kumaran
77210b4fa9
Fix Issue5416 - explain negative value for count in bytes object replace.
16 years ago
Antoine Pitrou
a57aae7d47
Merged revisions 81862 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r81862 | antoine.pitrou | 2010-06-09 18:38:55 +0200 (mer., 09 juin 2010) | 9 lines
Merged revisions 81860 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81860 | antoine.pitrou | 2010-06-09 18:24:00 +0200 (mer., 09 juin 2010) | 3 lines
Issue #8930 : fix some C code indentation
........
................
16 years ago
Antoine Pitrou
d118856049
Merged revisions 81860 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r81860 | antoine.pitrou | 2010-06-09 18:24:00 +0200 (mer., 09 juin 2010) | 3 lines
Issue #8930 : fix some C code indentation
........
16 years ago