Commit graph

9370 commits

Author SHA1 Message Date
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
Victor Stinner
84ff4abd79 Merge 3.4 (datetime rounding) 2015-09-18 14:50:18 +02:00
Victor Stinner
511491ade0 Issue #23517: Fix rounding in fromtimestamp() and utcfromtimestamp() methods
of datetime.datetime: microseconds are now rounded to nearest with ties going
to nearest even integer (ROUND_HALF_EVEN), instead of being rounding towards
zero (ROUND_DOWN). It's important that these methods use the same rounding
mode than datetime.timedelta to keep the property:

   (datetime(1970,1,1) + timedelta(seconds=t)) == datetime.utcfromtimestamp(t)

It also the rounding mode used by round(float) for example.

Add more unit tests on the rounding mode in test_datetime.
2015-09-18 14:42:05 +02:00
Victor Stinner
9a8b177e60 Issue #25155: Add _PyTime_AsTimevalTime_t() function
On Windows, the tv_sec field of the timeval structure has the type C long,
whereas it has the type C time_t on all other platforms. A C long has a size of
32 bits (signed inter, 1 bit for the sign, 31 bits for the value) which is not
enough to store an Epoch timestamp after the year 2038.

Add the _PyTime_AsTimevalTime_t() function written for datetime.datetime.now():
convert a _PyTime_t timestamp to a (secs, us) tuple where secs type is time_t.
It allows to support dates after the year 2038 on Windows.

Enhance also _PyTime_AsTimeval_impl() to detect overflow on the number of
seconds when rounding the number of microseconds.
2015-09-18 13:36:17 +02:00
Victor Stinner
1e2b6882fc Issue #25155: Add _PyTime_AsTimevalTime_t() function
On Windows, the tv_sec field of the timeval structure has the type C long,
whereas it has the type C time_t on all other platforms. A C long has a size of
32 bits (signed inter, 1 bit for the sign, 31 bits for the value) which is not
enough to store an Epoch timestamp after the year 2038.

Add the _PyTime_AsTimevalTime_t() function written for datetime.datetime.now():
convert a _PyTime_t timestamp to a (secs, us) tuple where secs type is time_t.
It allows to support dates after the year 2038 on Windows.

Enhance also _PyTime_AsTimeval_impl() to detect overflow on the number of
seconds when rounding the number of microseconds.
2015-09-18 13:23:02 +02:00
Victor Stinner
024364a89a Merge 3.5 (os.waitpid) 2015-09-15 10:24:27 +02:00
Victor Stinner
d3ffd32767 Issue #25118: Fix a regression of Python 3.5.0 in os.waitpid() on Windows.
Add an unit test on os.waitpid()
2015-09-15 10:11:03 +02:00