]> granicus.if.org Git - python/log
python
13 years agoFix test failure
Antoine Pitrou [Tue, 4 Oct 2011 08:39:54 +0000 (10:39 +0200)]
Fix test failure

13 years agoStart fixing test_bigmem:
Antoine Pitrou [Tue, 4 Oct 2011 08:28:37 +0000 (10:28 +0200)]
Start fixing test_bigmem:
- bigmemtest is replaced by precisionbigmemtest
- add a poor man's watchdog thread to print memory consumption

13 years agoStart fixing test_bigmem:
Antoine Pitrou [Tue, 4 Oct 2011 08:22:36 +0000 (10:22 +0200)]
Start fixing test_bigmem:
- bigmemtest is replaced by precisionbigmemtest
- add a poor man's watchdog thread to print memory consumption

13 years agoIssue #7689: Allow pickling of dynamically created classes when their
Antoine Pitrou [Tue, 4 Oct 2011 07:25:28 +0000 (09:25 +0200)]
Issue #7689: Allow pickling of dynamically created classes when their
metaclass is registered with copyreg.  Patch by Nicolas M. Thiéry and
Craig Citro.

13 years agoIssue #7689: Allow pickling of dynamically created classes when their
Antoine Pitrou [Tue, 4 Oct 2011 07:23:04 +0000 (09:23 +0200)]
Issue #7689: Allow pickling of dynamically created classes when their
metaclass is registered with copyreg.  Patch by Nicolas M. Thiéry and
Craig Citro.

13 years agoIssue #12881: ctypes: Fix segfault with large structure field names.
Meador Inge [Tue, 4 Oct 2011 02:48:30 +0000 (21:48 -0500)]
Issue #12881: ctypes: Fix segfault with large structure field names.

13 years agoIssue #12881: ctypes: Fix segfault with large structure field names.
Meador Inge [Tue, 4 Oct 2011 02:44:22 +0000 (21:44 -0500)]
Issue #12881: ctypes: Fix segfault with large structure field names.

13 years agofix parens
Benjamin Peterson [Mon, 3 Oct 2011 23:37:29 +0000 (19:37 -0400)]
fix parens

13 years agofix formatting
Benjamin Peterson [Mon, 3 Oct 2011 23:35:07 +0000 (19:35 -0400)]
fix formatting

13 years agofix compiler warnings
Benjamin Peterson [Mon, 3 Oct 2011 23:34:12 +0000 (19:34 -0400)]
fix compiler warnings

13 years agoComplete documentation of compact ASCII strings
Victor Stinner [Mon, 3 Oct 2011 23:32:45 +0000 (01:32 +0200)]
Complete documentation of compact ASCII strings

13 years agoMove in-place Unicode append to its own subfunction
Victor Stinner [Mon, 3 Oct 2011 23:17:31 +0000 (01:17 +0200)]
Move in-place Unicode append to its own subfunction

13 years agoReindent internal Unicode macros
Victor Stinner [Mon, 3 Oct 2011 23:07:11 +0000 (01:07 +0200)]
Reindent internal Unicode macros

13 years agoDocument utf8_length and wstr_length states
Victor Stinner [Mon, 3 Oct 2011 23:05:08 +0000 (01:05 +0200)]
Document utf8_length and wstr_length states

Ensure these states with assertions in _PyUnicode_CheckConsistency().

13 years agoresize_inplace() sets utf8_length to zero if the utf8 is not shared8
Victor Stinner [Mon, 3 Oct 2011 23:03:50 +0000 (01:03 +0200)]
resize_inplace() sets utf8_length to zero if the utf8 is not shared8

Cleanup also the code.

13 years agoPyUnicode_New() sets utf8_length to zero for latin1
Victor Stinner [Mon, 3 Oct 2011 23:02:02 +0000 (01:02 +0200)]
PyUnicode_New() sets utf8_length to zero for latin1

