Commit Graph

17757 Commits

Author SHA1 Message Date
Victor Stinner 2bf8993db9 Optimize bytes.fromhex() and bytearray.fromhex()
Issue #25401: Optimize bytes.fromhex() and bytearray.fromhex(): they are now
between 2x and 3.5x faster. Changes:

* Use a fast-path working on a char* string for ASCII string
* Use a slow-path for non-ASCII string
* Replace slow hex_digit_to_int() function with a O(1) lookup in
  _PyLong_DigitValue precomputed table
* Use _PyBytesWriter API to handle the buffer
* Add unit tests to check the error position in error messages
2015-10-14 11:25:33 +02:00
Victor Stinner ebcf9edc05 Document latest optimizations using _PyBytesWriter 2015-10-14 10:10:00 +02:00
Serhiy Storchaka dbc517c2dd Issue #25382: pickletools.dis() now outputs implicit memo index for the
MEMOIZE opcode.
2015-10-13 21:20:14 +03:00
Serhiy Storchaka ca77aef31b Issue #25380: Fixed protocol for the STACK_GLOBAL opcode in
pickletools.opcodes.
2015-10-13 21:14:01 +03:00
Serhiy Storchaka 5a8bbc5f2a Issue #25380: Fixed protocol for the STACK_GLOBAL opcode in
pickletools.opcodes.
2015-10-13 21:13:34 +03:00
Serhiy Storchaka 5805ddeedb Issue #25380: Fixed protocol for the STACK_GLOBAL opcode in
pickletools.opcodes.
2015-10-13 21:12:32 +03: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
Steve Dower 3628d488c7 Issue #25143: Improves installer error messages for unsupported platforms. 2015-10-11 16:40:52 -07:00
Steve Dower b96698112d Issue #25143: Improves installer error messages for unsupported platforms. 2015-10-11 16:40:41 -07:00
Steve Dower 5669387948 Issue #25163: Display correct directory in installer when using non-default settings. 2015-10-11 15:37:36 -07:00
Steve Dower 731f4a2c5f Issue #25163: Display correct directory in installer when using non-default settings. 2015-10-11 15:37:22 -07:00
Steve Dower 80b31402d5 Issue #25361: Disables use of SSE2 instructions in Windows 32-bit build 2015-10-11 15:16:21 -07:00
Steve Dower 5700ae877f Issue #25361: Disables use of SSE2 instructions in Windows 32-bit build 2015-10-11 15:15:52 -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
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
Serhiy Storchaka 0289155b72 Correct Misc/NEWS. 2015-10-10 20:26:16 +03:00
Serhiy Storchaka f98a24eecc Issue #25364: zipfile now works in threads disabled builds. 2015-10-10 19:44:23 +03:00
Serhiy Storchaka 9e777730eb Issue #25364: zipfile now works in threads disabled builds. 2015-10-10 19:43:32 +03:00
Martin Panter 430f657c67 Issue #25161: Merge full stops from 3.5 2015-10-10 10:45:00 +00:00
Martin Panter 84835ab1cb Issue #25161: Merge full stops from 3.4 into 3.5 2015-10-10 10:44:25 +00:00
Martin Panter d21e0b52f1 Issue #25161: Add full stops in documentation; patch by Takase Arihiro 2015-10-10 10:36:22 +00:00
Martin Panter 5344da5c0d Issue #24402: Merge input() fix from 3.5 2015-10-10 02:09:41 +00:00
Martin Panter e02f8fc44d Issue #24402: Merge input() fix from 3.4 into 3.5 2015-10-10 01:55:23 +00:00
Martin Panter c9a6ab56cf Issue #24402: Fix input() when stdout.fileno() fails; diagnosed by Eryksun
Also factored out some test cases into a new PtyTests class.
2015-10-10 01:25:38 +00:00
Brett Cannon 6381e06d97 Merge for issue #25099 2015-10-09 15:10:10 -07:00
Brett Cannon 89065d9fc7 Issue #25099: Skip relevant tests in test_compileall when an entry on
sys.path has an unwritable __pycache__ directory.

This typically comes up when someone runs the test suite from an
administrative install of Python on Windows where the user does not
have write permissions to the stdlib's directory.

Thanks to Zachary Ware and Matthias Klose for reporting bugs related
to this issue.
(grafted from 34bbd537b3e688dfbb6498e9083445a6a72fc4b1)
2015-10-09 15:09:43 -07:00
Brett Cannon 65ed750375 Issue #25099: Skip relevant tests in test_compileall when an entry on
sys.path has an unwritable __pycache__ directory.

