Commit graph

4384 commits

Author SHA1 Message Date
Victor Stinner
6c7a52a46f Check for PyUnicode_CopyCharacters() failure 2011-09-28 21:39:17 +02:00
Victor Stinner
be78eaf2de PyUnicode_CopyCharacters() checks for buffer and character overflow
It now returns the number of written characters on success.
2011-09-28 21:37:03 +02:00
Victor Stinner
fb5f5f2420 Mark PyUnicode_CONVERT_BYTES as private 2011-09-28 21:39:49 +02:00
Georg Brandl
4cb0de246c Rename new macros to conform to naming rules (function macros have "Py" prefix, not "PY"). 2011-09-28 21:49:49 +02:00
Benjamin Peterson
9c6e6a0c7f don't check that the first character is XID_Continue
Current, XID_Continue is a superset of XID_Start, but that may sometime change.
2011-09-28 08:09:05 -04:00
Martin v. Löwis
d63a3b8beb Implement PEP 393. 2011-09-28 07:41:54 +02:00
Mark Dickinson
c7d93b7614 Issue #1621: Fix undefined behaviour from signed overflow in datetime module hashes, array and list iterations, and get_integer (stringlib/string_format.h) 2011-09-25 15:34:32 +01:00
Mark Dickinson
36f27c995a Issue #1621: Fix undefined behaviour from signed overflow in get_integer (stringlib/formatter.h) 2011-09-24 19:11:53 +01:00
Mark Dickinson
57e683e53e Issue #1621: Fix undefined behaviour in bytes.__hash__, str.__hash__, tuple.__hash__, frozenset.__hash__ and set indexing operations. 2011-09-24 18:18:40 +01:00
Mark Dickinson
0d5f6adbb3 Issue #13012: Allow 'keepends' to be passed as a keyword argument in str.splitlines, bytes.splitlines and bytearray.splitlines. 2011-09-24 09:14:39 +01:00
Mark Dickinson
8f53d092f2 Merge issue #12973 list_repeat fix. 2011-09-19 19:19:50 +01:00
Mark Dickinson
c0420fd42a Issue #12973: Fix undefined-behaviour-inducing overflow check in list_repeat. 2011-09-19 19:18:37 +01:00
Stefan Krah
2d78a87e2e Merge fix for issue #12963. 2011-09-12 16:24:48 +02:00
Stefan Krah
b77c6c65c0 Issue #12963: PyLong_AsSize_t() now returns (size_t)-1 in all error cases. 2011-09-12 16:22:47 +02:00
Nadeem Vawda
3d5881ec2b Issue #12909: Make PyLong_As* functions consistent in their use of exceptions.
PyLong_AsDouble() and PyLong_AsUnsignedLongLong() now raise TypeError (rather
than SystemError) when passed a non-integer argument, matching the behavior of
all the other PyLong_As*() functions.
2011-09-07 21:40:26 +02:00
Victor Stinner
f955eb210f Merge 3.2: Fix PyUnicode_AsWideCharString() doc
- Fix PyUnicode_AsWideCharString() doc: size doesn't contain the null
   character
 - Fix spelling of the null character