13 years agoUnicode: raise SystemError instead of ValueError or RuntimeError on invalid
Victor Stinner [Mon, 3 Oct 2011 22:04:26 +0000 (00:04 +0200)]
Unicode: raise SystemError instead of ValueError or RuntimeError on invalid
state

13 years agoUnicode: document when the wstr pointer is shared with data
Victor Stinner [Mon, 3 Oct 2011 22:00:20 +0000 (00:00 +0200)]
Unicode: document when the wstr pointer is shared with data

Add also related assertions to _PyUnicode_CheckConsistency().

13 years agoAdd _PyUnicode_HAS_WSTR_MEMORY() macro
Victor Stinner [Mon, 3 Oct 2011 21:45:12 +0000 (23:45 +0200)]
Add _PyUnicode_HAS_WSTR_MEMORY() macro

13 years agoPyUnicode_Join() checks output length in debug mode
Victor Stinner [Mon, 3 Oct 2011 21:36:02 +0000 (23:36 +0200)]
PyUnicode_Join() checks output length in debug mode

PyUnicode_CopyCharacters() may copies less character than requested size, if
the input string is smaller than the argument. (This is very unlikely, but who
knows!?)

Avoid also calling PyUnicode_CopyCharacters() if the string is empty.

13 years agoFix a compiler warning in PyUnicode_Append()
Victor Stinner [Mon, 3 Oct 2011 21:27:56 +0000 (23:27 +0200)]
Fix a compiler warning in PyUnicode_Append()

Don't check PyUnicode_CopyCharacters() in release mode. Rename also some
variables.

13 years agoImprove string forms and PyUnicode_Resize() documentation
Victor Stinner [Mon, 3 Oct 2011 21:19:21 +0000 (23:19 +0200)]
Improve string forms and PyUnicode_Resize() documentation

Remove also the FIXME for resize_copy(): as discussed with Martin, copy the
string on resize if the string is not resizable is just fine.

13 years agoSimplify unicode_resizable(): singletons reference count is at least 2
Victor Stinner [Mon, 3 Oct 2011 18:06:05 +0000 (20:06 +0200)]
Simplify unicode_resizable(): singletons reference count is at least 2

13 years agoIssue #13001: Fix test_socket.testRecvmsgTrunc failure on FreeBSD < 8, which
Charles-François Natali [Mon, 3 Oct 2011 17:43:15 +0000 (19:43 +0200)]
Issue #13001: Fix test_socket.testRecvmsgTrunc failure on FreeBSD < 8, which
doesn't always set the MSG_TRUNC flag when a truncated datagram is received.

13 years agoIntroduce support.requires_freebsd_version decorator.
Charles-François Natali [Mon, 3 Oct 2011 17:40:37 +0000 (19:40 +0200)]
Introduce support.requires_freebsd_version decorator.

13 years ago_PyUnicode_CheckConsistency() checks utf8 field consistency
Victor Stinner [Mon, 3 Oct 2011 12:42:39 +0000 (14:42 +0200)]
_PyUnicode_CheckConsistency() checks utf8 field consistency

13 years agounicode_subtype_new() copies also the ascii flag
Victor Stinner [Mon, 3 Oct 2011 12:42:15 +0000 (14:42 +0200)]
unicode_subtype_new() copies also the ascii flag

13 years agounicode_kind_name() doesn't check consistency anymore
Victor Stinner [Mon, 3 Oct 2011 12:41:45 +0000 (14:41 +0200)]
unicode_kind_name() doesn't check consistency anymore

It is is called from _PyUnicode_Dump() and so must not fail.

13 years agoPyUnicode_Ready() now sets ascii=1 if maxchar < 128
Victor Stinner [Mon, 3 Oct 2011 11:53:37 +0000 (13:53 +0200)]
PyUnicode_Ready() now sets ascii=1 if maxchar < 128

ascii=1 is no more reserved to PyASCIIObject. Use
PyUnicode_IS_COMPACT_ASCII(obj) to check if obj is a PyASCIIObject (as before).

