summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* [2.7] bpo-27212: Modify islice recipe to consume initial values preceding ↵Cheryl Sabella2018-04-021-1/+68
| | | | | start (GH-6195) (GH-6339) (cherry picked from commit da1734c58d2f97387ccc9676074717d38b044128)
* [2.7] bpo-33096: Fix ttk.Treeview.insert. (GH-6228) (GH-6326)Serhiy Storchaka2018-03-314-1/+3542
| | | | | | | Allow ttk.Treeview.insert to insert iid that has a false boolean value. Note iid=0 and iid=False would be same. (cherry picked from commit 3ab44c0783eebdff687014f7d14d5dec59b6bd39) Co-authored-by: Garvit Khatri <garvitdelhi@gmail.com>
* bpo-31544: Avoid calling "PyObject_GetAttrString()" (and potentially ↵scoder2018-03-241-0/+33
| | | | executing user code) with a live exception set. (GH-3992)
* Upgrade pip to v9.0.3 and setuptools to v39.0.1 (GH-6184) Miss Islington (bot)2018-03-223-2/+2
| | | | | (cherry picked from commit d93b5161af12291f3f98a260c90cc2975ea9e9cd) Co-authored-by: Donald Stufft <donald@stufft.io>
* Update pip to 9.0.2 and setuptools to 38.6.1 (GH-6133) (GH-6135)Miss Islington (bot)2018-03-173-2/+2
| | | | | (cherry picked from commit 7f81bb2addbbccfa45a2fc1aa6030f26dcf4bd78) Co-authored-by: Donald Stufft <donald@stufft.io>
* [2.7] bpo-17288: Prevent jumps from 'return' and 'exception' trace events. ↵xdegaye2018-03-131-11/+57
| | | | | (GH-6111) (cherry picked from commit e32bbaf376a09c149fa7c7f2919d7c9ce4e2a055)
* [2.7] bpo-33026: Fix jumping out of "with" block by setting f_lineno. ↵Miss Islington (bot)2018-03-111-0/+28
| | | | | | | | | (GH-6026). (GH-6074) (GH-6076) (cherry picked from commit 26c9f565d016db21257a60d29ab2c99383dd5ac7) (cherry picked from commit 04aadf23eac51fec2e436c5960c1362bbb7d03de) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [2.7] closes bpo-32997: Fix REDOS in fpformat (GH-5984)Jamie Davis2018-03-062-1/+12
| | | | | | The regex to decode a number in fpformat is susceptible to catastrophic backtracking. This is a potential DOS vector if a server is using fpformat on untrusted number strings. Replace it with an equivalent non-vulnerable regex. The match behavior of the new regex is slightly different. It captures the whole integer part of the number in one group, Leading zeros are stripped off later.
* [2.7] bpo-32981: Fix catastrophic backtracking vulns (GH-5955)Benjamin Peterson2018-03-044-3/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Prevent low-grade poplib REDOS (CVE-2018-1060) The regex to test a mail server's timestamp is susceptible to catastrophic backtracking on long evil responses from the server. Happily, the maximum length of malicious inputs is 2K thanks to a limit introduced in the fix for CVE-2013-1752. A 2KB evil response from the mail server would result in small slowdowns (milliseconds vs. microseconds) accumulated over many apop calls. This is a potential DOS vector via accumulated slowdowns. Replace it with a similar non-vulnerable regex. The new regex is RFC compliant. The old regex was non-compliant in edge cases. * Prevent difflib REDOS (CVE-2018-1061) The default regex for IS_LINE_JUNK is susceptible to catastrophic backtracking. This is a potential DOS vector. Replace it with an equivalent non-vulnerable regex. Also introduce unit and REDOS tests for difflib. Co-authored-by: Tim Peters <tim.peters@gmail.com> Co-authored-by: Christian Heimes <christian@python.org>. (cherry picked from commit 0e6c8ee2358a2e23117501826c008842acb835ac)
* bpo-18533: Avoid RuntimeError from repr() of recursive dictview (#4823) (#5357)bennorth2018-02-262-0/+28
| | | (cherry picked from commit d7773d92bd11640a8c950d6c36a9cef1cee36f96)
* Delete a broken threading.local example (GH-5870)Miss Islington (bot)2018-02-251-5/+1
| | | | | | This code never did anything correct or useful. The class attribute will never be affected, and the condition will never be true. (cherry picked from commit 5fb632e83136399bad9427ee23ec8b771695290a) Co-authored-by: Aaron Gallagher <habnabit@users.noreply.github.com>
* bpo-25404: SSLContext.load_dh_params() non-ASCII path (GH-3459)Christian Heimes2018-02-251-1/+5
| | | | | SSLContext.load_dh_params() now supports non-ASCII path. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-31518: Change TLS protocol for Debian (#3661)Christian Heimes2018-02-244-9/+9
| | | | | | | Debian Unstable has disabled TLS 1.0 and 1.1 for SSLv23_METHOD(). Change TLS/SSL protocol of some tests to PROTOCOL_TLS or PROTOCOL_TLSv1_2 to make them pass on Debian. Signed-off-by: Christian Heimes <christian@python.org>
* [2.7] bpo-30028: make test.support.temp_cwd() fork-safe (GH-1066) (GH-5825)Anselm Kruis2018-02-232-1/+35
| | | | | | | Make test.support.temp_cwd() fork-safe. The context manager test.support.temp_cwd() no longer removes the temporary directory when executing in a process other than the parent it entered from. If a forked child exits the context manager it won't do the cleanup.. (cherry picked from commit 33dddac00ba8d9b72cf21b8698504077eb3c23ad) Co-authored-by: Anselm Kruis <a.kruis@science-computing.de>
* [2.7] bpo-31848: Fix broken error handling in Aifc_read.initfp() when the ↵Miss Islington (bot)2018-02-212-0/+9
| | | | | | | | | | | SSND chunk is not found (GH-5240) (GH-5781) Initialize self._ssnd_chunk so that aifc.Error is raised as intended, not AttributeError. (cherry picked from commit 80d20b918bd8a882043c493a7f958333ecb41727) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [2.7] bpo-21060 Improve error message for "setup.py upload" without dist ↵Éric Araujo2018-02-191-1/+3
| | | | | | | files (GH-5726). (cherry picked from commit 08a6926b2584040fe3c3f06263b0b5f1fbbdc24c) Co-authored-by: Éric Araujo <merwok@netwok.org>
* bpo-30109: Fix reindent.py for non-ASCII files. (#5637)Serhiy Storchaka2018-02-121-1/+1
| | | | | It now processes files as binary streams. This also fixes "make reindent".
* [2.7] bpo-30157: Fix csv.Sniffer.sniff() regex pattern. (GH-5601) (GH-5604)Serhiy Storchaka2018-02-092-1/+10
| | | | | Co-authored-by: Jake Davis <jcdavis@awedge.net>. (cherry picked from commit 2411292ba8155327125d8a1da8a4c9fa003d5909)
* allow the test suite to pass if the strop module doesn't exist (GH-5566)Benjamin Peterson2018-02-061-1/+2
| | | strop is highly legacy and can be safely compiled out in most installations. Let's not fail the test suite for its absence.
* [2.7] bpo-32137: The repr of deeply nested dict now raises a RuntimeError ↵Serhiy Storchaka2018-02-023-4/+21
| | | | | | | | | (GH-4570) (#5493) instead of crashing due to a stack overflow. This perhaps will fix similar problems in other extension types. (cherry picked from commit 1fb72d2ad243c965d4432b4e93884064001a2607)
* bpo-30595: Increase test_queue_feeder_donot_stop_onexc() timeout (GH-2148) ↵Victor Stinner2018-01-291-1/+2
| | | | | | | | | (GH-5429) _test_multiprocessing.test_queue_feeder_donot_stop_onexc() now uses a timeout of 1 second on Queue.get(), instead of 0.1 second, for slow buildbots. (cherry picked from commit 8f6eeaf21cdf4aea25fdefeec814a1ce07453fe9)
* bpo-32304: Fix distutils upload for tar files ending with b'\r' (GH-5264) ↵Bo Bayles2018-01-292-2/+26
| | | | | (GH-5331) Patch by Bo Bayles.
* bpo-32667: Fix tests when $PATH contains a file (#5324)Victor Stinner2018-01-251-1/+1
| | | | | test_subprocess.test_leaking_fds_on_error() failed when the PATH environment variable contains a path to an existing file. Fix the test: ignore also ENOTDIR, not only ENOENT and EACCES.
* Use assertItemsEqual instead of assertEqual. (#5224)Gregory P. Smith2018-01-171-3/+3
| | | | This test doesn't care about order, the underlying filesystem APIs do not guarantee directory listings on subsequent calls will be in the same order.
* pythoninfo: add time.time and datetime.datetime.now (GH-5214) (#5220)Miss Islington (bot)2018-01-171-1/+13
| | | (cherry picked from commit 7d91c0250408e202243c77c1dc9afdb321b6b32f)
* bpo-32539: Fix OSError for os.listdir() for extended-length paths on Windows ↵Anthony Sottile2018-01-151-0/+50
| | | | | | | (#5169) See https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx?f=255&MSPPError=-2147217396#maxpath Paths that begin with `\\?\` are "extended-length paths".
* bpo-32482: Improve syntax and grammar tests. (#5085)Serhiy Storchaka2018-01-043-177/+397
|
* bpo-31530: fix crash when multiple threads iterate over a file, round 2 (#5060)Benjamin Peterson2018-01-021-16/+11
| | | | | | | | | | | | | | | Multiple threads iterating over a file can corrupt the file's internal readahead buffer resulting in crashes. To fix this, cache buffer state thread-locally for the duration of a file_iternext call and only update the file's internal state after reading completes. No attempt is made to define or provide "reasonable" semantics for iterating over a file on multiple threads. (Non-crashing) races are still present. Duplicated, corrupt, and missing data will happen. This was originally fixed by 6401e5671781eb217ee1afb4603cc0d1b0367ae6, which raised an exception from seek() and next() when concurrent operations were detected. Alas, this simpler solution breaks legitimate use cases such as capturing the standard streams when multiple threads are logging.
* [2.7] bpo-32478: Add tests for 'break' and 'return' inside 'finally' clause. ↵Serhiy Storchaka2018-01-021-0/+74
| | | | | (GH-5078). (#5084) (cherry picked from commit 7cc42c356b0dc5ad9eaa9392789e84bd4aa1c7de)
* bpo-32416: Add two new tests in test_sys_settrace. (GH-5072) (#5074)Miss Islington (bot)2018-01-011-8/+30
| | | | Move other test to more proper place. (cherry picked from commit e8ed96550c6aa9a1e39c36e67e892994e25e2c41)
* bpo-18035: telnetlib: select.error doesn't have an errno attribute (#5044)Segev Finer2017-12-291-2/+2
| | | | select.error doesn't have an errno attribute so access the errno by indexing instead.
* [2.7] remove unused import (GH-5040). (#5043)Benjamin Peterson2017-12-291-1/+0
| | | (cherry picked from commit e325608740bee161ca7fefd09463d63099efa1b8)
* make PatternCompiler use the packaged grammar if possible (more bpo-24960) ↵Miss Islington (bot)2017-12-291-7/+7
| | | | | (GH-5034) (#5037) (cherry picked from commit e5f7dccefaa8d97ab53b3051acbb4a4d49379dc4)
* [2.7] bpo-32416: Refactor tests for the f_lineno setter and add new tests. ↵Serhiy Storchaka2017-12-271-235/+395
| | | | | (GH-4991). (#5017) (cherry picked from commit 53f9135667226f33e049e327db60fb033afbd77a)
* correct wording (GH-4983) (#4985)Miss Islington (bot)2017-12-231-1/+1
| | | (cherry picked from commit d11e8e0d11c759cd0f96aebb59de914e4d62b8cd)
* [2.7] bpo-24960: use pkgutil.get_data in lib2to3 to read pickled grammar ↵Benjamin Peterson2017-12-224-2/+42
| | | | | | | | | files (GH-4977) (#4980) This is more complicated than it should be because we need to preserve the useful mtime-based regeneration feature that lib2to3.pgen2.driver.load_grammar has. We only look for the pickled grammar file with pkgutil.get_data and only if the source file does not exist.. (cherry picked from commit 8a5877165e993afb2633cd48da5222326d3f6e0e)
* pythoninfo: sync with master (#4843)Victor Stinner2017-12-132-35/+143
|
* Fix improper use of re.escape() in tests. (GH-4814) (#4817)Miss Islington (bot)2017-12-121-1/+1
| | | (cherry picked from commit b748e3b2586e44bfc7011b601bce9cc6d16d89f1)
* bpo-30806: Fix netrc.__repr__() format (GH-2491)Steven Loria2017-12-102-9/+13
| | | | | netrc file format doesn't support quotes and escapes. See https://linux.die.net/man/5/netrc
* [2.7] bpo-10544: Deprecate "yield" in comprehensions and generator ↵Serhiy Storchaka2017-12-023-11/+45
| | | | expressions in Py3k mode. (GH-4579) (#4676)
* [2.7] bpo-32107 - Backport bitmask check fix (GH-4576) (#4590)Barry Warsaw2017-11-291-13/+11
| | | Remove a flakey test and rewrite another one for readability.
* bpo-32139: test_strftime does not anymore modify the locale (GH-4569) (#4636)Miss Islington (bot)2017-11-291-2/+4
| | | (cherry picked from commit cc55e78acab93a495c974b9a2ea71c8bb9cc2f5d)
* bpo-32110: codecs.StreamReader.read(n) now returns not more than n (GH-4499) ↵Miss Islington (bot)2017-11-292-5/+21
| | | | | | | (#4623) characters/bytes for non-negative n. This makes it compatible with read() methods of other file-like objects. (cherry picked from commit 219c2de5ad0fdac825298bed1bb251f16956c04a)
* pythoninfo: add Py_DEBUG (#4198) (#4581)Victor Stinner2017-11-271-0/+8
| | | (cherry picked from commit afd055a59fe0291881fc2459215ce106e424da51)
* bpo-31324: Optimize support._match_test() (#4523) (#4524)Victor Stinner2017-11-233-15/+118
| | | | | | | | | | | | | | | | | | | * bpo-31324: Optimize support._match_test() (#4421) * Rename support._match_test() to support.match_test(): make it public * Remove support.match_tests global variable. It is replaced with a new support.set_match_tests() function, so match_test() doesn't have to check each time if patterns were modified. * Rewrite match_test(): use different code paths depending on the kind of patterns for best performances. Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com> (cherry picked from commit 803ddd8ce22f0de3ab42fb98a225a704c000ef06) * bpo-31324: Fix test.support.set_match_tests(None) (#4505) (cherry picked from commit bb11c3c967afaf263e00844d4ab461b7fafd6d36) (cherry picked from commit 70b2f8797146a56a6880743424f0bedf4fc30c62)
* test_builtin: TestExecFile removes created file (#4525)Victor Stinner2017-11-231-7/+17
| | | | | | | | | Fix the following warning: Warning -- files was modified by test_builtin Before: [] After: ['@test_19422_tmp'] 1 test altered the execution environment: test_builtin
* bpo-29512: Fix Lib/test/bisect.py shebang (#4522)Victor Stinner2017-11-231-1/+1
| | | Replace python3 with python2.
* [2.7] bpo-21149: Workaround a GC finalization bug in logging. (#4368)Gregory P. Smith2017-11-111-5/+12
| | | | | | | | | | | | * Work around a GC process finalization bug. The logging RLock instances may exist but the threading.RLock class itself has already been emptied causing a Exception TypeError: "'NoneType' object is not callable" in <function _removeHandlerRef ..." to be printed to stderr on process termination. This catches that exception and ignores it because there is absolutely nothing we can or should do about it from the context of a weakref handler called from the gc context.
* [2.7] bpo-31530: Stop crashes when iterating over a file on multiple ↵Serhiy Storchaka2017-11-101-0/+32
| | | | threads. (#3672)
* Fix a test for select.kevent. (#4349)Serhiy Storchaka2017-11-091-3/+6
| | | select.kevent objects are now comparable with other objects in Python 2.