Antoine Pitrou
00b2c86d09
Fix text failures when ctypes is not available
...
(followup to Victor's 85d11cf67aa8 and 7a50e549bd11)
2011-10-05 13:01:41 +02:00
Charles-François Natali
4637309ee6
Merge.
2011-10-04 23:37:43 +02:00
Charles-François Natali
09252c4938
os.geteuid() may not be available...
2011-10-04 23:36:49 +02:00
Victor Stinner
e1335c711c
Fix usage og PyUnicode_READY()
2011-10-04 20:53:03 +02:00
Victor Stinner
e06e145943
_PyUnicode_READY_REPLACE() cannot be used in unicode_subtype_new()
2011-10-04 20:52:31 +02:00
Charles-François Natali
5f99c912c8
Issue #11956 : Always skip test_import.test_unwritable_directory when run as
...
root, since the semantics varies across Unix variants.
2011-10-04 20:41:52 +02:00
Victor Stinner
17efeed284
Add DONT_MAKE_RESULT_READY to unicodeobject.c to help detecting bugs
...
Use also _PyUnicode_READY_REPLACE() when it's applicable.
2011-10-04 20:05:46 +02:00
Victor Stinner
6b56a7fd3d
Add assertion to _Py_ReleaseInternedUnicodeStrings() if READY fails
2011-10-04 20:04:52 +02:00
Antoine Pitrou
875f29bb95
Fix naïve heuristic in unicode slicing (followup to 1b4f886dc9e2)
2011-10-04 20:00:49 +02:00
Charles-François Natali
2b72f83877
Merge.
2011-10-04 19:20:52 +02:00
Charles-François Natali
e39b112aea
Issue #11956 : Skip test_import.test_unwritable_directory on FreeBSD when run as
...
root (directory permissions are ignored).
2011-10-04 19:19:21 +02:00
Antoine Pitrou
d9488c6841
Merge
2011-10-04 19:11:34 +02:00
Antoine Pitrou
2242522fde
Add a necessary call to PyUnicode_READY() (followup to ab5086539ab9)
2011-10-04 19:10:51 +02:00
Antoine Pitrou
7aec401966
Optimize string slicing to use the new API
2011-10-04 19:08:01 +02:00
Ezio Melotti
a9860aeb08
#13054 : fix usage of sys.maxunicode after PEP-393.
2011-10-04 19:06:00 +03:00
Victor Stinner
77bb47b312
Simplify unicode_resizable(): singletons reference count is at least 2
2011-10-03 20:06:05 +02:00
Charles-François Natali
8619cd7376
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.
2011-10-03 19:43:15 +02:00
Charles-François Natali
87b3c92b5b
Introduce support.requires_freebsd_version decorator.
2011-10-03 19:40:37 +02:00
Victor Stinner
85041a54bd
_PyUnicode_CheckConsistency() checks utf8 field consistency
2011-10-03 14:42:39 +02:00
Victor Stinner
3cf4637e4e
unicode_subtype_new() copies also the ascii flag
2011-10-03 14:42:15 +02:00
Victor Stinner
42dfd71333
unicode_kind_name() doesn't check consistency anymore
...
It is is called from _PyUnicode_Dump() and so must not fail.
2011-10-03 14:41:45 +02:00
Victor Stinner
a3b334da6d
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).
2011-10-03 13:53:37 +02:00
Victor Stinner
1b4f9ceca7
Create _PyUnicode_READY_REPLACE() to reuse singleton
...
Only use _PyUnicode_READY_REPLACE() on just created strings.
2011-10-03 13:28:14 +02:00
Victor Stinner
c379ead9af
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
2011-10-03 12:52:27 +02:00
Victor Stinner
34411e17b0
resize_inplace() has been fixed: reenable this optimization
2011-10-03 12:21:33 +02:00
Victor Stinner
a849a4b6b4
_PyUnicode_Dump() indicates if wstr and/or utf8 are shared
2011-10-03 12:12:11 +02:00
Victor Stinner
1c8d0c76a1
Fix resize_inplace(): update shared utf8 pointer
2011-10-03 12:11:00 +02:00
Victor Stinner
ca4f7a4298
Disable unicode_resize() optimization on Windows (16-bit wchar_t)
2011-10-03 04:18:04 +02:00
Victor Stinner
126c559d05
_PyUnicode_Ready() for 16-bit wchar_t
2011-10-03 04:17:10 +02:00
Victor Stinner
2fd82278cb
Fix compilation error on Windows
...
Fix also a compiler warning.
2011-10-03 04:06:05 +02:00
Senthil Kumaran
5d0de3fbaa
Document message_body arg in HTTPConnection.endheaders
2011-10-03 07:27:06 +08:00
Antoine Pitrou
86aed0bbc6
Fix ResourceWarnings in the TIPC socket tests.
2011-10-02 23:33:19 +02:00
Victor Stinner
d2a915dbf6
ceval.c: restore str+=str optimization
2011-10-02 20:34:20 +02:00
Victor Stinner
a3be613a56
Use PyUnicode_WCHAR_KIND to check if a string is a wstr string
...
Simplify the test in wstr pointer in unicode_sizeof().
2011-10-03 02:16:37 +02:00
Victor Stinner
910337b42e
Add _PyUnicode_CheckConsistency() macro to help debugging
...
* Document Unicode string states
* Use _PyUnicode_CheckConsistency() to ensure that objects are always
consistent.
2011-10-03 03:20:16 +02:00
Victor Stinner
4fae54cb0e
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).
2011-10-03 02:01:52 +02:00
Victor Stinner
23e5668214
PyUnicode_Append() now works in-place when it's possible
2011-10-03 03:54:37 +02:00
Victor Stinner
fe226c0d37
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()
2011-10-03 03:52:20 +02:00
Victor Stinner
829c0adca9
Add _PyUnicode_HAS_UTF8_MEMORY() macro
2011-10-03 01:08:02 +02:00
Victor Stinner
37943769ef
PyUnicode_READ_CHAR() ensures that the string is ready
2011-10-02 20:33:18 +02:00
Victor Stinner
fe0c155c4f
Write _PyUnicode_Dump() to help debugging
2011-10-03 02:59:31 +02:00
Victor Stinner
f42dc448e0
PyUnicode_CopyCharacters() fails when copying latin1 into ascii
2011-10-02 23:33:16 +02:00
Victor Stinner
c53be96c54
unicode_convert_wchar_to_ucs4() cannot fail
2011-10-02 21:33:54 +02:00
Victor Stinner
c3c7415639
Add _PyUnicode_DATA_ANY(op) private macro
2011-10-02 20:39:55 +02:00
Victor Stinner
a464fc141d
unicode_empty and unicode_latin1 are PyObject* objects, not PyUnicodeObject*
2011-10-02 20:39:30 +02:00
Victor Stinner
67002af323
Check error when calling PyUnicode_AppendAndDel()
2011-10-02 20:35:10 +02:00
Victor Stinner
1a15aba71d
PyCodec_ReplaceErrors() uses "C" format instead of "u#" to build result
2011-10-02 19:00:15 +02:00
Senthil Kumaran
0069be19e5
merge from 3.2 - Document message_body arg in HTTPConnection.endheaders
2011-10-03 07:28:00 +08:00
Antoine Pitrou
22cd021656
Fix ResourceWarnings in the TIPC socket tests.
2011-10-02 23:37:41 +02:00
Benjamin Peterson
a8726c4d96
merge heads
2011-10-02 13:19:30 -04:00