This typically comes up when someone runs the test suite from an
administrative install of Python on Windows where the user does not
have write permissions to the stdlib's directory.

Thanks to Zachary Ware and Matthias Klose for reporting bugs related
to this issue.
2015-10-09 15:09:43 -07:00
R David Murray aecf63ee3a Merge #25328: add missing raise keyword in decode_data+SMTPUTF8 check. 2015-10-09 10:20:58 -04:00
R David Murray 1a815389cc #25328: add missing raise keyword in decode_data+SMTPUTF8 check.
This is a relatively benign bug, since having both be true was correctly
rejected at in SMTPServer even before this patch.

Patch by Xiang Zhang.
2015-10-09 10:19:33 -04:00
Victor Stinner fa7762ec06 Issue #25349: Optimize bytes % args using the new private _PyBytesWriter API
* Thanks to the _PyBytesWriter API, output smaller than 512 bytes are allocated
  on the stack and so avoid calling _PyBytes_Resize(). Because of that, change
  the default buffer size to fmtcnt instead of fmtcnt+100.
* Rely on _PyBytesWriter algorithm to overallocate the buffer instead of using
  a custom code. For example, _PyBytesWriter uses a different overallocation
  factor (25% or 50%) depending on the platform to get best performances.
* Disable overallocation for the last write.
* Replace C loops to fill characters with memset()
* Add also many comments to _PyBytes_Format()
* Remove unused FORMATBUFLEN constant
* Avoid the creation of a temporary bytes object when formatting a floating
  point number (when no custom formatting option is used)
* Fix also reference leaks on error handling
* Use Py_MEMCPY() to copy bytes between two formatters (%)
2015-10-09 11:48:06 +02:00
Steve Dower 6e8d6ed2f4 Merge from 3.5 2015-10-08 10:00:55 -07:00
Steve Dower 5ae56919ab Issue #25089: Adds logging to installer for case where launcher is not selected on upgrade. 2015-10-08 09:55:49 -07:00
Steve Dower 666e6e1b4b Merge from 3.5 2015-10-08 09:06:39 -07:00
Steve Dower 12ee7448f8 Issue #23919: Prevents assert dialogs appearing in the test suite. 2015-10-08 08:56:06 -07:00
Berker Peksag 960e848f0d Issue #16099: RobotFileParser now supports Crawl-delay and Request-rate
extensions.

Patch by Nikolay Bogoychev.
2015-10-08 12:27:06 +03:00
Martin Panter 585a6acfef Merge typo fixes from 3.5 2015-10-07 11:13:55 +00:00
Martin Panter ec1aa5c2a1 More typos in 3.5 documentation and comments 2015-10-07 11:03:53 +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
Benjamin Peterson cdae2cb88a merge 3.5 (closes #24806) 2015-10-06 19:42:46 -07:00
Benjamin Peterson 59dc696821 merge 3.4 (#24806) 2015-10-06 19:42:02 -07:00
Benjamin Peterson bd6c41a185 prevent unacceptable bases from becoming bases through multiple inheritance (#24806) 2015-10-06 19:36:54 -07:00
Alexander Belopolsky 68713e41a5 Closes issue #12006: Add ISO 8601 year, week, and day directives to strptime.
This commit adds %G, %V, and %u directives to strptime.  Thanks Ashley Anderson
for the implementation.
2015-10-06 13:29:56 -04:00
Benjamin Peterson 1ba1ca0456 merge 3.5 (#25319) 2015-10-05 22:01:29 -07:00
Benjamin Peterson 72181b2f53 merge 3.4 (#25319) 2015-10-05 22:00:33 -07:00
Benjamin Peterson 15982aad2b reinitialize an Event's Condition with a regular lock (closes #25319) 2015-10-05 21:56:22 -07:00
Steve Dower f536386ca9 Issue #25316: distutils raises OSError instead of DistutilsPlatformError when MSVC is not installed. 2015-10-05 10:35:19 -07:00
Steve Dower f0ccf02e56 Issue #25316: distutils raises OSError instead of DistutilsPlatformError when MSVC is not installed. 2015-10-05 10:35:00 -07:00
Guido van Rossum 3074c134a9 Issue #23972: updates to asyncio datagram API. By Chris Laws. (Merge 3.5->3.6.) 2015-10-05 09:29:32 -07:00