summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* bpo-37994: Fix silencing all errors if an attribute lookup fails. (GH-15630)Serhiy Storchaka2019-09-015-22/+28
| | | Only AttributeError should be silenced.
* bpo-36543: Remove old-deprecated ElementTree features. (GH-12707)Serhiy Storchaka2019-09-012-114/+1
| | | | | Remove methods Element.getchildren(), Element.getiterator() and ElementTree.getiterator() and the xml.etree.cElementTree module.
* bpo-37990: fix gc stats (GH-15626)Inada Naoki2019-08-311-2/+3
|
* Fix typos mostly in comments, docs and test names (GH-15209)Min ho Kim2019-08-308-11/+11
|
* bpo-37140: Fix StructUnionType_paramfunc() (GH-15612)Victor Stinner2019-08-301-14/+59
| | | | | | | | | | | | Fix a ctypes regression of Python 3.8. When a ctypes.Structure is passed by copy to a function, ctypes internals created a temporary object which had the side effect of calling the structure finalizer (__del__) twice. The Python semantics requires a finalizer to be called exactly once. Fix ctypes internals to no longer call the finalizer twice. Create a new internal StructParam_Type which is only used by _ctypes_callproc() to call PyMem_Free(ptr) on Py_DECREF(argument). StructUnionType_paramfunc() creates such object.
* bpo-37976: Prevent shadowing of TypeError in zip() (GH-15592)Sergey Fedoseev2019-08-301-4/+0
|
* bpo-37933: Fix faulthandler.cancel_dump_traceback_later() (GH-15440)Thomas A Caswell2019-08-291-0/+5
| | | | Fix faulthandler.cancel_dump_traceback_later() call if cancel_dump_traceback_later() was not called previously.
* bpo-37034: Display argument name on errors with keyword arguments with ↵Rémi Lapeyre2019-08-2939-332/+332
| | | | Argument Clinic. (GH-13593)
* bpo-36833: Add tests for Datetime C API Macros (GH-14842)Joannah Nanjekye2019-08-291-0/+53
| | | | Added tests for PyDateTime_xxx_GET_xxx() macros of the C API of the datetime module.
* bpo-37372: Fix error unpickling datetime.time objects from Python 2 with ↵Justin Blanchard2019-08-291-1/+1
| | | | seconds>=24. (GH-14307)
* bpo-37960: Silence only necessary errors in repr() of buffered and text ↵Serhiy Storchaka2019-08-292-18/+16
| | | | streams. (GH-15543)
* Raise a RuntimeError when tee iterator is consumed from different threads ↵HongWeipeng2019-08-291-0/+8
| | | | (GH-15567)
* closes bpo-37964: add F_GETPATH command to fcntl (GH-15550)Vinay Sharma2019-08-291-0/+3
| | | | | | | https://bugs.python.org/issue37964 Automerge-Triggered-By: @benjaminp
* bpo-37951: Lift subprocess's fork() restriction (GH-15544)Christian Heimes2019-08-271-2/+4
|
* bpo-36205: Fix the rusage implementation of time.process_time() (GH-15538)vrajivk2019-08-271-1/+1
|
* bpo-37798: Minor code formatting and comment clean-ups. (GH-15526)Raymond Hettinger2019-08-261-13/+22
|
* bpo-37055: fix warnings in _blake2 module (GH-14646)Inada Naoki2019-08-263-19/+0
| | | | | | | https://bugs.python.org/issue37055 Automerge-Triggered-By: @tiran
* bpo-37942: Improve argument clinic float converter (GH-15470)Raymond Hettinger2019-08-255-92/+266
|
* bpo-37798: Add C fastpath for statistics.NormalDist.inv_cdf() (GH-15266)Dong-hee Na2019-08-233-0/+173
|
* bpo-37915: Fix comparison between tzinfo objects and timezone objects (GH-15390)Pablo Galindo2019-08-221-1/+2
| | | | | | | https://bugs.python.org/issue37915 Automerge-Triggered-By: @pablogsal
* bpo-37834: Normalise handling of reparse points on Windows (GH-15231)Steve Dower2019-08-213-199/+214
| | | | | | | | | | bpo-37834: Normalise handling of reparse points on Windows * ntpath.realpath() and nt.stat() will traverse all supported reparse points (previously was mixed) * nt.lstat() will let the OS traverse reparse points that are not name surrogates (previously would not traverse any reparse point) * nt.[l]stat() will only set S_IFLNK for symlinks (previous behaviour) * nt.readlink() will read destinations for symlinks and junction points only bpo-1311: os.path.exists('nul') now returns True on Windows * nt.stat('nul').st_mode is now S_IFCHR (previously was an error)
* Revert mode change that loses information in directory listings on Linux. ↵Stefan Krah2019-08-211-0/+0
| | | | (#15366)
* bpo-37851: faulthandler allocates its stack on demand (GH-15358)Victor Stinner2019-08-211-48/+98
| | | | | | | | | | | | | | | | | | The faulthandler module no longer allocates its alternative stack at Python startup. Now the stack is only allocated at the first faulthandler usage. faulthandler no longer ignores memory allocation failure when allocating the stack. sigaltstack() failure now raises an OSError exception, rather than being ignored. The alternative stack is no longer used if sigaction() is not available. In practice, sigaltstack() should only be available when sigaction() is avaialble, so this change should have no effect in practice. faulthandler.dump_traceback_later() internal locks are now only allocated at the first dump_traceback_later() call, rather than always being allocated at Python startup.
* Unmark files as executable that can't actually be executed. (GH-15353)Greg Price2019-08-214-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There are plenty of legitimate scripts in the tree that begin with a `#!`, but also a few that seem to be marked executable by mistake. Found them with this command -- it gets executable files known to Git, filters to the ones that don't start with a `#!`, and then unmarks them as executable: $ git ls-files --stage \ | perl -lane 'print $F[3] if (!/^100644/)' \ | while read f; do head -c2 "$f" | grep -qxF '#!' \ || chmod a-x "$f"; \ done Looking at the list by hand confirms that we didn't sweep up any files that should have the executable bit after all. In particular * The `.psd` files are images from Photoshop. * The `.bat` files sure look like things that can be run. But we have lots of other `.bat` files, and they don't have this bit set, so it must not be needed for them. Automerge-Triggered-By: @benjaminp
* Remove a dead comment from ossaudiodev.c (#15346)Brett Cannon2019-08-201-2/+0
|
* bpo-15913: Implement PyBuffer_SizeFromFormat() (GH-13873)Joannah Nanjekye2019-08-201-0/+21
| | | | Implement PyBuffer_SizeFromFormat() function (previously documented but not implemented): call struct.calcsize().
* Replace usage of the obscure PEM_read_bio_X509_AUX with the more standard ↵Alex Gaynor2019-08-151-1/+1
| | | | | | | PEM_read_bio_X509 (GH-15303) X509_AUX is an odd, note widely used, OpenSSL extension to the X509 file format. This function doesn't actually use any of the extra metadata that it parses, so just use the standard API. Automerge-Triggered-By: @tiran
* bpo-21131: Fix faulthandler.register(chain=True) stack (GH-15276)Victor Stinner2019-08-141-1/+5
| | | | | | faulthandler now allocates a dedicated stack of SIGSTKSZ*2 bytes, instead of just SIGSTKSZ bytes. Calling the previous signal handler in faulthandler signal handler uses more than SIGSTKSZ bytes of stack memory on some platforms.
* bpo-37811: FreeBSD, OSX: fix poll(2) usage in sockets module (GH-15202)Artem Khramov2019-08-141-0/+11
| | | | | | | | | | | | | | | | FreeBSD implementation of poll(2) restricts the timeout argument to be either zero, or positive, or equal to INFTIM (-1). Unless otherwise overridden, socket timeout defaults to -1. This value is then converted to milliseconds (-1000) and used as argument to the poll syscall. poll returns EINVAL (22), and the connection fails. This bug was discovered during the EINTR handling testing, and the reproduction code can be found in https://bugs.python.org/issue23618 (see connect_eintr.py, attached). On GNU/Linux, the example runs as expected. This change is trivial: If the supplied timeout value is negative, truncate it to -1.
* bpo-37738: Fix curses addch(str, color_pair) (GH-15071)Victor Stinner2019-08-141-3/+15
| | | | | Fix the implementation of curses addch(str, color_pair): pass the color pair to setcchar(), instead of always passing 0 as the color pair.
* Delete leftover clinic-generated file for C zipimport. (GH-15174)Greg Price2019-08-101-325/+0
|
* bpo-37642: Update acceptable offsets in timezone (GH-14878)Ngalim Siregar2019-08-091-2/+9
| | | | | | | | | This fixes an inconsistency between the Python and C implementations of the datetime module. The pure python version of the code was not accepting offsets greater than 23:59 but less than 24:00. This is an accidental legacy of the original implementation, which was put in place before tzinfo allowed sub-minute time zone offsets. GH-14878
* bpo-37587: optimize json.loads (GH-15134)Inada Naoki2019-08-081-20/+19
| | | | | | | Use a tighter scope temporary variable to help register allocation. 1% speedup for large string. Use PyDict_SetItemDefault() for memoizing keys. At most 4% speedup when the cache hit ratio is low.
* bpo-34488: optimize BytesIO.writelines() (GH-8904)Sergey Fedoseev2019-08-071-36/+59
| | | Avoid the creation of unused int object for each line.
* bpo-37648: Fixed minor inconsistency in some __contains__. (GH-14904)Serhiy Storchaka2019-08-042-5/+4
| | | | | The collection's item is now always at the left and the needle is on the right of ==.
* bpo-37685: Fixed comparisons of datetime.timedelta and datetime.timezone. ↵Serhiy Storchaka2019-08-041-5/+2
| | | | | | | | | (GH-14996) There was a discrepancy between the Python and C implementations. Add singletons ALWAYS_EQ, LARGEST and SMALLEST in test.support to test mixed type comparison.
* bpo-36590: Add Bluetooth RFCOMM and support for Windows. (GH-12767)Greg Bowser2019-08-022-6/+102
| | | | | | | | | | | Support for RFCOMM, L2CAP, HCI, SCO is based on the BTPROTO_* macros being defined. Winsock only supports RFCOMM, even though it has a BTHPROTO_L2CAP macro. L2CAP support would build on windows, but not necessarily work. This also adds some basic unittests for constants (all of which existed prior to this commit, just not on windows) and creating sockets. pair: Nate Duarte <slacknate@gmail.com>
* bpo-37729: gc: write stats at once (GH-15050)Inada Naoki2019-08-021-20/+25
| | | | | | | | | | | | | | | gc used several PySys_WriteStderr() calls to write stats. It caused stats mixed up when stderr is shared by multiple processes like this: gc: collecting generation 2... gc: objects in each generation: 0 0gc: collecting generation 2... gc: objects in each generation: 0 0 126077 126077 gc: objects in permanent generation: 0 gc: objects in permanent generation: 0 gc: done, 112575 unreachable, 0 uncollectablegc: done, 112575 unreachable, 0 uncollectable, 0.2223s elapsed , 0.2344s elapsed
* bpo-37695: Correct unget_wch error message. (GH-14986)Anthony Sottile2019-07-311-2/+2
|
* bpo-37085: Expose SocketCAN bcm_msg_head flags (#13646)karl ding2019-07-311-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | Expose the CAN_BCM SocketCAN constants used in the bcm_msg_head struct flags (provided by <linux/can/bcm.h>) under the socket library. This adds the following constants with a CAN_BCM prefix: * SETTIMER * STARTTIMER * TX_COUNTEVT * TX_ANNOUNCE * TX_CP_CAN_ID * RX_FILTER_ID * RX_CHECK_DLC * RX_NO_AUTOTIMER * RX_ANNOUNCE_RESUME * TX_RESET_MULTI_IDX * RX_RTR_FRAME * CAN_FD_FRAME The CAN_FD_FRAME flag was introduced in the 4.8 kernel, while the other ones were present since SocketCAN drivers were mainlined in 2.6.25. As such, it is probably unnecessary to guard against these constants being missing.
* Fix typos in comments, docs and test names (#15018)Min ho Kim2019-07-307-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | * Fix typos in comments, docs and test names * Update test_pyparse.py account for change in string length * Apply suggestion: splitable -> splittable Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu> * Apply suggestion: splitable -> splittable Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu> * Apply suggestion: Dealloccte -> Deallocate Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu> * Update posixmodule checksum. * Reverse idlelib changes.
* bpo-37587: Make json.loads faster for long strings (GH-14752)Marco Paolini2019-07-301-1/+1
| | | | | | | | | | When scanning the string, most characters are valid, so checking for invalid characters first means never needing to check the value of strict on valid strings, and only needing to check it on invalid characters when doing non-strict parsing of invalid strings. This provides a measurable reduction in per-character processing time (~11% in the pre-merge patch testing).
* bpo-37268: Add deprecation notice and a DeprecationWarning for the parser ↵Pablo Galindo2019-07-301-0/+6
| | | | | | | | | | | | | | | module (GH-15017) Deprecate the parser module and add a deprecation warning triggered on import and a warning block in the documentation. https://bugs.python.org/issue37268 Automerge-Triggered-By: @pablogsal
* bpo-37691: Let math.dist() accept sequences and iterables for coordinates ↵Raymond Hettinger2019-07-272-17/+39
| | | | (GH-14975)
* bpo-37502: handle default parameter for buffers argument of pickle.loads ↵Markus Mohrhard2019-07-251-1/+1
| | | | correctly (GH-14593)
* bpo-37399: Correctly attach tail text to the last element/comment/pi (GH-14856)Stefan Behnel2019-07-241-24/+64
| | | | * bpo-37399: Correctly attach tail text to the last element/comment/pi, even when comments or pis are discarded. Also fixes the insertion of PIs when "insert_pis=True" is configured for a TreeBuilder.
* Fix typos in docs, comments and test assert messages (#14872)Min ho Kim2019-07-212-2/+2
|
* bpo-37476: Adding tests for asutf8 and asutf8andsize (GH-14531)Hai Shi2019-07-201-0/+44
|
* bpo-37547: Fix a compiler warning in winconsoleio.c (GH-14785)Zackery Spytz2019-07-191-1/+1
| | | | The compiler warning was introduced in 59ad110d7a7784d53d0b502eebce0346597a6bef.
* bpo-34749: Improved performance of binascii.a2b_base64(). (GH-9444)Sergey Fedoseev2019-07-141-86/+56
| | | https://bugs.python.org/issue34749