13 years agoCreate _PyUnicode_READY_REPLACE() to reuse singleton
Victor Stinner [Mon, 3 Oct 2011 11:28:14 +0000 (13:28 +0200)]
Create _PyUnicode_READY_REPLACE() to reuse singleton

Only use _PyUnicode_READY_REPLACE() on just created strings.

13 years agoFix resize_compact() and resize_inplace(); reenable full resize optimizations
Victor Stinner [Mon, 3 Oct 2011 10:52:27 +0000 (12:52 +0200)]
Fix resize_compact() and resize_inplace(); reenable full resize optimizations

 * resize_compact() updates also wstr_len for non-ascii strings sharing wstr
 * resize_inplace() updates also utf8_len/wstr_len for strings sharing
   utf8/wstr

13 years agoresize_inplace() has been fixed: reenable this optimization
Victor Stinner [Mon, 3 Oct 2011 10:21:33 +0000 (12:21 +0200)]
resize_inplace() has been fixed: reenable this optimization

13 years ago_PyUnicode_Dump() indicates if wstr and/or utf8 are shared
Victor Stinner [Mon, 3 Oct 2011 10:12:11 +0000 (12:12 +0200)]
_PyUnicode_Dump() indicates if wstr and/or utf8 are shared

13 years agoFix resize_inplace(): update shared utf8 pointer
Victor Stinner [Mon, 3 Oct 2011 10:11:00 +0000 (12:11 +0200)]
Fix resize_inplace(): update shared utf8 pointer

13 years agoDisable unicode_resize() optimization on Windows (16-bit wchar_t)
Victor Stinner [Mon, 3 Oct 2011 02:18:04 +0000 (04:18 +0200)]
Disable unicode_resize() optimization on Windows (16-bit wchar_t)

13 years ago_PyUnicode_Ready() for 16-bit wchar_t
Victor Stinner [Mon, 3 Oct 2011 02:17:10 +0000 (04:17 +0200)]
_PyUnicode_Ready() for 16-bit wchar_t

13 years agoFix compilation error on Windows
Victor Stinner [Mon, 3 Oct 2011 02:06:05 +0000 (04:06 +0200)]
Fix compilation error on Windows

Fix also a compiler warning.

13 years agoDocument message_body arg in HTTPConnection.endheaders
Senthil Kumaran [Sun, 2 Oct 2011 23:27:06 +0000 (07:27 +0800)]
Document message_body arg in HTTPConnection.endheaders

13 years agoFix ResourceWarnings in the TIPC socket tests.
Antoine Pitrou [Sun, 2 Oct 2011 21:33:19 +0000 (23:33 +0200)]
Fix ResourceWarnings in the TIPC socket tests.

13 years agoceval.c: restore str+=str optimization
Victor Stinner [Sun, 2 Oct 2011 18:34:20 +0000 (20:34 +0200)]
ceval.c: restore str+=str optimization

13 years agoUse PyUnicode_WCHAR_KIND to check if a string is a wstr string
Victor Stinner [Mon, 3 Oct 2011 00:16:37 +0000 (02:16 +0200)]
Use PyUnicode_WCHAR_KIND to check if a string is a wstr string

Simplify the test in wstr pointer in unicode_sizeof().

13 years agoAdd _PyUnicode_CheckConsistency() macro to help debugging
Victor Stinner [Mon, 3 Oct 2011 01:20:16 +0000 (03:20 +0200)]
Add _PyUnicode_CheckConsistency() macro to help debugging

 * Document Unicode string states
 * Use _PyUnicode_CheckConsistency() to ensure that objects are always
   consistent.

13 years agoIn release mode, PyUnicode_InternInPlace() does nothing if the input is NULL or
Victor Stinner [Mon, 3 Oct 2011 00:01:52 +0000 (02:01 +0200)]
In release mode, PyUnicode_InternInPlace() does nothing if the input is NULL or
not a unicode, instead of failing with a fatal error.

Use assertions in debug mode (provide better error messages).

