summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* [3.6] bpo-31178: Mock os.waitpid() in test_subprocess (GH-3896) (#3897)3.6Miss Islington (bot)2017-10-051-4/+8
| | | | | | | Fix test_exception_errpipe_bad_data() and test_exception_errpipe_normal() of test_subprocess: mock os.waitpid() to avoid calling the real os.waitpid(0, 0) which is an unexpected side effect of the test. (cherry picked from commit 11045c9d8a21dd9bd182a3939189db02815f9783)
* [3.6] bpo-31675: Fix memory leaks in Tkinter's methods splitlist() and ↵Miss Islington (bot)2017-10-031-21/+33
| | | | | | | | split() (GH-3866) (#3874) when pass a string larger than 2 GiB. Decrease memory requirements for Tcl's bigmem tests. (cherry picked from commit 27c623c845dd6e4b8e1782666ca3a956636da266)
* [3.6] bpo-31619: Fixed a ValueError when convert a string with large number ↵Miss Islington (bot)2017-10-031-0/+8
| | | | | | of underscores (GH-3827) (#3863) to integer with binary base. (cherry picked from commit 85c0b8941f0c8ef3ed787c9d504712c6ad3eb5d3)
* [3.6] bpo-31516: current_thread() should not return a dummy thread at ↵Miss Islington (bot)2017-10-021-0/+29
| | | | | | shutdown (GH-3673) (#3856) bpo-31516: current_thread() should not return a dummy thread at shutdown (cherry picked from commit 1023dbbcb7f05e76053486ae7ef7f73b4cdc5398)
* [3.6] bpo-31158: Fix nondeterministic read in test_pty (GH-3808) (GH-3852)Miss Islington (bot)2017-10-021-2/+19
| | | (cherry picked from commit e6f62f69f07892b993910ff03c9db3ffa5cb9ca5)
* [3.6] bpo-31627: Make test_mailbox be lenient to empty hostname. (GH-3821) ↵Miss Islington (bot)2017-09-301-1/+1
| | | | | (#3837) (cherry picked from commit f4ea642cb60556231e714089a79d3c59c202661e)
* [3.6] bpo-31592: Fix an assertion failure in Python parser in case of a bad ↵Miss Islington (bot)2017-09-301-0/+10
| | | | | unicodedata.normalize(). (GH-3767) (#3836) (cherry picked from commit 7dc46d8cf5854d9f4ce3271b29c21aea4872e8ad)
* [3.6] bpo-31641: Allow arbitrary iterables in ↵Miss Islington (bot)2017-09-291-1/+5
| | | | | | | | `concurrent.futures.as_completed()` (GH-3830) (#3831) This was possible before. GH-1560 introduced a regression after 3.6.2 got released where only sequences were accepted now. This commit addresses this problem. (cherry picked from commit 574562c5ddb2f0429aab9af762442e6f9a3f26ab)
* [3.6] bpo-31478: Fix an assertion failure in random.seed() in case a seed ↵Serhiy Storchaka2017-09-281-0/+11
| | | | | has a bad __abs__() method. (GH-3596) (#3794) (cherry picked from commit d780b2d588e68bd7047ef5d1f04e36da38b7a350)
* [3.6] bpo-31588: Validate return value of __prepare__() methods (GH-3790)Miss Islington (bot)2017-09-271-0/+22
| | | | | | | | | | | Class execution requires that __prepare__() methods return a proper execution namespace. Check for that immediately after calling __prepare__(), rather than passing it through to the code execution machinery and potentially triggering SystemError (in debug builds) or a cryptic TypeError (in release builds). Patch by Oren Milman. (cherry picked from commit 5837d0418f47933b2e3c139bdee8a79c248a943c)
* bpo-31593: test_socketserver waits child processes (#3766)Victor Stinner2017-09-271-10/+22
|
* [3.6] bpo-25532: Protect against infinite loops in inspect.unwrap() ↵Serhiy Storchaka2017-09-271-0/+18
| | | | | | | | | | | | (GH-1717) (#3778) Some objects (like test mocks) auto-generate new objects on attribute access, which can lead to an infinite loop in inspect.unwrap(). Ensuring references are retained to otherwise temporary objects and capping the size of the memo dict turns this case into a conventional exception instead.. (cherry picked from commit f9169ce6b48c7cc7cc62d9eb5e4ee1ac7066d14b)
* [3.6] bpo-31505: Fix an assertion failure in json, in case ↵Miss Islington (bot)2017-09-271-0/+21
| | | | | _json.make_encoder() received a bad encoder() argument. (GH-3643) (#3777) (cherry picked from commit 2b382dd6121bb1e4b75470fb3ef8555665df3eb6)
* [3.6] bpo-31285: Fix an assertion failure and a SystemError in ↵Serhiy Storchaka2017-09-271-0/+36
| | | | | warnings.warn_explicit. (GH-3219) (#3775) (cherry picked from commit 91fb0afe181986b48abfc6092dcca912b39de51d)
* [3.6] bpo-31492: Fix assertion failures in case of a module with a bad ↵Serhiy Storchaka2017-09-271-0/+12
| | | | | __name__ attribute. (GH-3620). (#3773) (cherry picked from commit 6db7033192cd537ca987a65971acb01206c3ba82)
* [3.6] bpo-30347: Stop crashes when concurrently iterate over ↵Miss Islington (bot)2017-09-261-0/+24
| | | | | itertools.groupby() iterators. (GH-1557) (#3770) (cherry picked from commit c740e4fe8a9bc5815dc18c38d7f7600b128c3c51)
* bpo-31170: Write unit test for Expat 2.2.4 UTF-8 bug (#3570) (#3746)Victor Stinner2017-09-252-0/+34
| | | | | Non-regression tests for the Expat 2.2.3 UTF-8 decoder bug. (cherry picked from commit e6d9fcbb8d0c325e57df08ae8781aafedb71eca2)
* [3.6] bpo-31566: Fix an assertion failure in _warnings.warn() in case of a ↵Miss Islington (bot)2017-09-241-0/+10
| | | | | bad __name__ global. (GH-3717) (#3730) (cherry picked from commit 5d3e80021ab33360191eb0fbff34e0246c913884)
* bpo-31351: Set return code in ensurepip when pip fails (GH-3626) (GH-3683)Miss Islington (bot)2017-09-221-2/+17
| | | | | | | | Previously ensurepip would always report success, even if the pip installation failed. (cherry picked from commit 9adda0cdf89432386b7a04444a6199b580d287a1) * Update version changed notice for backport
* [3.6] bpo-31482: Missing bytes support for random.seed() version 1 ↵Miss Islington (bot)2017-09-191-0/+27
| | | | | (GH-3614) (GH-3659) (cherry picked from commit 132a7d7cdbc7cb89fa1c1f4e8192241c3d68f549)
* [3.6] pythoninfo: ignore OSError(ENOSYS) on getrandom() (GH-3655) (#3657)Miss Islington (bot)2017-09-191-5/+12
| | | (cherry picked from commit a92941ff12c1d554f42c05ed24621894a758b40f)
* [3.6] bpo-31293: Fix crashes in truediv and mul of a timedelta by a float ↵Miss Islington (bot)2017-09-191-0/+20
| | | | | with a bad as_integer_ratio() method. (GH-3227) (#3654) (cherry picked from commit 865e4b4f630e2ae91e61239258abb58b488f1d65)
* [3.6] bpo-31315: Fix an assertion failure in imp.create_dynamic(), when ↵Miss Islington (bot)2017-09-191-0/+11
| | | | | spec.name is not a string. (GH-3257) (#3653) (cherry picked from commit 9974e1bcf3d0cec9b38b39b39b7ec8a1ebd9ef54)
* [3.6] bpo-31499, xml.etree: Fix xmlparser_gc_clear() crash (GH-3641) (#3645)Miss Islington (bot)2017-09-181-0/+20
| | | | | | | | | | * bpo-31499, xml.etree: Fix xmlparser_gc_clear() crash xml.etree: xmlparser_gc_clear() now sets self.parser to NULL to prevent a crash in xmlparser_dealloc() if xmlparser_gc_clear() was called previously by the garbage collector, because the parser was part of a reference cycle. Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com> (cherry picked from commit e727d41ffcd91b21ce82026ec8c8381d34a16209)
* [3.6] bpo-31234: Join threads in tests (#3589)Victor Stinner2017-09-157-37/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-31234: Join threads in tests (#3572) Call thread.join() on threads to prevent the "dangling threads" warning. (cherry picked from commit 18e95b4176256f100429a806d0455406df98f984) * bpo-31234: Join threads in test_hashlib (#3573) * bpo-31234: Join threads in test_hashlib Use thread.join() to wait until the parallel hash tasks complete rather than using events. Calling thread.join() prevent "dangling thread" warnings. * test_hashlib: minor PEP 8 coding style fixes (cherry picked from commit 8dcf22f442320e4c1a5408e67b4c9002ad105f17) * bpo-31234: Join threads in test_threading (#3579) Call thread.join() to prevent the "dangling thread" warning. (cherry picked from commit b8c7be2c523b012e57915182543d06657161057f) * bpo-31234: Join threads in test_queue (#3586) Call thread.join() to prevent the "dangling thread" warning. (cherry picked from commit 167cbde50a88ec2a7d26b2cb9891d5e32bdfbfb5) * bpo-31234: Join timers in test_threading (#3598) Call the .join() method of threading.Timer timers to prevent the "threading_cleanup() failed to cleanup 1 threads" warning. (cherry picked from commit da3e5cf961f9bcc4bb376386cfe7a2865325086c)
* [3.6] bpo-31455: Fix an assertion failure in ElementTree.XMLParser(). ↵Miss Islington (bot)2017-09-141-0/+25
| | | | | | | | (GH-3545) (#3585) * Avoid calling "PyObject_GetAttrString()" (and potentially executing user code) with a live exception set. * Ignore only AttributeError on attribute lookups in ElementTree.XMLParser() and propagate all other exceptions. (cherry picked from commit c8d8e15bfc24abeeaaf3d8be9073276b0c011cdf)
* [3.6] bpo-28556: typing.get_type_hints: better globalns for classes and ↵Miss Islington (bot)2017-09-142-13/+76
| | | | | | | | | | | | | | | | modules (GH-3582) (#3583) This makes the default behavior (without specifying `globalns` manually) more predictable for users, finds the right globalns automatically. Implementation for classes assumes has a `__module__` attribute and that module is present in `sys.modules`. It does this recursively for all bases in the MRO. For modules, the implementation just uses their `__dict__` directly. This is backwards compatible, will just raise fewer exceptions in naive user code. Originally implemented and reviewed at https://github.com/python/typing/pull/470. (cherry picked from commit f350a268a7071ce7d7a5bb86a9b1229782d4963b)
* [3.6] bpo-31471: Fix assertion failure in subprocess.Popen() on Windows, in ↵Miss Islington (bot)2017-09-141-0/+9
| | | | | case env has a bad keys() method. (GH-3580) (#3584) (cherry picked from commit 0b3a87ef54a0112b74e8a1d8c6f87d10db4239ab)
* [3.6] bpo-31457: Allow for nested LoggerAdapter objects (GH-3551) (#3576)Miss Islington (bot)2017-09-141-0/+11
| | | | | | | Some of the proxied methods use internal Logger state which isn't proxied, causing failures if an adapter is applied to another adapter. This commit fixes the issue, adds a new test for the use case. (cherry picked from commit 1bbd482bcf6ea36bfe488f868810ffe110238ae1)
* [3.6] bpo-28556: Minor updates to typing module (GH-3550) (#3558)Miss Islington (bot)2017-09-141-0/+7
| | | | | * Copy changes to typing from upstream repo * Add NEWS entry (cherry picked from commit 65bc62052fe5d550cb14c0033e8a2550618fb7b9)
* [3.6] bpo-31234: Fix dangling thread in test_ftp/poplib (#3554)Victor Stinner2017-09-132-1/+17
| | | | | | | | | | | | | | | * bpo-31234: Fix dangling thread in test_ftp/poplib (#3540) Explicitly clear the server attribute in test_ftplib and test_poplib to prevent dangling thread. (cherry picked from commit d403a29c0055de6b03ed5ae7a5c564e1c95a5950) * bpo-31234: Fix dangling thread in test_ftplib (#3544) Clear also self.server_thread attribute in TestTimeouts.tearDown(). (cherry picked from commit b157ce1e58b03988ce4340a55d0b856125833cc5)
* [3.6] bpo-31448, test_poplib: Fix ResourceWarning (GH-3542) (#3543)Miss Islington (bot)2017-09-131-3/+3
| | | | Call POP3.close(), don't close close directly the sock attribute. (cherry picked from commit d165e14e29b45a22450263722f5c2c386c3a748a)
* [3.6] bpo-31234: test_httpservers joins the server thread (GH-3188) (#3536)Miss Islington (bot)2017-09-131-0/+1
| | | (cherry picked from commit 830d7d2936434ace113822294acce82f62cde41b)
* [3.6] bpo-31234: test_threaded_import: fix test_side_effect_import() ↵Miss Islington (bot)2017-09-131-1/+3
| | | | | | | (GH-3189) (#3537) * Don't leak the module into sys.modules * Avoid dangling thread (cherry picked from commit 41bbd82b6b6a887e893974fa5cdaae7782ae6cac)
* [3.6] bpo-31323: Fix reference leak in test_ssl (GH-3263) (#3538)Miss Islington (bot)2017-09-131-2/+6
| | | | | Store exceptions as string rather than object to prevent reference cycles which cause leaking dangling threads. (cherry picked from commit 868710158910fa38e285ce0e6d50026e1d0b2a8c)
* [3.6] bpo-31249: Fix test_concurrent_futures dangling thread (GH-3521) (#3522)Miss Islington (bot)2017-09-131-0/+3
| | | | | ProcessPoolShutdownTest.test_del_shutdown() now closes the call queue and joins its thread, to prevent leaking a dangling thread. (cherry picked from commit 3bcf157c115ba3e48bce62ac8cb13c703475a113)
* [3.6] bpo-31234: Enhance test_thread.test_forkinthread() (GH-3516) (#3519)Miss Islington (bot)2017-09-121-12/+19
| | | | | | | | | | | | * test_thread.test_forkinthread() now waits until the thread completes. * Check the status in the test method, not in the thread function * Don't ignore RuntimeError anymore: since the commit 346cbd351ee0dd3ab9cb9f0e4cb625556707877e (bpo-16500, os.register_at_fork(), os.fork() cannot fail anymore with RuntimeError. * Replace 0.01 literal with a new POLL_SLEEP constant * test_forkinthread(): test if os.fork() exists rather than testing the platform. (cherry picked from commit a15d155aadfad232158f530278505cdc6f326f93)
* [3.6] bpo-31250: test_asyncio: fix dangling threads (#3517)Victor Stinner2017-09-123-3/+4
| | | | | | | | | | | | | | | | | | | | | | * bpo-31250, test_asyncio: fix dangling threads (#3252) * Explicitly call shutdown(wait=True) on executors to wait until all threads complete to prevent side effects between tests. * Fix test_loop_self_reading_exception(): don't mock loop.close(). Previously, the original close() method was called rather than the mock, because how set_event_loop() registered loop.close(). (cherry picked from commit 16432beadb8eba079c9786cc0c0eaacfd9fd2f7b) * bpo-31250, test_asyncio: fix EventLoopTestsMixin.tearDown() (#3264) Call doCleanups() to close the loop after calling executor.shutdown(wait=True): see TestCase.set_event_loop() of asyncio.test_utils. Replace also gc.collect() with support.gc_collect(). (cherry picked from commit e8a533fbc734af6eeb389202ba6c6e9c2548027f)
* [3.6] bpo-31416: Fix assertion failures in case of a bad warnings.filters or ↵Serhiy Storchaka2017-09-121-0/+15
| | | | | | warnings.defaultaction. (GH-3496) (#3509) Patch by Oren Milman.. (cherry picked from commit 9d984fd2b097c8c29479d1c3eb740995fe1ccb0d)
* [3.6] bpo-31373: remove overly strict float range checks (GH-3486) (#3495)Benjamin Peterson2017-09-122-0/+12
| | | | | | This undoes a853a8ba7850381d49b284295dd6f0dc491dbe44 except for the pytime.c parts. We want to continue to allow IEEE 754 doubles larger than FLT_MAX to be rounded into finite floats. Tests were added to very this behavior. (cherry picked from commit 2bb69a5b4e7f96cb35d1b28aa7b7b3974b351f59)
* [3.6] bpo-31411: Prevent raising a SystemError in case warnings.onceregistry ↵Serhiy Storchaka2017-09-111-0/+11
| | | | | is not a dictionary. (GH-3485). (#3494) (cherry picked from commit 252033d50effa08046ac34fcc406bc99796ab88b)
* [3.6] bpo-26669: Fix nan arg value error in pytime.c (GH-3085) (GH-3467) Miss Islington (bot)2017-09-091-0/+29
| | | | | | * Modify NaN check function and error message * Fix pytime.c when arg is nan * fix whitespace (cherry picked from commit 829dacce4fca60fc3c3367980e75e21dfcdbe6be)
* [3.6] bpo-30822: Deduplicate ZoneInfoTest classes in test_datetime. ↵Miss Islington (bot)2017-09-081-0/+1
| | | | | (GH-2534) (#3405) (cherry picked from commit 34b54873b51a1ebee2a3c57b7205537b4f33128d)
* [3.6] bpo-29136: Add TLS 1.3 cipher suites and OP_NO_TLSv1_3 (GH-1363) (#3444)Christian Heimes2017-09-081-0/+32
| | | | | | | | | | | | | | | | * bpo-29136: Add TLS 1.3 support TLS 1.3 introduces a new, distinct set of cipher suites. The TLS 1.3 cipher suites don't overlap with cipher suites from TLS 1.2 and earlier. Since Python sets its own set of permitted ciphers, TLS 1.3 handshake will fail as soon as OpenSSL 1.1.1 is released. Let's enable the common AES-GCM and ChaCha20 suites. Additionally the flag OP_NO_TLSv1_3 is added. It defaults to 0 (no op) with OpenSSL prior to 1.1.1. This allows applications to opt-out from TLS 1.3 now. Signed-off-by: Christian Heimes <christian@python.org>. (cherry picked from commit cb5b68abdeb1b1d56c581d5b4d647018703d61e3)
* [3.6] bpo-27340: Use memoryview in SSLSocket.sendall() (GH-3384) (#3434)Christian Heimes2017-09-071-1/+11
| | | | | | | | | | | | | | * bpo-27340: Use memoryview in SSLSocket.sendall() SSLSocket.sendall() now uses memoryview to create slices of data. This fix support for all bytes-like object. It is also more efficient and avoids costly copies. Signed-off-by: Christian Heimes <christian@python.org> * Cast view to bytes, fix typo Signed-off-by: Christian Heimes <christian@python.org>. (cherry picked from commit 888bbdc192ec4db888a294ef758cf5510442dc9a)
* bpo-30465: Fix lineno and col_offset in fstring AST nodes (GH-1800) (gh-3409)Miss Islington (bot)2017-09-071-0/+248
| | | | For f-string ast nodes, fix the line and columns so that tools such as flake8 can identify them correctly. (cherry picked from commit e7c566caf177afe43b57f0b2723e723d880368e8)
* [3.6] bpo-31178: Avoid concatenating bytes with str in subprocess error ↵Gregory P. Smith2017-09-061-0/+47
| | | | | | (GH-3066) (#3388) Avoid concatenating bytes with str in the typically rare subprocess error path (exec failed). Includes a mock based unittest to exercise the codepath. (cherry picked from commit 3fc499bca18454b9f432b9b0106cab662bfeb549)
* [3.6] Stop test_xmlrpc from writing to sys.stderr (GH-3359) (#3380)Miss Islington (bot)2017-09-061-0/+4
| | | | | | | | | One test case of test_xmlrpc uses HTTPServer with a subclass of BaseHTTPRequestHandler. The BaseRequestHandler class logs to sys.stderr by default. Override log_message() to not clobber test output. Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit 3463ee3972e0d14351ee18bce60ecfbf7ac96772)
* [3.6] bpo-29781: Fix SSLObject.version before handshake (GH-3364) (#3381)Christian Heimes2017-09-061-0/+2
| | | | | | | SSLObject.version() now correctly returns None when handshake over BIO has not been performed yet. Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit 6877111)
* [3.6] bpo-31320: No traceback to sys.stderr in test_ssl (GH-3360) (GH-3369)Miss Islington (bot)2017-09-061-1/+4
| | | | | | | | In case PROTOCOL_TLS_SERVER is used for both client context and server context, the test thread dies with OSError. Catch OSError to avoid traceback on sys.stderr Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit 305e56c27afce605e5d2f71903a966cf0bb95038)