summaryrefslogtreecommitdiffstats
path: root/Lib/test
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)
* bpo-31544: Avoid calling "PyObject_GetAttrString()" (and potentially ↵scoder2018-03-241-0/+33
| | | | executing user code) with a live exception set. (GH-3992)
* [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-061-0/+10
| | | | | | 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-042-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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)
* 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-211-0/+8
| | | | | | | | | | | 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-30157: Fix csv.Sniffer.sniff() regex pattern. (GH-5601) (GH-5604)Serhiy Storchaka2018-02-091-0/+9
| | | | | 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-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)
* [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)
* 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-101-3/+7
| | | | | 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-291-2/+16
| | | | | | | (#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-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.
* Fix DeprecationWarning in tests (#4345)Victor Stinner2017-11-082-0/+10
| | | | | | Define __hash__() in test_functools and test_itertools to fix the following warning: DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__ in 3.x
* [2.7] bpo-31271: Fix an assertion failure in io.TextIOWrapper.write. ↵Oren Milman2017-11-071-0/+16
| | | | (GH-3201) (#3951)
* bpo-31924: Fix test_curses on NetBSD 8. (GH-4228) (#4260)Miss Islington (bot)2017-11-031-2/+4
| | | (cherry picked from commit a7723d8b09f516a2b75837a3527b8cc7bee89fad)
* bpo-27666: Fixed stack corruption in curses.box() and curses.ungetmouse(). ↵Miss Islington (bot)2017-11-011-1/+8
| | | | | (GH-4220) (#4222) (cherry picked from commit 4f469c096628af730b17798d0ebfd8925bfde836)
* bpo-31919: Fix building the curses module on OpenIndiana. (GH-4211) (#4216)Miss Islington (bot)2017-11-011-9/+13
| | | (cherry picked from commit 894ebd065e02debf20c0657d26020ecc42b7534f)
* Fix test_socket.test_create_connection() (GH-4206) (#4209)Miss Islington (bot)2017-11-011-0/+4
| | | | | bpo-31910: test_create_connection() now catchs also EADDRNOTAVAIL to fix the test on Travis CI. (cherry picked from commit 280c22a82a6756e9caffef031c564fd98f1b50e7)
* [2.7] bpo-31891: Fix building the curses module on NetBSD. (GH-4165). (#4194)Serhiy Storchaka2017-10-311-8/+24
| | | (cherry picked from commit baac01e629d90f63dfde6b5cc433f4bc65c5feeb)
* bpo-31629: Add support.SaveSignals (#4183) (#4188)Victor Stinner2017-10-312-1/+45
| | | | | | | test_curses now saves/restores signals. On FreeBSD, the curses module sets handlers of some signals, but don't restore old handlers when the module is deinitialized. (cherry picked from commit 19f68301a1295a9c30d9f28b8f1479cdcccd75aa)
* [2.7] bpo-20047: Make bytearray methods partition() and rpartition() ↵Serhiy Storchaka2017-10-291-6/+29
| | | | | | rejecting (GH-4158) (#4163) separators that are not bytes-like objects.. (cherry picked from commit a2314283ff87c65e1745a42c2f2b716b1a209128)
* [2.7] bpo-25287: Backport new tests for crypt and skip test_crypt on ↵Serhiy Storchaka2017-10-241-3/+9
| | | | | OpenBSD. (GH-4111). (#4112) (cherry picked from commit f52dff611cff2fb9e90340b4787eda50ab2d40c6)
* [2.7] bpo-31752: Fix possible crash in timedelta constructor called with ↵Serhiy Storchaka2017-10-231-0/+40
| | | | | | custom integers. (GH-3947) (#4088) Bad remainder in divmod() in intermediate calculations caused an assertion failure.. (cherry picked from commit 4ffd4653a7ec9c97775472276cf5e159e2366bb2)
* [2.7] bpo-28286: Add tests for the mode argument of GzipFile. (GH-4074). (#4077)Serhiy Storchaka2017-10-221-0/+20
| | | (cherry picked from commit bcbdd2f8db396c3f0ec9186162b39b5a34effa0e)
* Fix py3k warnings in 1/0 in tests. (#4072)Serhiy Storchaka2017-10-221-2/+2
|