]>
granicus.if.org Git - python/log
Senthil Kumaran [Wed, 5 Oct 2011 15:27:37 +0000 (23:27 +0800)]
merge from 3.2. Issue #13073 - Address the review comments made by Ezio.
Senthil Kumaran [Wed, 5 Oct 2011 15:26:49 +0000 (23:26 +0800)]
Issue #13073 - Address the review comments made by Ezio.
Georg Brandl [Wed, 5 Oct 2011 14:47:38 +0000 (16:47 +0200)]
More fixes.
Georg Brandl [Wed, 5 Oct 2011 14:36:47 +0000 (16:36 +0200)]
More typoes.
Georg Brandl [Wed, 5 Oct 2011 14:23:09 +0000 (16:23 +0200)]
Fix a few typos in the unicode header.
Georg Brandl [Wed, 5 Oct 2011 14:12:21 +0000 (16:12 +0200)]
Fix grammar.
Victor Stinner [Wed, 5 Oct 2011 12:13:28 +0000 (14:13 +0200)]
Speedup str[a:b:step] for step != 1
Try to stop the scanner of the maximum character before the end using a limit
depending on the kind (e.g. 256 for PyUnicode_2BYTE_KIND).
Victor Stinner [Wed, 5 Oct 2011 12:02:44 +0000 (14:02 +0200)]
Speedup find_maxchar_surrogates() for 32-bit wchar_t
If we have at least one character in U+10000-U+10FFFF, we know that we must use
PyUnicode_4BYTE_KIND kind.
Victor Stinner [Wed, 5 Oct 2011 12:01:42 +0000 (14:01 +0200)]
Speedup str[a:b] and PyUnicode_FromKindAndData
* str[a:b] doesn't scan the string for the maximum character if the string
is ascii only
* PyUnicode_FromKindAndData() stops if we are sure that we cannot use a
shorter character type. For example, _PyUnicode_FromUCS1() stops if we
have at least one character in range U+0080-U+00FF
Victor Stinner [Wed, 5 Oct 2011 11:50:52 +0000 (13:50 +0200)]
Speedup the ASCII decoder
It is faster for long string and a little bit faster for short strings,
benchmark on Linux 32 bits, Intel Core i5 @ 3.33GHz:
./python -m timeit 'x=b"a"' 'x.decode("ascii")'
./python -m timeit 'x=b"x"*80' 'x.decode("ascii")'
./python -m timeit 'x=b"abc"*4096' 'x.decode("ascii")'
length | before | after
-------+------------+-----------
1 | 0.234 usec | 0.229 usec
80 | 0.381 usec | 0.357 usec
12,288 | 11.2 usec | 3.01 usec
Antoine Pitrou [Wed, 5 Oct 2011 11:01:41 +0000 (13:01 +0200)]
Fix text failures when ctypes is not available
(followup to Victor's
85d11cf67aa8 and
7a50e549bd11 )
Charles-François Natali [Tue, 4 Oct 2011 21:37:43 +0000 (23:37 +0200)]
Merge.
Charles-François Natali [Tue, 4 Oct 2011 21:36:49 +0000 (23:36 +0200)]
os.geteuid() may not be available...
Charles-François Natali [Tue, 4 Oct 2011 21:35:47 +0000 (23:35 +0200)]
os.geteuid() may not be available...
Victor Stinner [Tue, 4 Oct 2011 18:53:03 +0000 (20:53 +0200)]
Fix usage og PyUnicode_READY()
Victor Stinner [Tue, 4 Oct 2011 18:52:31 +0000 (20:52 +0200)]
_PyUnicode_READY_REPLACE() cannot be used in unicode_subtype_new()
Charles-François Natali [Tue, 4 Oct 2011 18:41:52 +0000 (20:41 +0200)]
Issue #11956: Always skip test_import.test_unwritable_directory when run as
root, since the semantics varies across Unix variants.
Charles-François Natali [Tue, 4 Oct 2011 18:40:58 +0000 (20:40 +0200)]
Issue #11956: Always skip test_import.test_unwritable_directory when run as
root, since the semantics varies across Unix variants.
Victor Stinner [Tue, 4 Oct 2011 18:05:46 +0000 (20:05 +0200)]
Add DONT_MAKE_RESULT_READY to unicodeobject.c to help detecting bugs
Use also _PyUnicode_READY_REPLACE() when it's applicable.
Victor Stinner [Tue, 4 Oct 2011 18:04:52 +0000 (20:04 +0200)]
Add assertion to _Py_ReleaseInternedUnicodeStrings() if READY fails
Antoine Pitrou [Tue, 4 Oct 2011 18:00:49 +0000 (20:00 +0200)]
Fix naïve heuristic in unicode slicing (followup to
1b4f886dc9e2 )
Charles-François Natali [Tue, 4 Oct 2011 17:20:52 +0000 (19:20 +0200)]
Merge.
Charles-François Natali [Tue, 4 Oct 2011 17:19:21 +0000 (19:19 +0200)]
Issue #11956: Skip test_import.test_unwritable_directory on FreeBSD when run as
root (directory permissions are ignored).
Charles-François Natali [Tue, 4 Oct 2011 17:17:26 +0000 (19:17 +0200)]
Issue #11956: Skip test_import.test_unwritable_directory on FreeBSD when run as
root (directory permissions are ignored).
Antoine Pitrou [Tue, 4 Oct 2011 17:11:34 +0000 (19:11 +0200)]
Merge
Antoine Pitrou [Tue, 4 Oct 2011 17:10:51 +0000 (19:10 +0200)]
Add a necessary call to PyUnicode_READY() (followup to
ab5086539ab9 )
Antoine Pitrou [Tue, 4 Oct 2011 17:08:01 +0000 (19:08 +0200)]
Optimize string slicing to use the new API
Ezio Melotti [Tue, 4 Oct 2011 16:06:00 +0000 (19:06 +0300)]
#13054: fix usage of sys.maxunicode after PEP-393.
Antoine Pitrou [Tue, 4 Oct 2011 14:18:15 +0000 (16:18 +0200)]
Also fix pickletester
Antoine Pitrou [Tue, 4 Oct 2011 14:07:27 +0000 (16:07 +0200)]
An embarassing litle typo
Antoine Pitrou [Tue, 4 Oct 2011 14:04:01 +0000 (16:04 +0200)]
When expandtabs() would be a no-op, don't create a duplicate string
Antoine Pitrou [Tue, 4 Oct 2011 13:55:44 +0000 (15:55 +0200)]
Migrate test_bigmem to PEP 393-compliant size calculations (hopefully)
Antoine Pitrou [Tue, 4 Oct 2011 13:55:09 +0000 (15:55 +0200)]
Migrate str.expandtabs to the new API
Antoine Pitrou [Tue, 4 Oct 2011 12:44:35 +0000 (14:44 +0200)]
Try to fix linking failures under Windows
Antoine Pitrou [Tue, 4 Oct 2011 12:43:47 +0000 (14:43 +0200)]
Try to fix linking failures under Windows
Antoine Pitrou [Tue, 4 Oct 2011 11:53:01 +0000 (13:53 +0200)]
Remove all other uses of the C tolower()/toupper() which could break with a Turkish locale.
Antoine Pitrou [Tue, 4 Oct 2011 11:50:21 +0000 (13:50 +0200)]
Remove all other uses of the C tolower()/toupper() which could break with a Turkish locale.
Antoine Pitrou [Tue, 4 Oct 2011 11:37:06 +0000 (13:37 +0200)]
Issue #13099: Fix sqlite3.Cursor.lastrowid under a Turkish locale.
Reported and diagnosed by Thomas Kluyver.
Antoine Pitrou [Tue, 4 Oct 2011 11:35:28 +0000 (13:35 +0200)]
Issue #13099: Fix sqlite3.Cursor.lastrowid under a Turkish locale.
Reported and diagnosed by Thomas Kluyver.
Antoine Pitrou [Tue, 4 Oct 2011 11:00:02 +0000 (13:00 +0200)]
Fix compilation error under Windows
Antoine Pitrou [Tue, 4 Oct 2011 10:28:52 +0000 (12:28 +0200)]
Issue #13087: BufferedReader.seek() now always raises UnsupportedOperation
if the underlying raw stream is unseekable, even if the seek could be
satisfied using the internal buffer. Patch by John OConnor.
Antoine Pitrou [Tue, 4 Oct 2011 10:26:34 +0000 (12:26 +0200)]
Add John to ACKS
Antoine Pitrou [Tue, 4 Oct 2011 10:26:20 +0000 (12:26 +0200)]
Issue #13087: BufferedReader.seek() now always raises UnsupportedOperation
if the underlying raw stream is unseekable, even if the seek could be
satisfied using the internal buffer. Patch by John O'Connor.
Antoine Pitrou [Tue, 4 Oct 2011 10:06:06 +0000 (12:06 +0200)]
Collect stats a bit more often
Antoine Pitrou [Tue, 4 Oct 2011 09:51:23 +0000 (11:51 +0200)]
Use the faulthandler module's infrastructure to write a GIL-less
memory watchdog for timely stats collection.
Antoine Pitrou [Tue, 4 Oct 2011 08:39:54 +0000 (10:39 +0200)]
Fix test failure
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
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
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.
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.
Meador Inge [Tue, 4 Oct 2011 02:48:30 +0000 (21:48 -0500)]
Issue #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.
Benjamin Peterson [Mon, 3 Oct 2011 23:37:29 +0000 (19:37 -0400)]
fix parens
Benjamin Peterson [Mon, 3 Oct 2011 23:35:07 +0000 (19:35 -0400)]
fix formatting
Benjamin Peterson [Mon, 3 Oct 2011 23:34:12 +0000 (19:34 -0400)]
fix compiler warnings
Victor Stinner [Mon, 3 Oct 2011 23:32:45 +0000 (01:32 +0200)]
Complete documentation of compact ASCII strings
Victor Stinner [Mon, 3 Oct 2011 23:17:31 +0000 (01:17 +0200)]
Move in-place Unicode append to its own subfunction
Victor Stinner [Mon, 3 Oct 2011 23:07:11 +0000 (01:07 +0200)]
Reindent internal Unicode macros
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().
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.
Victor Stinner [Mon, 3 Oct 2011 23:02:02 +0000 (01:02 +0200)]
PyUnicode_New() sets utf8_length to zero for latin1
Victor Stinner [Mon, 3 Oct 2011 22:04:26 +0000 (00:04 +0200)]
Unicode: raise SystemError instead of ValueError or RuntimeError on invalid
state
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().
Victor Stinner [Mon, 3 Oct 2011 21:45:12 +0000 (23:45 +0200)]
Add _PyUnicode_HAS_WSTR_MEMORY() macro
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.
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.
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.
Victor Stinner [Mon, 3 Oct 2011 18:06:05 +0000 (20:06 +0200)]
Simplify unicode_resizable(): singletons reference count is at least 2
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.
Charles-François Natali [Mon, 3 Oct 2011 17:40:37 +0000 (19:40 +0200)]
Introduce support.requires_freebsd_version decorator.
Victor Stinner [Mon, 3 Oct 2011 12:42:39 +0000 (14:42 +0200)]
_PyUnicode_CheckConsistency() checks utf8 field consistency
Victor Stinner [Mon, 3 Oct 2011 12:42:15 +0000 (14:42 +0200)]
unicode_subtype_new() copies also the ascii flag
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.
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).
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.
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
Victor Stinner [Mon, 3 Oct 2011 10:21:33 +0000 (12:21 +0200)]
resize_inplace() has been fixed: reenable this optimization
Victor Stinner [Mon, 3 Oct 2011 10:12:11 +0000 (12:12 +0200)]
_PyUnicode_Dump() indicates if wstr and/or utf8 are shared
Victor Stinner [Mon, 3 Oct 2011 10:11:00 +0000 (12:11 +0200)]
Fix resize_inplace(): update shared utf8 pointer
Victor Stinner [Mon, 3 Oct 2011 02:18:04 +0000 (04:18 +0200)]
Disable unicode_resize() optimization on Windows (16-bit wchar_t)
Victor Stinner [Mon, 3 Oct 2011 02:17:10 +0000 (04:17 +0200)]
_PyUnicode_Ready() for 16-bit wchar_t
Victor Stinner [Mon, 3 Oct 2011 02:06:05 +0000 (04:06 +0200)]
Fix compilation error on Windows
Fix also a compiler warning.
Senthil Kumaran [Sun, 2 Oct 2011 23:27:06 +0000 (07:27 +0800)]
Document message_body arg in HTTPConnection.endheaders
Antoine Pitrou [Sun, 2 Oct 2011 21:33:19 +0000 (23:33 +0200)]
Fix ResourceWarnings in the TIPC socket tests.
Victor Stinner [Sun, 2 Oct 2011 18:34:20 +0000 (20:34 +0200)]
ceval.c: restore str+=str optimization
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().
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.
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).
Victor Stinner [Mon, 3 Oct 2011 01:54:37 +0000 (03:54 +0200)]
PyUnicode_Append() now works in-place when it's possible
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()
Victor Stinner [Sun, 2 Oct 2011 23:08:02 +0000 (01:08 +0200)]
Add _PyUnicode_HAS_UTF8_MEMORY() macro
Victor Stinner [Sun, 2 Oct 2011 18:33:18 +0000 (20:33 +0200)]
PyUnicode_READ_CHAR() ensures that the string is ready
Victor Stinner [Mon, 3 Oct 2011 00:59:31 +0000 (02:59 +0200)]
Write _PyUnicode_Dump() to help debugging
Victor Stinner [Sun, 2 Oct 2011 21:33:16 +0000 (23:33 +0200)]
PyUnicode_CopyCharacters() fails when copying latin1 into ascii
Victor Stinner [Sun, 2 Oct 2011 19:33:54 +0000 (21:33 +0200)]
unicode_convert_wchar_to_ucs4() cannot fail
Victor Stinner [Sun, 2 Oct 2011 18:39:55 +0000 (20:39 +0200)]
Add _PyUnicode_DATA_ANY(op) private macro
Victor Stinner [Sun, 2 Oct 2011 18:39:30 +0000 (20:39 +0200)]
unicode_empty and unicode_latin1 are PyObject* objects, not PyUnicodeObject*
Victor Stinner [Sun, 2 Oct 2011 18:35:10 +0000 (20:35 +0200)]
Check error when calling PyUnicode_AppendAndDel()
Victor Stinner [Sun, 2 Oct 2011 17:00:15 +0000 (19:00 +0200)]
PyCodec_ReplaceErrors() uses "C" format instead of "u#" to build result
Senthil Kumaran [Sun, 2 Oct 2011 23:28:00 +0000 (07:28 +0800)]
merge from 3.2 - Document message_body arg in HTTPConnection.endheaders