Commit Graph

3941 Commits

Author SHA1 Message Date
Victor Stinner
0a045efb49 Fix a compiler warning: use unsiged for maxchar in unicode_widen() 2011-11-09 00:02:42 +01:00
Victor Stinner
596a6c4ffc Fix the code page decoder
* unicode_decode_call_errorhandler() now supports the PyUnicode_WCHAR_KIND
   kind
 * unicode_decode_call_errorhandler() calls copy_characters() instead of
   PyUnicode_CopyCharacters()
2011-11-09 00:02:18 +01:00
Antoine Pitrou
a8f63c02ef Fix missing goto 2011-11-08 18:37:16 +01:00
Martin v. Löwis
d10759f6ed Make _PyUnicode_FromId return borrowed references.
http://mail.python.org/pipermail/python-dev/2011-November/114347.html
2011-11-07 13:00:05 +01:00
Martin v. Löwis
e9b11c1cd8 Change decoders to use Unicode API instead of Py_UNICODE. 2011-11-08 17:35:34 +01:00
Petri Lehtinen
9589ab1745 Revert "Accept None as start and stop parameters for list.index() and tuple.index()"
Issue #13340.
2011-11-06 21:06:10 +02:00
Petri Lehtinen
ebfaabd663 Revert "Accept None as start and stop parameters for list.index() and tuple.index()"
Issue #13340.
2011-11-06 21:02:39 +02:00
Amaury Forgeot d'Arc
864741b2c7 Issue #13350: Replace most usages of PyUnicode_Format by PyUnicode_FromFormat. 2011-11-06 15:10:48 +01:00
Petri Lehtinen
8e9f6c4251 Accept None as start and stop parameters for list.index() and tuple.index().
Closes #13340.
2011-11-05 23:25:34 +02:00
Petri Lehtinen
c2f0a46111 Accept None as start and stop parameters for list.index() and tuple.index()
Closes #13340.
2011-11-05 23:24:31 +02:00
Benjamin Peterson
878ce389a0 add introspection to range objects (closes #9896)
Patch by Daniel Urban.
2011-11-05 15:17:52 -04:00
Victor Stinner
e30c0a1014 Fix gdb/libpython.py for not ready Unicode strings
_PyUnicode_CheckConsistency() checks also hash and length value for not ready
Unicode strings.
2011-11-04 20:54:05 +01:00
Victor Stinner
2fc507fe45 Replace tabs by spaces 2011-11-04 20:06:39 +01:00
Martin v. Löwis
12be46ca84 Drop Py_UNICODE based encode exceptions. 2011-11-04 19:04:15 +01:00
Martin v. Löwis
3d325191bf Port code page codec to Unicode API. 2011-11-04 18:23:06 +01:00
Martin v. Löwis
b09af03b8a Port error handlers from Py_UNICODE indexing to code point indexing. 2011-11-04 11:16:41 +01:00
Victor Stinner
fcd9653667 Fix a compiler warning in unicode_encode_ucs1() 2011-11-04 00:28:50 +01:00
Victor Stinner
fc026c98d8 Fix PyUnicode_EncodeCharmap() 2011-11-04 00:24:51 +01:00
Victor Stinner
7931d9a951 Replace PyUnicodeObject type by PyObject
* _PyUnicode_CheckConsistency() now takes a PyObject* instead of void*
 * Remove now useless casts to PyObject*
2011-11-04 00:22:48 +01:00
Victor Stinner
76a31a6bff Cleanup decode_code_page_stateful() and encode_code_page()
* Fix decode_code_page_errors() result
 * Inline decode_code_page() and encode_code_page_chunk()
 * Replace the PyUnicodeObject type by PyObject
2011-11-04 00:05:13 +01:00
Victor Stinner
7581cef699 Adapt the code page encoder to the new unicode_encode_call_errorhandler()
The code is not correct, but at least it doesn't crash anymore.
2011-11-03 22:32:33 +01:00
Brian Curtin
2787ea41fd Fix a compile error (apparently Windows only) introduced in 295fdfd4f422 2011-11-02 15:09:37 -05:00
Martin v. Löwis
23e275b3ad Port UCS1 and charmap codecs to new API. 2011-11-02 18:02:51 +01:00
Martin v. Löwis
9e8166843c Introduce PyObject* API for raising encode errors. 2011-11-02 12:45:42 +01:00
Benjamin Peterson
2b50a01d11 remove unused variable 2011-10-30 14:24:44 -04:00
Petri Lehtinen
e0aa803714 Fix the return value of set_discard (issue #10519) 2011-10-30 14:35:12 +02:00
Petri Lehtinen
5acc27ebe4 Avoid unnecessary recursive function calls (closes #10519) 2011-10-30 13:56:41 +02:00
Petri Lehtinen
a94200e6ce Issue #13018: Fix reference leaks in error paths in dictobject.c.
Patch by Suman Saha.
2011-10-24 21:12:58 +03:00
Nick Coghlan
de31b191e5 Issue 1294232: Fix errors in metaclass calculation affecting some cases of metaclass inheritance. Patch by Daniel Urban. 2011-10-23 22:04:16 +10:00
Benjamin Peterson
9d9141f5db adjust braces a bit 2011-10-19 16:57:40 -04:00
Antoine Pitrou
551ba20e8e Issue #13188: When called without an explicit traceback argument,
generator.throw() now gets the traceback from the passed exception's
`__traceback__` attribute.  Patch by Petri Lehtinen.
2011-10-18 16:40:50 +02:00
Benjamin Peterson
2963fe0711 plug possible refleak (closes #13199) 2011-10-17 13:09:27 -04:00
Martin v. Löwis
0d3072e98d Drop Py_UCS4_ functions. Closes #13246. 2011-10-31 08:40:56 +01:00
Benjamin Peterson
1cebc207ea merge 3.2 2011-10-30 14:24:59 -04:00
Petri Lehtinen
c34f5c256a Fix the return value of set_discard (issue #10519) 2011-10-30 14:35:39 +02:00
Petri Lehtinen
7c5e34d8a3 Avoid unnecessary recursive function calls (#closes #10519) 2011-10-30 13:57:45 +02:00
Victor Stinner
57ffa9d4ff PyUnicode_AsUnicodeCopy() uses PyUnicode_AsUnicodeAndSize() to get directly the length 2011-10-23 20:10:08 +02:00
Victor Stinner
af9e4b8c29 Fix PyUnicode_InternImmortal(): PyUnicode_InternInPlace() may changes *p 2011-10-23 20:07:00 +02:00
Victor Stinner
9faa384bed Cast directly to unsigned char, instead of using Py_CHARMASK
We don't need "& 0xff" on an unsigned char.
2011-10-23 20:06:00 +02:00
Victor Stinner
9db1a8b69f Replace PyUnicodeObject* by PyObject* where it was irrevelant
A Unicode string can now be a PyASCIIObject, PyCompactUnicodeObject or
PyUnicodeObject. Aliasing a PyASCIIObject* or PyCompactUnicodeObject* to
PyUnicodeObject* is wrong
2011-10-23 20:04:37 +02:00
Victor Stinner
0d60e87ad6 Fix data variable in _PyUnicode_Dump() for compact ASCII 2011-10-23 19:47:19 +02:00
Victor Stinner
d8e61c348e Remove last references to the removed Unicode free list 2011-10-23 19:43:33 +02:00
Victor Stinner
065836ec9c PyUnicode_FSDecoder() ensures that the decoded string is ready 2011-10-27 01:56:33 +02:00
Petri Lehtinen
08a95cabe3 merge heads 2011-10-24 21:22:39 +03:00
Petri Lehtinen
24bd5adcff Merge 3.2 2011-10-24 21:17:52 +03:00
Mark Dickinson
8d48b43ea9 Issue #12965: Fix some inaccurate comments in Objects/longobject.c. Thanks Stefan Krah. 2011-10-23 20:47:14 +01:00
Mark Dickinson
36645681c8 Issue #13201: equality for range objects is now based on equality of the underlying sequences. Thanks Sven Marnach for the patch. 2011-10-23 19:53:01 +01:00
Nick Coghlan
9715d26305 Merge issue 1294232 patch from 3.2 2011-10-23 22:36:42 +10:00
Victor Stinner
dd18d3ad9e Fix unicode_subtype_new() on debug build
Patch written by Stefan Behnel.
2011-10-22 11:08:10 +02:00
Ezio Melotti
f881751ded Remove unused variable. 2011-10-22 01:01:32 +03:00