13 years agoPyUnicode_Append() now works in-place when it's possible
Victor Stinner [Mon, 3 Oct 2011 01:54:37 +0000 (03:54 +0200)]
PyUnicode_Append() now works in-place when it's possible

13 years agoRewrite PyUnicode_Resize()
Victor Stinner [Mon, 3 Oct 2011 01:52:20 +0000 (03:52 +0200)]
Rewrite PyUnicode_Resize()

 * Rename _PyUnicode_Resize() to unicode_resize()
 * unicode_resize() creates a copy if the string cannot be resized instead
   of failing
 * Optimize resize_copy() for wstr strings
 * Disable temporary resize_inplace()

13 years agoAdd _PyUnicode_HAS_UTF8_MEMORY() macro
Victor Stinner [Sun, 2 Oct 2011 23:08:02 +0000 (01:08 +0200)]
Add _PyUnicode_HAS_UTF8_MEMORY() macro

13 years agoPyUnicode_READ_CHAR() ensures that the string is ready
Victor Stinner [Sun, 2 Oct 2011 18:33:18 +0000 (20:33 +0200)]
PyUnicode_READ_CHAR() ensures that the string is ready

13 years agoWrite _PyUnicode_Dump() to help debugging
Victor Stinner [Mon, 3 Oct 2011 00:59:31 +0000 (02:59 +0200)]
Write _PyUnicode_Dump() to help debugging

13 years agoPyUnicode_CopyCharacters() fails when copying latin1 into ascii
Victor Stinner [Sun, 2 Oct 2011 21:33:16 +0000 (23:33 +0200)]
PyUnicode_CopyCharacters() fails when copying latin1 into ascii

13 years agounicode_convert_wchar_to_ucs4() cannot fail
Victor Stinner [Sun, 2 Oct 2011 19:33:54 +0000 (21:33 +0200)]
unicode_convert_wchar_to_ucs4() cannot fail

13 years agoAdd _PyUnicode_DATA_ANY(op) private macro
Victor Stinner [Sun, 2 Oct 2011 18:39:55 +0000 (20:39 +0200)]
Add _PyUnicode_DATA_ANY(op) private macro

13 years agounicode_empty and unicode_latin1 are PyObject* objects, not PyUnicodeObject*
Victor Stinner [Sun, 2 Oct 2011 18:39:30 +0000 (20:39 +0200)]
unicode_empty and unicode_latin1 are PyObject* objects, not PyUnicodeObject*

13 years agoCheck error when calling PyUnicode_AppendAndDel()
Victor Stinner [Sun, 2 Oct 2011 18:35:10 +0000 (20:35 +0200)]
Check error when calling PyUnicode_AppendAndDel()

13 years agoPyCodec_ReplaceErrors() uses "C" format instead of "u#" to build result
Victor Stinner [Sun, 2 Oct 2011 17:00:15 +0000 (19:00 +0200)]
PyCodec_ReplaceErrors() uses "C" format instead of "u#" to build result

13 years agomerge from 3.2 - Document message_body arg in HTTPConnection.endheaders
Senthil Kumaran [Sun, 2 Oct 2011 23:28:00 +0000 (07:28 +0800)]
merge from 3.2 -  Document message_body arg in HTTPConnection.endheaders

13 years agoFix ResourceWarnings in the TIPC socket tests.
Antoine Pitrou [Sun, 2 Oct 2011 21:37:41 +0000 (23:37 +0200)]
Fix ResourceWarnings in the TIPC socket tests.

13 years agomerge heads
Benjamin Peterson [Sun, 2 Oct 2011 17:19:30 +0000 (13:19 -0400)]
merge heads

13 years agoremove unused label
Benjamin Peterson [Sun, 2 Oct 2011 17:19:16 +0000 (13:19 -0400)]
remove unused label

13 years agoIssue #13084: Fix a test_signal failure: the delivery order is only defined for
Charles-François Natali [Sun, 2 Oct 2011 16:36:05 +0000 (18:36 +0200)]
Issue #13084: Fix a test_signal failure: the delivery order is only defined for
real-time signals.

