summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* bpo-34794: Fix a leak in Tkinter. (GH-10025)Serhiy Storchaka2018-10-231-3/+1
| | | Based on the investigation by Xiang Zhang.
* Fix error handling bugs in _elementtree.c. (GH-10060)Zackery Spytz2018-10-231-11/+11
| | | | References could leak, NULL could be dereferenced, and the Expat parser could be double freed when some errors raised.
* bpo-34454: Clean up datetime.fromisoformat surrogate handling (GH-8959)Paul Ganssle2018-10-221-72/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use _PyUnicode_Copy in sanitize_isoformat_str * Use repr in fromisoformat error message This reverses commit 67b74a98b2 per Serhiy Storchaka's suggestion: I suggested to use %R in the error message because including the raw string can be confusing in the case of empty string, or string containing trailing whitespaces, invisible or unprintable characters. We agree that it is better to change both the C and pure Python versions to use repr. * Retain non-sanitized dtstr for error printing This does not create an extra string, it just holds on to a reference to the original input string for purposes of creating the error message. * PEP 7 fixes to from_isoformat * Separate handling of Unicode and other errors In the initial implementation, errors other than encoding errors would both raise an error indicating an invalid format, which would not be true for errors like MemoryError. * Drop needs_decref from _sanitize_isoformat_str Instead _sanitize_isoformat_str returns a new reference, even to the original string.
* bpo-29843: raise AttributeError if given negative _length_ (GH-10029)Tal Einat2018-10-221-5/+20
| | | | | | | | Raise ValueError OverflowError in case of a negative _length_ in a ctypes.Array subclass. Also raise TypeError instead of AttributeError for non-integer _length_. Co-authored-by: Oren Milman <orenmn@gmail.com>
* closes bpo-35025: Properly guard the `CLOCK_GETTIME` et al macros in ↵Max Bélanger2018-10-211-0/+4
| | | | | timemodule.c. (GH-9961) Guard the `CLOCK_GETTIME` et al macros in `timemodule` based on the availability of the parent functions
* bpo-34983: Expose symtable.Symbol.is_nonlocal() in the symtable module (GH-9872)Pablo Galindo2018-10-201-0/+1
| | | | The symbol table was not exposing functionality to query the nonlocal symbols in a function or to check if a particular symbol is nonlocal.
* bpo-32890, os: Use errno instead of GetLastError() in execve() and ↵Alexey Izbyshev2018-10-201-3/+15
| | | | | | | | | | truncate() (GH-5784) path_error() uses GetLastError() on Windows, but some os functions are implemented via CRT APIs which report errors via errno. This may result in raising OSError with invalid error code (such as zero). Introduce posix_path_error() function and use it where appropriate.
* bpo-32236: open() emits RuntimeWarning if buffering=1 for binary mode (GH-4842)Alexey Izbyshev2018-10-201-0/+9
| | | | | | | | | If buffering=1 is specified for open() in binary mode, it is silently treated as buffering=-1 (i.e., the default buffer size). Coupled with the fact that line buffering is always supported in Python 2, such behavior caused several issues (e.g., bpo-10344, bpo-21332). Warn that line buffering is not supported if open() is called with binary mode and buffering=1.
* Elaborate datetime.timedelta docstring (GH-7458)Chris Barker2018-10-191-1/+5
|
* bpo-34070: open() only checks for isatty if buffering < 0 (GH-8187)David Herberth2018-10-191-3/+3
|
* bpo-25750: Add test on bad descriptor __get__() (GH-9084)jdemeyer2018-10-191-0/+23
|
* Fix typos in comments (GH-9905)Quan Tian2018-10-191-1/+1
|
* bpo-20216: Correct docstrings of digest() methods in hashlib. (GH-9873)Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి)2018-10-199-17/+17
|
* bpo-34741: Get rid of tp_getattro and tp_setattro in pyexpat.xmlparser. ↵Serhiy Storchaka2018-10-192-345/+269
| | | | | | (GH-9422) Use tp_members and tp_getset instead.
* bpo-35013: Add more type checks for children of Element. (GH-9944)Serhiy Storchaka2018-10-191-25/+44
| | | | | | It is now guarantied that children of xml.etree.ElementTree.Element are Elements (at least in C implementation). Previously methods __setitem__(), __setstate__() and __deepcopy__() could be used for adding non-Element children.
* Fix several reference counting bugs in pyexpat.c. (GH-9955)Zackery Spytz2018-10-191-4/+8
|
* bpo-35008: Fix possible leaks in Element.__setstate__(). (GH-9924)Serhiy Storchaka2018-10-181-31/+64
| | | | | C implementation of xml.etree.ElementTree.Element.__setstate__() leaked references to children when called for already initialized element.
* bpo-35011: Restore use of pyexpatns.h in libexpat (GH-9939)Gregory P. Smith2018-10-181-0/+4
| | | | | | | | Restores the use of pyexpatns.h to isolate our embedded copy of the expat C library so that its symbols do not conflict at link or dynamic loading time with an embedding application or other extension modules with their own version of libexpat. https://github.com/python/cpython/commit/5dc3f23b5fb0b510926012cb3732dae63cddea60#diff-3afaf7274c90ce1b7405f75ad825f545 inadvertently removed it when upgrading expat.
* bpo-24658: Fix read/write greater than 2 GiB on macOS (GH-1705)Stéphane Wirtel2018-10-171-5/+3
| | | On macOS, fix reading from and writing into a file with a size larger than 2 GiB.
* bpo-34941: Fix searching Element subclasses. (GH-9766)Serhiy Storchaka2018-10-141-12/+13
| | | | Methods find(), findtext() and findall() of xml.etree.ElementTree.Element were not able to find chldren which are instances of Element subclasses.
* bpo-34922: Fix integer overflow in the digest() and hexdigest() methods ↵Serhiy Storchaka2018-10-111-0/+4
| | | | | (GH-9751) for the SHAKE algorithm in the hashlib module.
* bpo-34925: Optimize common case for bisect() argument parsing (#9753)Raymond Hettinger2018-10-081-15/+39
|
* bpo-34824: Fix a possible NULL pointer dereference in _ssl.c (GH-9606)Zackery Spytz2018-10-061-2/+7
| | | | | | | On failure, _PyBytes_Resize() will deallocate the bytes object and set "result" to NULL. https://bugs.python.org/issue34824
* bpo-34906: Doc: Fix typos (2) (GH-9735)Stéphane Wirtel2018-10-061-1/+1
| | | Fix typos
* Fix a compiler warning added in bpo-34872. (GH-9722)Serhiy Storchaka2018-10-051-1/+1
|
* bpo-34906: Doc: Fix typos (GH-9712)Stéphane Wirtel2018-10-051-1/+1
|
* bpo-28441: Ensure `.exe` suffix in `sys.executable` on MinGW and Cygwin ↵E. M. Bray2018-10-051-0/+45
| | | | | | | | | | | | | | | | | | (GH-4348) This is needed to even the run the test suite on buildbots for affected platforms; e.g.: ``` ./python.exe ./Tools/scripts/run_tests.py -j 1 -u all -W --slowest --fail-env-changed --timeout=11700 -j2 /home/embray/src/python/test-worker/3.x.test-worker/build/python -u -W default -bb -E -W error::BytesWarning -m test -r -w -j 1 -u all -W --slowest --fail-env-changed --timeout=11700 -j2 Traceback (most recent call last): File "./Tools/scripts/run_tests.py", line 56, in <module> main(sys.argv[1:]) File "./Tools/scripts/run_tests.py", line 52, in main os.execv(sys.executable, args) PermissionError: [Errno 13] Permission denied make: *** [Makefile:1073: buildbottest] Error 1 ```
* bpo-34740: Get rid of tp_getattro in ossaudiodev.oss_audio_device. (GH-9421)Serhiy Storchaka2018-10-041-35/+34
| | | Use tp_members and tp_getset instead.
* bpo-34739: Get rid of tp_getattro in xml.etree.ElementTree.XMLParser. (GH-9420)Serhiy Storchaka2018-10-041-24/+19
| | | Use tp_members and tp_getset instead.
* bpo-34872: Fix self-cancellation in C implementation of asyncio.Task (GH-9679)Elvis Pranskevichus2018-10-031-3/+8
| | | | | | | | | | | | | | | | | The C implementation of asyncio.Task currently fails to perform the cancellation cleanup correctly in the following scenario. async def task1(): async def task2(): await task3 # task3 is never cancelled asyncio.current_task().cancel() await asyncio.create_task(task2()) The actuall error is a hardcoded call to `future_cancel()` instead of calling the `cancel()` method of a future-like object. Thanks to Vladimir Matveev for noticing the code discrepancy and to Yury Selivanov for coming up with a pathological scenario.
* closes bpo-34862: Guard definition of convert_sched_param with ↵William Orr2018-10-022-7/+9
| | | | | | POSIX_SPAWN_SETSCHEDULER. (GH-9658) Fixes broken build on OpenBSD-current.
* Speed-up math.dist() by 30% (GH-9628)Raymond Hettinger2018-09-292-6/+12
|
* Fix incorrect error handling in _pickle.Unpickler.__init__() (GH-9630)Zackery Spytz2018-09-291-1/+1
| | | | _pickle.Unpickler.__init__() should return -1 if Pdata_New() fails, not 1.
* bpo-34797: Convert heapq to the argument clinic (GH-9560)Pablo Galindo2018-09-282-67/+296
|
* bpo-34736: improve error message for invalid length b64decode inputs (GH-9563)Tal Einat2018-09-281-3/+7
| | | | | | | | Improvements: 1. Include the number of valid data characters in the error message. 2. Mention "number of data characters" rather than "length". https://bugs.python.org/issue34736
* bpo-34248: Add filename to error raised in {gnu,ndbm}.open() (GH-8590)Zsolt Cserna2018-09-272-2/+2
| | | | | | Report the filename to the exception when raising {gdbm,dbm.ndbm}.error in dbm.gnu.open() and dbm.ndbm.open() functions, so it gets printed when the exception is raised, and can also be obtained by the filename attribute of the exception object.
* bpo-34762: Update PyContext* to PyObject* in asyncio and decimal (GH-9609)Yury Selivanov2018-09-272-12/+11
| | | This fixes various compiler warnings.
* bpo-31425: Expose AF_QIPCRTR in socket module (GH-3706)Bjorn Andersson2018-09-262-2/+61
| | | | | | The AF_QIPCRTR address family was introduced in Linux v4.7. Co-authored-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* bpo-32557: allow shutil.disk_usage to take a file path on Windows also (GH-9372)Joe Pamer2018-09-251-2/+27
| | | https://bugs.python.org/issue32557
* Migrate datetime.date.fromtimestamp to Argument Clinic (GH-8535)Tim Hoffmann2018-09-242-18/+33
|
* bpo-34659: Adds initial kwarg to itertools.accumulate() (GH-9345)Lisa Roach2018-09-242-10/+37
|
* bpo-34670: Add TLS 1.3 post handshake auth (GH-9460)Christian Heimes2018-09-232-9/+111
| | | | | | | | | | Add SSLContext.post_handshake_auth and SSLSocket.verify_client_post_handshake for TLS 1.3 post-handshake authentication. Signed-off-by: Christian Heimes <christian@python.org>q https://bugs.python.org/issue34670
* bpo-34759: Fix error handling in ssl 'unwrap()' (GH-9468)Nathaniel J. Smith2018-09-221-2/+2
| | | | | | | | | | | | | | | OpenSSL follows the convention that whenever you call a function, it returns an error indicator value; and if this value is negative, then you need to go look at the actual error code to see what happened. Commit c6fd1c1c3a introduced a small mistake in _ssl__SSLSocket_shutdown_impl: instead of checking whether the error indicator was negative, it started checking whether the actual error code was negative, and it turns out that the error codes are never negative. So the effect was that 'unwrap()' lost the ability to raise SSL errors. https://bugs.python.org/issue34759
* bpo-34762: Fix contextvars C API to use PyObject* pointer types. (GH-9473)Yury Selivanov2018-09-211-1/+1
|
* Minor performance tweak for deque.index() with a start argument (GH-9440)Raymond Hettinger2018-09-211-2/+4
|
* bpo-34755: Add few minor optimizations in _asynciomodule.c. (GH-9455)Serhiy Storchaka2018-09-211-158/+116
|
* bpo-34735: Fix a memory leak in Modules/timemodule.c (GH-9418)Zackery Spytz2018-09-211-0/+1
| | | There was a missing PyMem_Free(format) in time_strftime().
* Simplify PyInit_timezone. (GH-9467)Benjamin Peterson2018-09-211-50/+48
| | | | | | | | Reduce the knotty preprocessor conditional logic, dedent unnecessarily nested code, and handle errors properly. The first edition of this change (afde1c1a05cc8a1e8adf6403c451f6708509a605) failed (bpo-34715) because FreeBSD doesn't define the timezone globals. That's why we're now checking for HAVE_DECL_TZNAME.
* closes bpo-34656: Avoid relying on signed overflow in _pickle memos. (GH-9261)Benjamin Peterson2018-09-211-31/+31
|
* bpo-34743: Fix test_database_source_name under SQLite 3.7.9 (GH-9426)Berker Peksag2018-09-201-0/+6
|