Commit Graph

4509 Commits

Author SHA1 Message Date
Benjamin Peterson 9892f52145 avoid a function call with redundant checks for dict size 2012-10-31 14:22:12 -04:00
Benjamin Peterson 7503e08588 merge 3.3 (#16345) 2012-10-31 14:10:04 -04:00
Benjamin Peterson d97eb0d338 merge 3.2 (#16345) 2012-10-31 14:09:11 -04:00
Benjamin Peterson d1f2cb37a2 only fast-path fromkeys() when the constructor returns a empty dict (closes #16345) 2012-10-31 14:05:55 -04:00
Benjamin Peterson 3cb90241fc merge 3.3 2012-10-31 00:04:42 -04:00
Benjamin Peterson 2c05a2e01b do safety checks on __qualname__ assignment 2012-10-31 00:01:15 -04:00
Benjamin Peterson 8afa7fa510 don't shadow the __qualname__ descriptor with __qualname__ in the class's __dict__ (closes #16271) 2012-10-30 23:51:03 -04:00
Benjamin Peterson 42124a727d initialize map/filter/zip in _PyBuiltin_Init rather than the catch-all function 2012-10-30 23:41:54 -04:00
Benjamin Peterson 7ff2094bc7 merge 3.3 (#16369) 2012-10-30 23:31:12 -04:00
Benjamin Peterson e8ea97fffb merge 3.2 (#16369) 2012-10-30 23:27:52 -04:00
Benjamin Peterson c43112823b initialize more global type objects (closes #16369) 2012-10-30 23:21:10 -04:00
Victor Stinner 7a6d7cf3db Issue #9566: Use the right type to fix a compiler warnings on Win64 2012-10-31 00:37:41 +01:00
Victor Stinner 4ca1cf35fb Issue #16086: PyTypeObject.tp_flags and PyType_Spec.flags are now unsigned
... (unsigned long and unsigned int) to avoid an undefined behaviour with
Py_TPFLAGS_TYPE_SUBCLASS ((1 << 31). PyType_GetFlags() result type is now
unsigned too (unsigned long, instead of long).
2012-10-30 23:40:45 +01:00
Victor Stinner e64322e034 Close #14625: Rewrite the UTF-32 decoder. It is now 3x to 4x faster
Patch written by Serhiy Storchaka.
2012-10-30 23:12:47 +01:00
Victor Stinner 76df43de30 Issue #16330: Use surrogate-related macros
Patch written by Serhiy Storchaka.
2012-10-30 01:42:39 +01:00
Mark Dickinson fb90c0934c Issue #14700: Fix buggy overflow checks for large precision and width in new-style and old-style formatting. 2012-10-28 10:18:03 +00:00
Victor Stinner c6cf1ba29e Replace usage of the deprecated Py_UNICODE_COPY() with Py_MEMCPY() in resize_copy() 2012-10-23 02:54:47 +02:00
Victor Stinner fe75fb4b3e Optimize _PyUnicode_HasNULChars(): use findchar() instead of PyUnicode_Contains() 2012-10-23 02:52:18 +02:00
Victor Stinner 6fa627578a Inline raise_translate_exception(): it is only used once 2012-10-23 02:51:50 +02:00
Victor Stinner e5567ad236 Optimize PyUnicode_RichCompare() for Py_EQ and Py_NE: always use memcmp() 2012-10-23 02:48:49 +02:00
Antoine Pitrou 6f7b0da6bc Issue #12805: Make bytes.join and bytearray.join faster when the separator is empty.
Patch by Serhiy Storchaka.
2012-10-20 23:08:34 +02:00
Mark Dickinson e453e4c007 Issue 16280: Drop questionable special-casing of null pointer in PyLong_FromVoidPtr. 2012-10-18 22:18:42 +01:00
Mark Dickinson 5cb65917e1 Issue #16277: merge fix from 3.3 2012-10-18 19:53:45 +01:00
Mark Dickinson 44362a88ad Issue #16277: merge fix from 3.2 2012-10-18 19:53:28 +01:00
Mark Dickinson 91044799f7 Issue #16277: in PyLong_FromVoidPtr, add missing branch for sizeof(void*) <= sizeof(long). 2012-10-18 19:21:43 +01:00
Christian Heimes 743e0cd6b5 Issue #16166: Add PY_LITTLE_ENDIAN and PY_BIG_ENDIAN macros and unified
endianess detection and handling.
2012-10-17 23:52:17 +02:00
Eric Snow 42da889fec merge for issue #16160: Subclass support now works for types.SimpleNamespace. 2012-10-16 22:45:49 -07:00
Eric Snow 547298c94c Close #16160: Subclass support now works for types.SimpleNamespace. Thanks to RDM for noticing. 2012-10-16 22:35:38 -07:00
Antoine Pitrou cfc22b4a9b Issue #15958: bytes.join and bytearray.join now accept arbitrary buffer objects. 2012-10-16 21:07:23 +02:00
Chris Jerdonek 4a7df9aba9 Issue #14783: Merge changes from 3.3. 2012-10-07 15:02:16 -07:00
Chris Jerdonek 042fa653ab Issue #14783: Merge changes from 3.2. 2012-10-07 14:56:27 -07:00
Chris Jerdonek 83fe2e1c22 Issue #14783: Improve int() docstring and also str(), range(), and slice().
This commit rewrites the docstring for int() to incorporate the documentation
changes made in issue #16036.  It also switches the docstrings for int(),
str(), range(), and slice() to use multi-line signatures.
2012-10-07 14:48:36 -07:00
Armin Ronacher 74b38b190f Issue #16148: Small improvements and cleanup. Added version information
to docs.
2012-10-07 10:29:32 +02:00
Victor Stinner 4c63a972d1 Cleanup PyUnicode_FromFormatV() for zero padding
Skip the "0" instead of parsing it twice: detect zero padding and then parsed
as a digit of the width.
2012-10-06 23:55:33 +02:00
Victor Stinner 15a1136547 Issue #16147: PyUnicode_FromFormatV() doesn't need anymore to allocate a buffer
on the heap to format numbers.
2012-10-06 23:48:20 +02:00
Victor Stinner ff5a848db5 Issue #16147: PyUnicode_FromFormatV() now raises an error if the argument of
'%c' is not in the range(0x110000).
2012-10-06 23:05:45 +02:00
Victor Stinner 3921e90c5a Issue #16147: PyUnicode_FromFormatV() now detects integer overflow when parsing
width and precision
2012-10-06 23:05:00 +02:00
Victor Stinner e215d960be Issue #16147: Rewrite PyUnicode_FromFormatV() to use _PyUnicodeWriter API
* Simplify the code: replace 4 steps with one unique step using the
   _PyUnicodeWriter API. PyUnicode_Format() has the same design. It avoids to
   store intermediate results which require to allocate an array of pointers on
   the heap.
 * Use the _PyUnicodeWriter API for speed (and its convinient API):
   overallocate the buffer to reduce the number of "realloc()"
 * Implement "width" and "precision" in Python, don't rely on sprintf(). It
   avoids to need of a temporary buffer allocated on the heap: only use a small
   buffer allocated in the stack.
 * Add _PyUnicodeWriter_WriteCstr() function
 * Split PyUnicode_FromFormatV() into two functions: add
   unicode_fromformat_arg().
 * Inline parse_format_flags(): the format of an argument is now only parsed
   once, it's no more needed to have a subfunction.
 * Optimize PyUnicode_FromFormatV() for characters between two "%" arguments:
   search the next "%" and copy the substring in one chunk, instead of copying
   character per character.
2012-10-06 23:03:36 +02:00
Mark Dickinson cf46d62fcb Issue #16096: port fix from 3.3 2012-10-06 18:50:19 +01:00
Mark Dickinson fc9adb62fb Issue #16096: Fix signed overflow in Objects/longobject.c. Thanks Serhiy Storchaka. 2012-10-06 18:50:02 +01:00
Mark Dickinson ff9c54aca2 Issue #16096: Merge fixes from 3.3. 2012-10-06 18:05:14 +01:00
Mark Dickinson c04ddff290 Issue #16096: Fix several occurrences of potential signed integer overflow. Thanks Serhiy Storchaka. 2012-10-06 18:04:49 +01:00
Christian Heimes b70e8a1958 and another one 2012-10-06 17:16:39 +02:00
Christian Heimes 6314d164c9 move var declaration to top of block to fix compilation on Windows, fixes a7ec0a1b0f7c 2012-10-06 17:13:29 +02:00
Armin Ronacher 23c5bb4030 Fixed a missing incref introduced by a7ec0a1b0f7c 2012-10-06 14:30:32 +02:00
Armin Ronacher 226b1db0e2 Added notimplemented_dealloc for better error reporting 2012-10-06 14:28:58 +02:00
Armin Ronacher aa9a79d279 Issue #16148: implemented PEP 424 2012-10-06 14:03:24 +02:00
Victor Stinner 8c6db45d3e In debug mode, unicode_write_cstr() now checks that non-ASCII characters are
not written into an ASCII string
2012-10-06 00:40:45 +02:00
Ezio Melotti 080a2c087e #16127: merge with 3.3. 2012-10-05 03:34:02 +03:00
Ezio Melotti e7f90375b1 #16127: remove outdated references to narrow builds. Patch by Serhiy Storchaka. 2012-10-05 03:33:31 +03:00
Victor Stinner 1929407406 Fix PyUnicode_Format(): return NULL if PyUnicode_READY(uformat) failed
This error cannot occur in practice: PyUnicode_FromObject() always return
a "ready" string.
2012-10-05 00:09:33 +02:00
Victor Stinner 770e19e0cc Optimize unicode_compare(): use memcmp() when comparing two UCS1 strings 2012-10-04 22:59:45 +02:00
Victor Stinner 90db9c47dc Enable also ptr==ptr optimization in PyUnicode_Compare()
It was already implemented in PyUnicode_RichCompare()
2012-10-04 21:53:50 +02:00
Victor Stinner 9cc98c93a7 long_to_decimal_string_internal() doesn't need to write the final NULL character 2012-10-04 02:43:02 +02:00
Victor Stinner aa7712711d unicode_result_wchar(): move the assert() to the "#ifdef Py_DEBUG" block 2012-10-04 02:32:58 +02:00
Victor Stinner a4708231e6 Split the huge PyUnicode_Format() function (+540 lines) into subfunctions 2012-10-04 02:19:54 +02:00
Victor Stinner a049443fab PyUnicode_Format(): disable overallocation when we are writing the last part
of the output string
2012-10-03 23:03:46 +02:00
Victor Stinner afffce489b Unicode: resize_compact() and resize_inplace() fills also the Unicode strings
with invalid bytes in debug mode, as done by PyUnicode_New()
2012-10-03 23:03:17 +02:00
Victor Stinner c89d28fdfc Issue #15609: Fix refleak introduced by my last optimization 2012-10-02 12:54:07 +02:00
Victor Stinner 621ef3d84f Issue #15609: Optimize str%args for integer argument
- Use _PyLong_FormatWriter() instead of formatlong() when possible, to avoid
   a temporary buffer
 - Enable the fast path when width is smaller or equals to the length,
   and when the precision is bigger or equals to the length
 - Add unit tests!
 - formatlong() uses PyUnicode_Resize() instead of _PyUnicode_FromASCII()
   to resize the output string
2012-10-02 00:33:47 +02:00
Benjamin Peterson b8350f1c7d upgrade to UCD 6.2 2012-09-29 13:47:39 -04:00
Ezio Melotti 0e1af282b8 Fix typo. 2012-09-28 16:43:40 +03:00
Mark Dickinson 7c95bb35e4 Issue #16060: Fix a double DECREF in int() implementation. Thanks Serhiy Storchaka. 2012-09-27 19:38:59 +01:00
Antoine Pitrou a1f7655fa7 Issue #15379: Fix passing of non-BMP characters as integers for the charmap decoder (already working as unicode strings).
Patch by Serhiy Storchaka.
2012-09-23 20:00:04 +02:00
Antoine Pitrou 6f80f5d444 Issue #15379: Fix passing of non-BMP characters as integers for the charmap decoder (already working as unicode strings).
Patch by Serhiy Storchaka.
2012-09-23 19:55:21 +02:00
Mark Dickinson 5710c2a3e8 Issue 15959: Merge from 3.2. 2012-09-20 21:30:34 +01:00
Mark Dickinson c286e58044 Issue 15959: Fix type mismatch for quick{_neg}_int_allocs. Thanks Serhiy Storchaka. 2012-09-20 21:29:28 +01:00
Antoine Pitrou ca8aa4acf6 Issue #15144: Fix possible integer overflow when handling pointers as integer values, by using Py_uintptr_t instead of size_t.
Patch by Serhiy Storchaka.
2012-09-20 20:56:47 +02:00
Trent Nelson da064d0745 Silence compiler warnings on Solaris 10 via explicit (void *) casts. 2012-09-18 22:00:25 -04:00
Trent Nelson ab02db23b1 Silence compiler warnings on Solaris 10 via explicit (void *) casts.
(Compiler: Solaris Studio 12.3)
2012-09-18 21:58:03 -04:00
Christian Heimes 7ae251a025 Fix out of bounds read in long_new() for empty bytes with an explicit base. int(b'', somebase) calls PyLong_FromString() with char* of length 1 but the function accesses the first argument at offset 1. CID 715359 2012-09-12 15:32:06 +02:00
Christian Heimes 79b97ee2ab Fix out of bounds read in long_new() for empty bytes with an explicit base. int(b'', somebase) calls PyLong_FromString() with char* of length 1 but the function accesses the first argument at offset 1. CID 715359 2012-09-12 15:31:43 +02:00
Christian Heimes 5f520f4fed Issue #15900: Fixed reference leak in PyUnicode_TranslateCharmap() 2012-09-11 14:03:25 +02:00
Christian Heimes 76c082911b Fixed memory leak in error branch of object_repr which may leak a reference to mod when type_qualname returns NULL. CID 715371 2012-09-10 17:00:30 +02:00
Christian Heimes e81dc296f2 Fixed memory leak in error branch of object_repr which may leak a reference to mod when type_name returns NULL. CID 715371 2012-09-10 16:57:36 +02:00
Christian Heimes f4f9939a96 Fixed memory leak in error branch of formatfloat(). CID 719687 2012-09-10 11:48:41 +02:00
Christian Heimes 455657961e Fixed possible reference leak to mod when type_name() returns NULL 2012-09-10 03:01:16 +02:00
Christian Heimes a0e7e41cba Fixed possible reference leak to mod when type_name() returns NULL 2012-09-10 03:00:14 +02:00
Christian Heimes c4fe3fed6e PyTuple_Pack() was missing va_end() in its error branch which lead to a resource leak. 2012-09-10 02:55:13 +02:00
Christian Heimes d5a88044a3 PyTuple_Pack() was missing va_end() in its error branch which lead to a resource leak. 2012-09-10 02:54:51 +02:00
Christian Heimes 110ac16b9f Fixed resource leak to scratch when _PyUnicodeWriter_Prepare fails 2012-09-10 02:51:27 +02:00
Christian Heimes f03572d040 Py_TYPE() has already dereferenced self before the NULL check. Moved Py_TYPE() after the check for self == NULL 2012-09-10 02:45:56 +02:00
Christian Heimes 949f331731 Py_TYPE() has already dereferenced self before the NULL check. Moved Py_TYPE() after the check for self == NULL 2012-09-10 02:45:31 +02:00
Antoine Pitrou 5b4faae307 Issue #13992: The trashcan mechanism is now thread-safe. This eliminates
sporadic crashes in multi-thread programs when several long deallocator
chains ran concurrently and involved subclasses of built-in container
types.

Note that the trashcan functions are part of the stable ABI, therefore
they have to be kept around for binary compatibility of extensions.
2012-09-06 01:17:42 +02:00
Antoine Pitrou 56cd62c04a Issue #13992: The trashcan mechanism is now thread-safe. This eliminates
sporadic crashes in multi-thread programs when several long deallocator
chains ran concurrently and involved subclasses of built-in container
types.

Because of this change, a couple extension modules compiled for 3.2.4
(those which use the trashcan mechanism, despite it being undocumented)
will not be loadable by 3.2.3 and earlier. However, extension modules
compiled for 3.2.3 and earlier will be loadable by 3.2.4.
2012-09-06 00:59:49 +02:00
Alexander Belopolsky f73c69e06f Issue #15855: added docstrings for memoryview methods and data descriptors new in 3.3. 2012-09-03 16:51:01 -04:00
Alexander Belopolsky e370c38131 Issue #15855: added docstrings for memoryview methods and data descriptors (merge 3.2). 2012-09-03 16:43:55 -04:00
Alexander Belopolsky 397e5c98bc Issue #15855: added docstrings for memoryview methods and data descriptors. 2012-09-03 16:29:11 -04:00
Antoine Pitrou 057119b0b7 Fix C++-style comment (xlc compilation failure) 2012-09-02 17:56:33 +02:00
Benjamin Peterson 6a42bd67d7 Make super() internal errors RuntimeError instead of SystemError (closes #15839) 2012-09-01 23:04:38 -04:00
Benjamin Peterson 4e07a8c9aa merge heads 2012-08-28 18:02:18 -04:00
Benjamin Peterson 59043f96ea merge 3.2 (#15801) 2012-08-28 18:01:45 -04:00
Benjamin Peterson 28a6cfaefc use the stricter PyMapping_Check (closes #15801) 2012-08-28 17:55:35 -04:00
Richard Oudkerk ea62bd50a3 Issue #15784: Modify OSError.__str__() to better distinguish between
errno error numbers and Windows error numbers.
2012-08-28 19:33:26 +01:00
Nick Coghlan 06e1ab0a6b Close #15573: use value-based memoryview comparisons (patch by Stefan Krah) 2012-08-25 17:59:50 +10:00
Brett Cannon 07c6e71689 Issue #15778: Coerce ImportError.args to a string when it isn't
already one.

Patch by Dave Malcolm.
2012-08-24 13:05:09 -04:00
Stefan Krah 5b27c53e36 Merge 3.2. 2012-08-21 08:25:41 +02:00
Stefan Krah 7cacd2eb92 Issue #15736: Fix overflow in _PySequence_BytesToCharpArray(). 2012-08-21 08:16:09 +02:00
Stefan Krah 6adf2433e4 Merge 3.2. 2012-08-20 11:13:58 +02:00
Stefan Krah fd24f9e51e Issue #15732: Fix (constructed) crash in _PySequence_BytesToCharpArray().
Found by Coverity.
2012-08-20 11:04:24 +02:00
Stefan Krah 8528c3145e Issue #15728: Fix leak in PyUnicode_AsWideCharString(). Found by Coverity. 2012-08-19 21:52:43 +02:00
Stefan Krah 7fda33b56a Mereg 3.2. 2012-08-19 11:22:28 +02:00
Stefan Krah 6b962860e2 Check for NULL return value in PyStructSequence_NewType(). Found by Coverity. 2012-08-19 11:20:41 +02:00
Nick Coghlan 0e41628d35 Merge str docstring fix from 3.2 2012-08-16 14:14:30 +10:00
Nick Coghlan 573b1fd779 Fix str docstring 2012-08-16 14:13:07 +10:00
Antoine Pitrou 721738fbee Issue #15604: Update uses of PyObject_IsTrue() to check for and handle errors correctly.
Patch by Serhiy Storchaka.
2012-08-15 23:20:39 +02:00
Antoine Pitrou 6f430e4963 Issue #15604: Update uses of PyObject_IsTrue() to check for and handle errors correctly.
Patch by Serhiy Storchaka.
2012-08-15 23:18:25 +02:00
Victor Stinner b3f5501250 Close #15534: Fix a typo in the fast search function of the string library (_s => s)
Replace _s with ptr to avoid future confusion. Add also non regression tests.
2012-08-02 23:05:01 +02:00
Richard Oudkerk 5562d9dc5d Issue #1692335: Move initial args assignment to BaseException.__new__
to help pickling of naive subclasses.
2012-07-28 17:45:28 +01:00
Stefan Krah e4c0799d9c Add unused parameter to a METH_NOARGS function. 2012-07-28 14:10:02 +02:00
Stefan Krah 7d12d9df13 Issue #12834: Fix PyBuffer_ToContiguous() for non-contiguous arrays. 2012-07-28 12:25:55 +02:00
Martin v. Löwis 3bbd2fad4d Issue #15456: Fix code __sizeof__ after #12399 change.
Patch by Serhiy Storchaka.
2012-07-26 22:23:23 +02:00
Antoine Pitrou b4bbee25b1 Issue #14579: Fix CVE-2012-2135: vulnerability in the utf-16 decoder after error handling.
Patch by Serhiy Storchaka.
2012-07-21 00:45:14 +02:00
Andrew Svetlov a0364764fd Merge 3.2 2012-07-20 14:52:54 +03:00
Andrew Svetlov ddcb6206bf Issue #15404: Refleak in PyMethodObject repr. 2012-07-20 14:51:45 +03:00
Meador Inge f4cc2161d5 Issue #15394: Fix ref leaks in PyModule_Create.
Patch by Julia Lawall.
2012-07-19 13:51:59 -05:00
Meador Inge 29e49d6394 Issue #15394: Fix ref leaks in PyModule_Create.
Patch by Julia Lawall.
2012-07-19 13:45:43 -05:00
Mark Dickinson 01ac8b6ab1 Use correct types for ASCII_CHAR_MASK integer constants. 2012-07-07 14:08:48 +02:00
Antoine Pitrou f87289bb58 Issue #15229: An OSError subclass whose __init__ doesn't call back
OSError.__init__ could produce incomplete instances, leading to crashes
when calling str() on them.
2012-06-30 23:37:47 +02:00
Antoine Pitrou a504a7a7d1 Issue #15055: update dictnotes.txt. Patch by Mark Shannon. 2012-06-24 21:03:45 +02:00
Antoine Pitrou 66a3a7ed10 Try to fix crash on x86 OpenIndiana buildbot. 2012-06-24 00:42:59 +02:00
Antoine Pitrou 1351ca6e66 Replace assert() with a more informative fatal error. 2012-06-24 00:30:12 +02:00
Antoine Pitrou bb78f57c14 Use struct member (ht_type) instead of casting pointers. 2012-06-24 00:18:27 +02:00
Martin v. Löwis 9c56409d33 Issue #15146: Add PyType_FromSpecWithBases. Patch by Robin Schreiber. 2012-06-23 23:20:45 +02:00
Mark Dickinson 106c4145ff Issue #14923: Optimize continuation-byte check in UTF-8 decoding. Patch by Serhiy Storchaka. 2012-06-23 21:45:14 +01:00
Antoine Pitrou 99cc629969 Issue #15142: Fix reference leak when deallocating instances of types created using PyType_FromSpec(). 2012-06-23 14:42:38 +02:00
Antoine Pitrou a4db02c7a3 Issue #15142: Fix reference leak when deallocating instances of types created using PyType_FromSpec(). 2012-06-23 14:45:21 +02:00
David Malcolm 49526f48fc Issue #14785: Add sys._debugmallocstats() to help debug low-level memory allocation issues 2012-06-22 14:55:41 -04:00
Antoine Pitrou a759d4e9f4 Make private function static (from `make smelly`) 2012-06-21 17:26:28 +02:00
Nick Coghlan 5b0dac12b8 Issue #13783: PEP 380 cleanup part 2, using the new identifier APIs in the generator implementation 2012-06-17 15:45:11 +10:00
Nick Coghlan c40bc09942 Issue #13783: the PEP 380 implementation no longer expands the public C API 2012-06-17 15:15:49 +10:00
Antoine Pitrou aaefac76dd Issue #14874: Restore charmap decoding speed to pre-PEP 393 levels.
Patch by Serhiy Storchaka.
2012-06-16 22:48:21 +02:00
Victor Stinner f185226244 _copy_characters(): move debug code at the top to avoid noisy #ifdef
And don't use assert() anymore if check_maxchar is set: return -1 on error
instead.
2012-06-16 16:38:26 +02:00
Victor Stinner 07621338fb Fix PyUnicode_GetSize(): Don't replace _PyUnicode_Ready() exception 2012-06-16 04:53:46 +02:00
Victor Stinner 8a8b3eaabe Fix a compiler warning in _copy_characters() and remove debug code 2012-06-16 04:53:25 +02:00
Victor Stinner 24e403bbee Oops, fix my previous change on _copy_characters() 2012-06-16 04:53:00 +02:00
Victor Stinner ca439eecea Fix unicode_adjust_maxchar(): catch PyUnicode_New() failure 2012-06-16 03:17:34 +02:00
Victor Stinner 184252ad3f Fix "%f" format of str%args if the result is not an ASCII or latin1 string 2012-06-16 02:57:41 +02:00
Victor Stinner 9a77770add Remove debug code 2012-06-16 02:44:43 +02:00
Victor Stinner c9d369f1bf Optimize _PyUnicode_FastCopyCharacters() when maxchar(from) > maxchar(to) 2012-06-16 02:22:37 +02:00
Victor Stinner f05e17ece9 unicodeobject.c: Remove debug code 2012-06-16 01:53:04 +02:00
Antoine Pitrou 27f6a3b0bf Issue #15026: utf-16 encoding is now significantly faster (up to 10x).
Patch by Serhiy Storchaka.
2012-06-15 22:15:23 +02:00
Kristján Valur Jónsson 55e5dc8371 Rearrange code to beat an optimizer bug affecting Release x64 on windows
with VS2010sp1
2012-06-06 21:58:08 +00:00
Victor Stinner d7b7c7472b Issue #14993: Use standard "unsigned char" instead of a unsigned char bitfield 2012-06-04 22:52:12 +02:00
Barry Warsaw 409da157d7 Eric Snow's implementation of PEP 421.
Issue 14673: Add sys.implementation
2012-06-03 16:18:47 -04:00
Kristjan Valur Jonsson 85634d7a2e Issue #14909: A number of places were using PyMem_Realloc() apis and
PyObject_GC_Resize() with incorrect error handling.  In case of errors,
the original object would be leaked.  This checkin fixes those cases.
2012-05-31 09:37:31 +00:00
Victor Stinner 3a7d096f2f Issue #14744: Fix compilation on Windows (part 2) 2012-05-29 18:53:56 +02:00
Victor Stinner e577ab38ea Issue #14744: Fix compilation on Windows 2012-05-29 18:51:10 +02:00
Victor Stinner d3f0882dfb Issue #14744: Use the new _PyUnicodeWriter internal API to speed up str%args and str.format(args)
* Formatting string, int, float and complex use the _PyUnicodeWriter API. It
   avoids a temporary buffer in most cases.
 * Add _PyUnicodeWriter_WriteStr() to restore the PyAccu optimization: just
   keep a reference to the string if the output is only composed of one string
 * Disable overallocation when formatting the last argument of str%args and
   str.format(args)
 * Overallocation allocates at least 100 characters: add min_length attribute
   to the _PyUnicodeWriter structure
 * Add new private functions: _PyUnicode_FastCopyCharacters(),
   _PyUnicode_FastFill() and _PyUnicode_FromASCII()

The speed up is around 20% in average.
2012-05-29 12:57:52 +02:00
Richard Oudkerk 3e0a1eb889 Issue #14930: Make memoryview objects weakrefable. 2012-05-28 21:35:09 +01:00