13 years ago#13076: merge with 3.2.
Ezio Melotti [Sun, 2 Oct 2011 09:47:10 +0000 (12:47 +0300)]
#13076: merge with 3.2.

13 years ago#13076: fix links to datetime.time and datetime.datetime.
Ezio Melotti [Sun, 2 Oct 2011 09:44:50 +0000 (12:44 +0300)]
#13076: fix links to datetime.time and datetime.datetime.

13 years agoPyUnicode_FindChar() raises a IndexError on invalid index
Victor Stinner [Sat, 1 Oct 2011 23:08:37 +0000 (01:08 +0200)]
PyUnicode_FindChar() raises a IndexError on invalid index

13 years agoOptimize _PyUnicode_AsKind() for UCS1->UCS4 and UCS2->UCS4
Victor Stinner [Sat, 1 Oct 2011 23:00:40 +0000 (01:00 +0200)]
Optimize _PyUnicode_AsKind() for UCS1->UCS4 and UCS2->UCS4

 * Ensure that the input string is ready
 * Raise a ValueError instead of of a fatal error

13 years agoUse Py_UCS1 instead of unsigned char in unicodeobject.h
Victor Stinner [Sat, 1 Oct 2011 22:55:25 +0000 (00:55 +0200)]
Use Py_UCS1 instead of unsigned char in unicodeobject.h

13 years agoFix usage of PyUnicode_READY() in PyUnicode_GetLength()
Victor Stinner [Sat, 1 Oct 2011 22:36:53 +0000 (00:36 +0200)]
Fix usage of PyUnicode_READY() in PyUnicode_GetLength()

13 years agoPyUnicode_WriteChar() raises IndexError on invalid index
Victor Stinner [Sat, 1 Oct 2011 22:34:53 +0000 (00:34 +0200)]
PyUnicode_WriteChar() raises IndexError on invalid index

PyUnicode_WriteChar() raises also a ValueError if the string has more than 1
reference.

13 years agoPyUnicode_ReadChar() raises a IndexError if the index in invalid
Victor Stinner [Sat, 1 Oct 2011 22:25:40 +0000 (00:25 +0200)]
PyUnicode_ReadChar() raises a IndexError if the index in invalid

unicode_getitem() reuses PyUnicode_ReadChar()

13 years agoPyUnicode_FromKindAndData() raises a ValueError if the kind is unknown
Victor Stinner [Sat, 1 Oct 2011 21:48:37 +0000 (23:48 +0200)]
PyUnicode_FromKindAndData() raises a ValueError if the kind is unknown

13 years agomerge #4147: minidom's toprettyxml no longer adds whitespace to text nodes.
R David Murray [Sat, 1 Oct 2011 20:22:35 +0000 (16:22 -0400)]
merge #4147: minidom's toprettyxml no longer adds whitespace to text nodes.

13 years ago#4147: minidom's toprettyxml no longer adds whitespace to text nodes.
R David Murray [Sat, 1 Oct 2011 20:19:51 +0000 (16:19 -0400)]
#4147: minidom's toprettyxml no longer adds whitespace to text nodes.

Patch by Dan Kenigsberg.

13 years agoIssue #13034: When decoding some SSL certificates, the subjectAltName extension could...
Antoine Pitrou [Sat, 1 Oct 2011 17:22:30 +0000 (19:22 +0200)]
Issue #13034: When decoding some SSL certificates, the subjectAltName extension could be unreported.

13 years agoIssue #13034: When decoding some SSL certificates, the subjectAltName extension could...
Antoine Pitrou [Sat, 1 Oct 2011 17:20:25 +0000 (19:20 +0200)]
Issue #13034: When decoding some SSL certificates, the subjectAltName extension could be unreported.

13 years agoOptimize unicode_subtype_new(): don't encode to wchar_t and decode from wchar_t
Victor Stinner [Sat, 1 Oct 2011 14:16:43 +0000 (16:16 +0200)]
Optimize unicode_subtype_new(): don't encode to wchar_t and decode from wchar_t