2011-09-06 02:01:29 +02:00
Victor Stinner
d88d9836c5 Fix PyUnicode_AsWideCharString() doc: size doesn't contain the null character
Fix also spelling of the null character.
2011-09-06 02:00:05 +02:00
Benjamin Peterson
e35dc5110f merge 3.2 2011-09-01 16:33:56 -04:00
Benjamin Peterson
eff61f6927 make sure to initialize the method wrapper type 2011-09-01 16:32:31 -04:00
Ezio Melotti
6f2a683a0c #9200: merge with 3.2. 2011-08-22 20:31:11 +03:00
Ezio Melotti
93e7afc5d9 #9200: The str.is* methods now work with strings that contain non-BMP characters even in narrow Unicode builds. 2011-08-22 14:08:38 +03:00
Antoine Pitrou
8fd544ffa9 Issue #12791: Break reference cycles early when a generator exits with an exception. 2011-08-20 14:18:25 +02:00
Antoine Pitrou
a370fcf3b2 Issue #12791: Break reference cycles early when a generator exits with an exception. 2011-08-20 14:15:03 +02:00
Benjamin Peterson
e518d4c18a merge 3.2 2011-08-18 13:52:19 -05:00
Benjamin Peterson
7a6b44ab62 the named of the character is actually NUL 2011-08-18 13:51:47 -05:00
Benjamin Peterson
020340f284 merge 3.2 2011-08-18 10:49:16 -05:00
Benjamin Peterson
5ad517a7d9 NUL -> NULL 2011-08-18 10:48:50 -05:00
Benjamin Peterson
01fc6cd056 make __doc__ mutable on heaptypes (closes #12773) 2011-08-17 12:03:47 -05:00
Benjamin Peterson
d9f23d2004 factor out common checks for setting special type attributes 2011-08-17 11:54:03 -05:00
Benjamin Peterson
d17cefc787 crush other possible refleaks in this section 2011-08-16 22:28:23 -05:00
Benjamin Peterson
3e6267e704 merge 3.2 2011-08-16 22:27:42 -05:00
Benjamin Peterson
ae13c88d8d fix possible refleaks 2011-08-16 22:26:48 -05:00
Benjamin Peterson
c4085c8470 complain when a class variable shadows a name in __slots__ (closes #12766) 2011-08-16 18:53:26 -05:00
Ezio Melotti
269e3ee3db #12266: merge with 3.2. 2011-08-15 09:26:28 +03:00
Ezio Melotti
ee8d998ecf #12266: Fix str.capitalize() to correctly uppercase/lowercase titlecased and cased non-letter characters. 2011-08-15 09:09:57 +03:00
Benjamin Peterson
f8e7543df9 merge 3.2 (#12732) 2011-08-12 22:18:19 -05:00
Benjamin Peterson
f413b80806 in narrow builds, make sure to test codepoints as identifier characters (closes #12732)
This fixes the use of Unicode identifiers outside the BMP in narrow builds.
2011-08-12 22:17:18 -05:00
Brian Curtin
dfc80e3d97 Replace Py_NotImplemented returns with the macro form Py_RETURN_NOTIMPLEMENTED.
The macro was introduced in #12724.
2011-08-10 20:28:54 -05:00
Victor Stinner
ab1d16b456 Issue #13093: Fix error handling on PyUnicode_EncodeDecimal()
* Add tests for PyUnicode_EncodeDecimal() and PyUnicode_TransformDecimalToASCII()
 * Remove the unused "e" variable in replace()
2011-11-22 01:45:37 +01:00
Benjamin Peterson
ecb3bd93ff merge 3.2 2011-07-29 22:44:51 -05:00
Benjamin Peterson
43a976e3d9 remove duplicated type ready 2011-07-29 22:44:42 -05:00
Benjamin Peterson
18d7d7a217 also make NotImplementedType callable 2011-07-29 18:27:44 -05:00
Benjamin Peterson
c4607aeedd make the types of None and Ellipsis callable 2011-07-29 18:19:43 -05:00
Raymond Hettinger
66d2be8986 Issue 12647: Add __bool__() method to the None object. 2011-07-28 09:55:13 -07:00
Senthil Kumaran
fcdaaa9011 merge from 3.2 - Fix closes Issue12621 - Fix docstrings of find and rfind methods of bytes/bytearry/unicodeobject. 2011-07-27 23:34:29 +08:00
Senthil Kumaran
53516a82df Fix closes Issue12621 - Fix docstrings of find and rfind methods of bytes/bytearry/unicodeobject. 2011-07-27 23:33:54 +08:00
Eric V. Smith
c12469df22 Merge from 3.2. 2011-07-18 14:08:55 -04:00
Eric V. Smith
12ebefc9d3 Closes #12579. Positional fields with str.format_map() now raise a ValueError instead of SystemError. 2011-07-18 14:03:41 -04:00
Antoine Pitrou
9b43b6e14e Issue #11603: Fix a crash when __str__ is rebound as __repr__.
Patch by Andreas Stührk.
2011-07-15 21:18:18 +02:00
Antoine Pitrou
ff35050493 Issue #11603: Fix a crash when __str__ is rebound as __repr__.
Patch by Andreas Stührk.
2011-07-15 21:17:14 +02:00