Commit Graph

9126 Commits

Author SHA1 Message Date
Benjamin Peterson ea54d319d6 merge 3.5 (#25569) 2015-11-11 22:14:31 -08:00
Benjamin Peterson 86429bd174 merge 3.5 (#25569) 2015-11-11 22:14:08 -08:00
Benjamin Peterson eda06c8f5e fix memory leak in _get_crl_dp (closes #25569)
Patch started by Stéphane Wirtel.
2015-11-11 22:07:38 -08:00
Serhiy Storchaka fad85aadb0 Issue #25558: Use compile-time asserts. 2015-11-07 15:42:38 +02:00
Serhiy Storchaka 12b2538ab8 Reuse Py_STRINGIFY() macro in sre_lib.h and dynload_win.c. 2015-11-05 17:43:42 +02:00
Raymond Hettinger 4a91d21381 Neaten-up the inner-loop logic. 2015-11-03 22:00:26 -05:00
Serhiy Storchaka 4a7c03aab4 Issue #25523: Merge a-to-an corrections from 3.5. 2015-11-02 14:44:29 +02:00
Serhiy Storchaka f51d715845 Issue #25523: Further a-to-an corrections new in 3.5. 2015-11-02 14:40:41 +02:00
Serhiy Storchaka a84f6c3dd3 Issue #25523: Merge a-to-an corrections from 3.4. 2015-11-02 14:39:05 +02:00
Raymond Hettinger df8f5b56c9 Minor cleanup. 2015-11-02 07:27:40 -05:00
Serhiy Storchaka d65c9496da Issue #25523: Further a-to-an corrections. 2015-11-02 14:10:23 +02:00
Raymond Hettinger 0bdf9ea136 merge 2015-11-02 00:04:46 -05:00
Raymond Hettinger 67b97b8f8d Move the initial start-search out of the main loop so it can be factored-out later. 2015-11-01 23:57:37 -05:00
Martin Panter e56a919100 Issue #25523: Merge a-to-an corrections from 3.5 2015-11-02 04:27:17 +00:00
Martin Panter d2ad5718ad Issue #25523: Further a-to-an corrections new in 3.5 2015-11-02 04:20:33 +00:00
Martin Panter 2eb819f7a8 Issue #25523: Merge "a" to "an" fixes from 3.4 into 3.5 2015-11-02 04:04:57 +00:00
Martin Panter 7462b64911 Issue #25523: Correct "a" article to "an" article
This changes the main documentation, doc strings, source code comments, and a
couple error messages in the test suite. In some cases the word was removed
or edited some other way to fix the grammar.
2015-11-02 03:37:02 +00:00
Serhiy Storchaka dcd1a0309f Issue #25447: The lru_cache() wrapper objects now can be copied and pickled
(by returning the original object unchanged).
2015-10-24 09:50:19 +03:00
Serhiy Storchaka 45120f272b Issue #25447: The lru_cache() wrapper objects now can be copied and pickled
(by returning the original object unchanged).
2015-10-24 09:49:56 +03:00
Raymond Hettinger db41fd43cf Removed unused parameter 2015-10-22 22:48:16 -07:00
Raymond Hettinger 0f43bb160e Only update the state variable once per iteration. 2015-10-20 00:03:33 -07:00
Raymond Hettinger 20151f50f6 Issue #25414: Remove unnecessary tests that can never succeed. 2015-10-16 22:47:29 -07:00
Raymond Hettinger 1eca237c2f Remove old Todo entry that isn't going to happen. 2015-10-15 23:25:53 -07:00
Raymond Hettinger a4b13d0020 Rewrap comment. 2015-10-15 08:05:31 -07:00
Raymond Hettinger bc00341105 Use unsigned division 2015-10-14 23:33:23 -07:00
Raymond Hettinger 1286d14500 Improve variable names and constant expressions 2015-10-14 23:16:57 -07:00
Victor Stinner f9c9a3fedf Refactor binascii.rledecode_hqx()
Rewrite the code to handle the output buffer.
2015-10-14 15:20:07 +02:00
Victor Stinner 1bfe930585 Issue #25384: Fix binascii.rledecode_hqx()
Fix usage of _PyBytesWriter API. Use the new _PyBytesWriter_Resize() function
instead of _PyBytesWriter_Prepare().
2015-10-14 15:02:35 +02:00
Victor Stinner eaaaf136d2 Issue #25384: Use _PyBytesWriter API in binascii
This API avoids a final call to _PyBytes_Resize() for output smaller than 512
bytes.

Small optimization: disable overallocation in binascii.rledecode_hqx() for the
last write.
2015-10-13 10:51:47 +02:00
Victor Stinner f7d2471260 Merge 3.5 (sys.setrecursionlimit) 2015-10-13 00:16:07 +02:00
Victor Stinner 50856d5ae7 sys.setrecursionlimit() now raises RecursionError
Issue #25274: sys.setrecursionlimit() now raises a RecursionError if the new
recursion limit is too low depending at the current recursion depth. Modify
also the "lower-water mark" formula to make it monotonic. This mark is used to
decide when the overflowed flag of the thread state is reset.
2015-10-13 00:11:21 +02:00
Victor Stinner 358af13526 Issue #25353: Optimize unicode escape and raw unicode escape encoders to use
the new _PyBytesWriter API.
2015-10-12 22:36:57 +02:00
Raymond Hettinger 965362e92d Minor fixup. maxlen is already known. 2015-10-11 22:52:54 -07:00
Raymond Hettinger d96db09b57 Refactor the deque trim logic to eliminate the two separate trim functions. 2015-10-11 22:34:48 -07:00
Raymond Hettinger 6b1e113f9f Hoist the deque->maxlen lookup out of the inner-loop. 2015-10-11 09:43:50 -07:00
Victor Stinner e84c976568 Issue #25357: Add an optional newline paramer to binascii.b2a_base64().
base64.b64encode() uses it to avoid a memory copy.
2015-10-11 11:01:02 +02:00
Victor Stinner bc5b80bac1 Close #24784: Fix compilation without thread support
Add "#ifdef WITH_THREAD" around cals to:

* PyGILState_Check()
* _PyImport_AcquireLock()
* _PyImport_ReleaseLock()
2015-10-11 09:54:42 +02:00
Victor Stinner 92f0113701 Close #24784: Fix compilation without thread support
Add "#ifdef WITH_THREAD" around cals to:

* PyGILState_Check()
* _PyImport_AcquireLock()
* _PyImport_ReleaseLock()
2015-10-11 09:54:42 +02:00
Raymond Hettinger a7f63009d6 Minor tweak. Make the maxlen comparisons a little more clear and consistent. 2015-10-10 23:56:02 -04:00
Benjamin Peterson 90ccccf9ed merge 3.5 (#25371) 2015-10-10 19:32:41 -07:00
Benjamin Peterson e5df40727c merge 3.4 (#25371) 2015-10-10 19:32:33 -07:00
Benjamin Peterson b397e3b526 add a missing comma (closes #25371) 2015-10-10 19:32:20 -07:00
Serhiy Storchaka 0d554d7ef1 Issue #24164: Objects that need calling ``__new__`` with keyword arguments,
can now be pickled using pickle protocols older than protocol version 4.
2015-10-10 22:42:18 +03:00
Martin Panter a6d5038226 Issue #22413: Merge StringIO doc from 3.5 2015-10-10 10:20:25 +00:00
Martin Panter f264416093 Issue #22413: Remove comment made out of date by Argument Clinic 2015-10-10 10:17:57 +00:00
Martin Panter 994815e1d7 Issue #22413: Merge StringIO doc from 3.4 into 3.5 2015-10-10 10:15:21 +00:00
Martin Panter cfad54344f Issue #22413: Document newline effect on StringIO initializer and getvalue
Also add to comment in the C code.
2015-10-10 03:01:20 +00:00
Martin Panter 585a6acfef Merge typo fixes from 3.5 2015-10-07 11:13:55 +00:00
Martin Panter 3f930dcd87 Merge typo fixes from 3.4 into 3.5 2015-10-07 11:01:47 +00:00
Martin Panter 9955a373a8 Various minor typos in documentation and comments 2015-10-07 10:26:23 +00:00
Raymond Hettinger 848f2b595d Backport early-out 91259f061cfb to reduce the cost of bb1a2944bcb6 2015-10-06 23:06:17 -04:00
Raymond Hettinger 0443ac2860 Eliminate unnecessary test 2015-10-05 22:52:37 -04:00
Raymond Hettinger fd265f4a18 Factor out common iterator finalization code 2015-10-02 23:17:33 -07:00
Berker Peksag 6585501113 Issue #25290: Fix typo in csv.reader() docstring
Patch by Johannes Niediek.
2015-10-02 19:26:14 +03:00
Berker Peksag 987f215141 Issue #25290: Fix typo in csv.reader() docstring
Patch by Johannes Niediek.
2015-10-02 19:25:53 +03:00
Berker Peksag e2382c598c Issue #25290: Fix typo in csv.reader() docstring
Patch by Johannes Niediek.
2015-10-02 19:25:32 +03:00
Serhiy Storchaka 5dbe245ef2 Issue #24483: C implementation of functools.lru_cache() now calculates key's
hash only once.
2015-10-02 12:47:59 +03:00
Serhiy Storchaka b9d98d532c Issue #24483: C implementation of functools.lru_cache() now calculates key's
hash only once.
2015-10-02 12:47:11 +03:00
Raymond Hettinger 0d30940dd2 Add fast paths to deque_init() for the common cases 2015-09-30 23:15:02 -07:00
Raymond Hettinger 38031143fb Add an early-out for deque_clear() 2015-09-29 22:45:05 -07:00
Serhiy Storchaka 11c715f12e Issue #25262. Added support for BINBYTES8 opcode in Python implementation of
unpickler.  Highest 32 bits of 64-bit size for BINUNICODE8 and BINBYTES8
opcodes no longer silently ignored on 32-bit platforms in C implementation.
2015-09-29 22:13:01 +03:00
Serhiy Storchaka 525faaeffc Issue #25262. Added support for BINBYTES8 opcode in Python implementation of
unpickler.  Highest 32 bits of 64-bit size for BINUNICODE8 and BINBYTES8
opcodes no longer silently ignored on 32-bit platforms in C implementation.
2015-09-29 22:12:29 +03:00
Serhiy Storchaka e060619d4b Issue #25262. Added support for BINBYTES8 opcode in Python implementation of
unpickler.  Highest 32 bits of 64-bit size for BINUNICODE8 and BINBYTES8
opcodes no longer silently ignored on 32-bit platforms in C implementation.
2015-09-29 22:10:07 +03:00
Alexander Belopolsky 365ba8f6c1 Closes issue #23600: Wrong results from tzinfo.fromutc(). 2015-09-27 22:32:15 -04:00
Alexander Belopolsky edc6885b3f Closes issue #23600: Wrong results from tzinfo.fromutc(). 2015-09-27 22:31:45 -04:00
Alexander Belopolsky 5d27ed858a merge 2015-09-27 22:13:28 -04:00
Alexander Belopolsky d19b5042ff Closes issue #23600: Wrong results from tzinfo.fromutc(). 2015-09-27 21:56:53 -04:00
Alexander Belopolsky c58c2cb392 Closes issue #23600: Wrong results from tzinfo.fromutc(). 2015-09-27 21:56:09 -04:00
Alexander Belopolsky c79447b267 Closes issue #23600: Wrong results from tzinfo.fromutc(). 2015-09-27 21:41:55 -04:00
Serhiy Storchaka a6c5d53eec Issue #25203: Failed readline.set_completer_delims() no longer left the
module in inconsistent state.
2015-09-27 22:38:33 +03:00
Serhiy Storchaka 36aff2db4a Issue #25203: Failed readline.set_completer_delims() no longer left the
module in inconsistent state.
2015-09-27 22:38:01 +03:00
Serhiy Storchaka 1138439376 Issue #25203: Failed readline.set_completer_delims() no longer left the
module in inconsistent state.
2015-09-27 22:34:59 +03:00
Benjamin Peterson eca7172c3c merge 3.5 2015-09-27 02:14:29 -07:00
Benjamin Peterson a18bd0e0f0 merge 3.4 2015-09-27 02:14:23 -07:00
Benjamin Peterson 3c0769d478 fix spacing 2015-09-27 02:13:40 -07:00
Benjamin Peterson 2352a2f31d merge 3.5 (#25245) 2015-09-27 01:16:20 -07:00
Benjamin Peterson bdb93c3e63 merge 3.4 (#25245) 2015-09-27 01:16:12 -07:00
Benjamin Peterson 6aa1564e9c initialize return value to NULL to avoid compiler compliants (closes #25245) 2015-09-27 01:16:03 -07:00
Benjamin Peterson c78f27d239 merge 3.5 (#23329) 2015-09-27 00:09:09 -07:00
Benjamin Peterson d330822c12 detect alpn by feature flag not openssl version (closes #23329) 2015-09-27 00:09:02 -07:00
Raymond Hettinger 8299e9b59e Move the copy and clear functions upwards to eliminate unnecessary forward references. 2015-09-26 21:31:23 -07:00
Raymond Hettinger 7c0b70f419 Minor tweak to the order of variable updates. 2015-09-26 21:11:05 -07:00
Raymond Hettinger f2b02ced7e Bump up the maximum number of freeblocks 2015-09-26 17:47:02 -07:00
Raymond Hettinger c22eee6b59 Precomputing the number iterations allows the inner-loop to be vectorizable. 2015-09-26 02:14:50 -07:00
Raymond Hettinger 7a84552c84 Hoist constant expression out of an inner loop. 2015-09-26 01:30:51 -07:00
Raymond Hettinger e055b88937 merge 2015-09-26 00:15:46 -07:00
Raymond Hettinger bf49fee125 Issue #25135: Avoid possible reentrancy issues in deque_clear. 2015-09-26 00:14:59 -07:00
Benjamin Peterson 5b8854eee0 merge 3.5 2015-09-26 00:09:39 -07:00
Benjamin Peterson 03c59b9bef merge 3.4 2015-09-26 00:09:32 -07:00
Benjamin Peterson e48cf7e729 prevent overflow in _Unpickler_Read 2015-09-26 00:08:34 -07:00
Raymond Hettinger 2b0d646b75 Replace an unpredictable branch with a simple addition. 2015-09-23 19:15:44 -07:00
Raymond Hettinger 3a1a8d0424 Eliminate unnecessary variables 2015-09-23 02:42:02 -07:00
Steve Dower 8ef1db34bb Merge with 3.5 2015-09-22 17:01:17 -07:00
Steve Dower 57ab1cdb15 Issue #25092: Fix datetime.strftime() failure when errno was already set to EINVAL. 2015-09-22 14:51:42 -07:00
Raymond Hettinger 7a237230d1 Eliminate unnecessary variable 2015-09-22 01:20:36 -07:00
Raymond Hettinger d3d2b2c50c Minor consistency improvements to negative value comparisons. 2015-09-21 23:41:56 -07:00
Victor Stinner 5ebae87628 Issue #25207, #14626: Fix my commit.
It doesn't work to use #define XXX defined(YYY)" and then "#ifdef XXX"
to check YYY.
2015-09-22 01:29:33 +02:00
Victor Stinner 4552ced916 Issue #25207, #14626: Fix ICC compiler warnings in posixmodule.c
Replace "#if XXX" with #ifdef XXX".
2015-09-21 22:37:15 +02:00
Raymond Hettinger aed8830af3 Add a fast path (no iterator creation) for a common case for repeating deques of size 1 2015-09-19 09:05:42 -07:00
Raymond Hettinger 0e14e6610b Hoist constant expression out of an inner loop 2015-09-19 00:21:33 -06:00