Rewrite unicode_subtype_new(): allocate directly the right type.

13 years agoAdd _PyUnicode_UTF8() and _PyUnicode_UTF8_LENGTH() macros
Victor Stinner [Sat, 1 Oct 2011 14:48:13 +0000 (16:48 +0200)]
Add _PyUnicode_UTF8() and _PyUnicode_UTF8_LENGTH() macros

 * Rename existing _PyUnicode_UTF8() macro to PyUnicode_UTF8()
 * Rename existing _PyUnicode_UTF8_LENGTH() macro to PyUnicode_UTF8_LENGTH()
 * PyUnicode_UTF8() and PyUnicode_UTF8_LENGTH() are more strict

13 years agoBackout of changeset 228fd2bd83a5 by Nadeem Vawda in branch 'default':
Antoine Pitrou [Sat, 1 Oct 2011 14:41:48 +0000 (16:41 +0200)]
Backout of changeset 228fd2bd83a5 by Nadeem Vawda in branch 'default':
Issue #12804: Prevent "make test" from using network resources.

13 years agoIssue 13085: Fix some memory leaks. Patch by Stefan Krah.
Martin v. Löwis [Sat, 1 Oct 2011 14:35:40 +0000 (16:35 +0200)]
Issue 13085: Fix some memory leaks. Patch by Stefan Krah.

13 years agomerge heads
Benjamin Peterson [Sat, 1 Oct 2011 04:12:20 +0000 (00:12 -0400)]
merge heads

13 years agoremove reference to non-existent file
Benjamin Peterson [Sat, 1 Oct 2011 04:11:09 +0000 (00:11 -0400)]
remove reference to non-existent file

13 years agoPyUnicode_Substring() now accepts end bigger than string length
Victor Stinner [Sat, 1 Oct 2011 01:55:54 +0000 (03:55 +0200)]
PyUnicode_Substring() now accepts end bigger than string length

Fix also a bug: call PyUnicode_READY() before reading string length.

13 years ago_PyUnicode_AsKind() is *not* part of the stable ABI
Victor Stinner [Sat, 1 Oct 2011 01:57:28 +0000 (03:57 +0200)]
_PyUnicode_AsKind() is *not* part of the stable ABI

13 years agoremove "fast-path" for (i)adding strings
Benjamin Peterson [Sat, 1 Oct 2011 01:31:21 +0000 (21:31 -0400)]
remove "fast-path" for (i)adding strings

These were just an artifact of the old unicode concatenation hack and likely
just penalized other kinds of adding. Also, this fixes __(i)add__ on string
subclasses.

13 years agoOoops, avoid a division by zero in unicode_repeat()
Victor Stinner [Sat, 1 Oct 2011 01:09:58 +0000 (03:09 +0200)]
Ooops, avoid a division by zero in unicode_repeat()

13 years agoPyUnicode_FromObject() ensures that its output is a ready string
Victor Stinner [Sat, 1 Oct 2011 01:09:33 +0000 (03:09 +0200)]
PyUnicode_FromObject() ensures that its output is a ready string

13 years agoI want a super fast 'a' * n!
Victor Stinner [Sat, 1 Oct 2011 00:47:29 +0000 (02:47 +0200)]
I want a super fast 'a' * n!

 * Optimize unicode_repeat() for a special case with memset()
 * Simplify integer overflow checking; remove the second check because
   PyUnicode_New() already does it and uses a smaller limit (Py_ssize_t vs
   size_t)

13 years agoPyUnicode_CHARACTER_SIZE(): add a reference to PyUnicode_KIND_SIZE()
Victor Stinner [Sat, 1 Oct 2011 00:39:37 +0000 (02:39 +0200)]
PyUnicode_CHARACTER_SIZE(): add a reference to PyUnicode_KIND_SIZE()

13 years agoFix usage of PyUnicode_READY in unicodeobject.c
Victor Stinner [Sat, 1 Oct 2011 00:14:59 +0000 (02:14 +0200)]
Fix usage of PyUnicode_READY in unicodeobject.c

13 years agoRemove private substring() function, reuse public PyUnicode_Substring()
Victor Stinner [Fri, 30 Sep 2011 23:53:49 +0000 (01:53 +0200)]
Remove private substring() function, reuse public PyUnicode_Substring()

 * PyUnicode_Substring() now fails if start or end is invalid
 * PyUnicode_Substring() reuses PyUnicode_Copy() for non-exact strings

13 years agoOptimize PyUnicode_Copy(): don't recompute maximum character
Victor Stinner [Fri, 30 Sep 2011 23:34:32 +0000 (01:34 +0200)]
Optimize PyUnicode_Copy(): don't recompute maximum character

13 years agoRemove commented code: str+=str is no more super-optimized
Victor Stinner [Fri, 30 Sep 2011 23:26:08 +0000 (01:26 +0200)]
Remove commented code: str+=str is no more super-optimized

13 years agoPyUnicode_FromObject() reuses PyUnicode_Copy()
Victor Stinner [Fri, 30 Sep 2011 23:16:59 +0000 (01:16 +0200)]
PyUnicode_FromObject() reuses PyUnicode_Copy()

 * PyUnicode_Copy() is faster than substring()
 * Fix also a compiler warning

13 years agopyexat uses the new Unicode API
Victor Stinner [Fri, 30 Sep 2011 23:05:40 +0000 (01:05 +0200)]
pyexat uses the new Unicode API

13 years agoFix ResourceWarnings in makeunicodedata.py.
Ezio Melotti [Fri, 30 Sep 2011 05:46:25 +0000 (08:46 +0300)]
Fix ResourceWarnings in makeunicodedata.py.

13 years agoAdd PyUnicode_Copy() function, include it to the public API
Victor Stinner [Fri, 30 Sep 2011 00:26:44 +0000 (02:26 +0200)]
Add PyUnicode_Copy() function, include it to the public API

13 years agoPyUnicode_CopyCharacters() uses exceptions instead of assertions
Victor Stinner [Fri, 30 Sep 2011 00:26:10 +0000 (02:26 +0200)]
PyUnicode_CopyCharacters() uses exceptions instead of assertions

Call PyErr_BadInternalCall() if inputs are not unicode strings.

13 years agoFix a compiler warning
Victor Stinner [Thu, 29 Sep 2011 23:55:49 +0000 (01:55 +0200)]
Fix a compiler warning

13 years agoFix array.array('u') constructor
Victor Stinner [Thu, 29 Sep 2011 23:54:04 +0000 (01:54 +0200)]
Fix array.array('u') constructor

13 years agoposix module catches PyUnicode_AsUnicode() failure
Victor Stinner [Thu, 29 Sep 2011 23:44:27 +0000 (01:44 +0200)]
posix module catches PyUnicode_AsUnicode() failure

 * Replace PyUnicode_AS_UNICODE by PyUnicode_AsUnicode, PyUnicode_AS_UNICODE is
   no more a real macro
 * Replace Py_UNICODE by wchar_t in code specific to Windows

13 years agoarray module uses the new Unicode API
Victor Stinner [Thu, 29 Sep 2011 22:51:10 +0000 (00:51 +0200)]
array module uses the new Unicode API

 * Use Py_UCS4* buffer instead of Py_UNICODE*
 * Use "I" or "L" format, instead of "u" format

13 years agoarray module stores the typecode in a char, instead of Py_UNICODE
Victor Stinner [Thu, 29 Sep 2011 22:03:59 +0000 (00:03 +0200)]
array module stores the typecode in a char, instead of Py_UNICODE

13 years agoraw_unicode_escape() uses the new Unicode API
Victor Stinner [Thu, 29 Sep 2011 21:50:23 +0000 (23:50 +0200)]
raw_unicode_escape() uses the new Unicode API