summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
...
* regrtest: fix --list-cases --verbose (#2547)Victor Stinner2017-07-031-15/+16
| | | | Write header and "Using seed ..." after checking for --list-cases and --list-tests.
* [2.7] Rename test_ file that is really a support file to remove test_ ↵Serhiy Storchaka2017-07-0312-60/+60
| | | | | | | | | | prefix. (#2548) I thought I had run the full test suite before the last checkin, but obviously I didn't. test_multibytecodec_support.py isn't really a test file, it is a support file that contains a base test class. Rename it to multibytecodec_support so that regrtest test discovery doesn't think it is a test file that should be run.. (cherry picked from commit 75d9aca97ad3c3d823d2f2211f579454b3216f51)
* [2.7] bpo-29512, bpo-30764: Backport regrtest enhancements from 3.5 to 2.7 ↵Victor Stinner2017-07-033-1/+188
| | | | | | | | | | | | | | | | | | | (#2541) * bpo-29512, bpo-30764: Backport regrtest enhancements from 3.5 to 2.7 * bpo-29512: Add test.bisect, bisect failing tests (#2452) Add a new "python3 -m test.bisect" tool to bisect failing tests. It can be used to find which test method(s) leak references, leak files, etc. * bpo-30764: Fix regrtest --fail-env-changed --forever (#2536) (#2539) --forever now stops if a fail changes the environment. * Fix test_bisect: use absolute import
* bpo-30448: Fix support.SuppressCrashReport on macOS (#2515)Victor Stinner2017-06-301-2/+2
| | | Add missing "import subprocess".
* [2.7] bpo-30807: signal.setitimer() may disable the timer by mistake ↵Antoine Pitrou2017-06-301-0/+10
| | | | | | | | (GH-2493) (#2499) * bpo-30807: signal.setitimer() may disable the timer by mistake * Add NEWS blurb. (cherry picked from commit 729780a810bbcb12b245a1b652302a601fc9f6fd)
* [2.7] Clear potential ref cycle between Process and Process target (GH-2470) ↵Antoine Pitrou2017-06-282-0/+21
| | | | | | | | | | | (#2473) * Clear potential ref cycle between Process and Process target Besides Process.join() not being called, this was an indirect cause of bpo-30775. The threading module already does this. * Add issue reference. (cherry picked from commit 79d37ae979a65ada0b2ac820279ccc3b1cd41ba6)
* [2.7] bpo-30523, bpo-30764, bpo-30776: Sync regrtest from master (#2444)Victor Stinner2017-06-273-42/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-30523: regrtest --list-cases --match (#2401) * regrtest --list-cases now supports --match and --match-file options. Example: ./python -m test --list-cases -m FileTests test_os * --list-cases now also sets support.verbose to False to prevent messages to stdout when loading test modules. * Add support._match_test() private function. (cherry picked from commit ace56d583664f855d89d1219ece7c21c2fddcf30) (cherry picked from commit 36946c06a3bdb1104c53f0fe535086572ffbdd9e) * bpo-30764: regrtest: add --fail-env-changed option (#2402) * bpo-30764: regrtest: change exit code on failure * Exit code 2 if failed tests ("bad") * Exit code 3 if interrupted * bpo-30764: regrtest: add --fail-env-changed option If the option is set, mark a test as failed if it alters the environment, for example if it creates a file without removing it. (cherry picked from commit 63f54c68936d648c70ca411661e4208329edcf26) (cherry picked from commit 1f33857a3677de84bdc6d80c39f577eb081ed85d) * bpo-30776: reduce regrtest -R false positives (#2422) * Change the regrtest --huntrleaks checker to decide if a test file leaks or not. Require that each run leaks at least 1 reference. * Warmup runs are now completely ignored: ignored in the checker test and not used anymore to compute the sum. * Add an unit test for a reference leak. Example of reference differences previously considered a failure (leak) and now considered as success (success, no leak): [3, 0, 0] [0, 1, 0] [8, -8, 1] (cherry picked from commit 48b5c422ffb03affb00c184b9a99e5537be92732) (cherry picked from commit e0f8b43a46850aa5e5992465cab684496f102fe5)
* bpo-30705: Fix test_regrtest.test_crashed() (#2439)Victor Stinner2017-06-273-5/+18
| | | | | | | * Add test.support._crash_python() which triggers a crash but uses test.support.SuppressCrashReport() to prevent a crash report from popping up. * Modify test_child_terminated_in_stopped_state() of test_subprocess and test_crashed() of test_regrtest to use _crash_python().
* bpo-30764: Windows support.SuppressCrashReport (#2423)Victor Stinner2017-06-271-13/+39
| | | | | | * Add Windows support to test.support.SuppressCrashReport: call SetErrorMode() and CrtSetReportMode(). * _testcapi: add CrtSetReportMode() and CrtSetReportFile() functions and CRT_xxx and CRTDBG_xxx constants needed by SuppressCrashReport.
* [2.7] bpo-30764: test_subprocess uses SuppressCrashReport (#2405) (#2412)Victor Stinner2017-06-262-27/+103
| | | | | | | | | | | | | | | * bpo-30764: Backport support.SuppressCrashReport Backport test.support.SuppressCrashReport context-manager from master. Drop the Windows implementation since it depends on msvcrt.CrtSetReportMode() which isn't available on Python 2.7. * bpo-30764: test_subprocess uses SuppressCrashReport (#2405) bpo-30764, bpo-29335: test_child_terminated_in_stopped_state() of test_subprocess now uses support.SuppressCrashReport() to prevent the creation of a core dump on FreeBSD. (cherry picked from commit cdee3f14f7f4c995e7eedb0bf6a67e260c739f7d)
* [2.7] bpo-30746: Prohibited the '=' character in environment variable names ↵Serhiy Storchaka2017-06-252-3/+90
| | | | | | | (GH-2382) (#2393) in `os.putenv()` and `os.spawn*()`.. (cherry picked from commit 77703942c5997dff00c48f10df1b29b11645624c)
* [2.7] bpo-30730: Prevent environment variables injection in subprocess on ↵Serhiy Storchaka2017-06-241-0/+40
| | | | | | Windows. (GH-2325) (#2372) Prevent passing other invalid environment variables and command arguments.. (cherry picked from commit d174d24a5d37d1516b885dc7c82f71ecd5930700)
* [2.7] bpo-30727: Fix a race condition in test_threading. (GH-2334). (#2353)Serhiy Storchaka2017-06-231-5/+14
| | | | (cherry picked from commit 32cb968a2edd482891c33b6f2ebae10f1d305424)
* bpo-8799: Reduce timing sensitivity of condition test by explicitly (#2320)Victor Stinner2017-06-221-0/+15
| | | | | delaying the main thread so that it doesn't race ahead of the workers. (cherry picked from commit 020af2a2bc4708215360a3793b5a1790e15d05dd)
* bpo-30500: urllib: Simplify splithost by calling into urlparse. (#1849) (#2294)Victor Stinner2017-06-202-2/+21
| | | | | | | | | The current regex based splitting produces a wrong result. For example:: http://abc#@def Web browsers parse that URL as ``http://abc/#@def``, that is, the host is ``abc``, the path is ``/``, and the fragment is ``#@def``. (cherry picked from commit 90e01e50ef8a9e6c91f30d965563c378a4ad26de)
* bpo-30540, bpo-30523: Add --matchfile and --list-cases options to regrtest ↵Victor Stinner2017-06-163-12/+141
| | | | | (#2249) [2.7] bpo-30540, bpo-30523: Add --matchfile and --list-cases options to regrtest
* bpo-30675: Fix refleak hunting in regrtest (#2227)Victor Stinner2017-06-161-0/+17
| | | | | regrtest now warms up caches: create explicitly all internal singletons which are created on demand to prevent false positives when checking for reference leaks.
* [2.7] bpo-24484: Avoid race condition in multiprocessing cleanup (GH-2159) ↵Antoine Pitrou2017-06-132-0/+64
| | | | | | | | | | | | | (#2168) * bpo-24484: Avoid race condition in multiprocessing cleanup The finalizer registry can be mutated while inspected by multiprocessing at process exit. * Use test.support.start_threads() * Add Misc/NEWS. (cherry picked from commit 1eb6c0074d17f4fd425cacfdda893d65f5f77f0a)
* [2.7] bpo-29514: Check magic number for bugfix releasesNick Coghlan2017-06-131-0/+58
| | | | | | | | | | | | Add a test to check the current MAGIC_NUMBER against the expected number for the release if the current release is at candidate or final level. On test failure, describe to the developer the procedure for changing the magic number. This ensures that pre-merge CI will automatically pick up on magic number changes in maintenance releases (and explain why those are problematic), rather than relying on all core developers to be aware of the implications of such changes.
* [2.7] bpo-28994: Fixed errors handling in atexit._run_exitfuncs(). (GH-2034) ↵Serhiy Storchaka2017-06-121-2/+14
| | | | | | (#2123) The traceback no longer displayed for SystemExit raised in a callback registered by atexit.. (cherry picked from commit 3fd54d4a7e604067e2bc0f8cfd58bdbdc09fa7f4)
* [2.7] bpo-27425: Be more explicit in .gitattributes (GH-840) (GH-2086)Zachary Ware2017-06-112-5/+5
| | | Also updates checked-in line endings in several files.
* bpo-30418: Popen.communicate() always ignore EINVAL (#2002) (#2006)Victor Stinner2017-06-081-4/+5
| | | | | | On Windows, subprocess.Popen.communicate() now also ignore EINVAL on stdin.write() if the child process is still running but closed the pipe. (cherry picked from commit d52aa31378ae43e044a300edfe8285954c167216)
* Simplify code in warnings modules (#1957)Alex Gaynor2017-06-051-3/+6
| | | | | Metaprogramming a list of attributes was excessive, and made the code less readable and slower. Backport of 5de3a64179bafcd440b32849b1129ed1fea47b85
* Skip UNC tests on AppVeyor in case of ENOENT (GH-1950)Zachary Ware2017-06-042-2/+2
|
* bpo-30378: Fix the problem that SysLogHandler can't handle IPv6 addresses ↵Xiang Zhang2017-06-011-6/+21
| | | | (#1904) (#1676)
* [2.7] bpo-29960 _random.Random corrupted on exception in setstate(). … (#1289)Mariatta2017-05-271-0/+5
| | | (cherry picked from commit 9616a82e7802241a4b74cf7ae38d43c37bf66e48)
* [2.7] bpo-30310: tkFont now supports unicode options (e.g. font family). (#1567)Serhiy Storchaka2017-05-262-2/+14
|
* [2.7] bpo-30414: multiprocessing.Queue._feed do not break from main loop on ↵Antoine Pitrou2017-05-252-10/+23
| | | | | | | | | | | | | | | | | | exc (GH-1683) (#1817) * bpo-30414: multiprocesing.Queue._feed do not break from main loop on exc Queue background running thread was not handling exceptions correctly. Any exception occurred inside thread (putting unpickable object) cause feeder to finish running. After that every message put into queue is silently ignored. * bpo-30414: multiprocesing.Queue._feed do not break from main loop on exc Queue background running thread was not handling exceptions correctly. Any exception occurred inside thread (putting unpickable object) cause feeder to finish running. After that every message put into queue is silently ignored.. (cherry picked from commit bc50f03db4f58c869b78e98468e374d7e61f1227)
* bpo-30394: Fix a socket leak in smtplib.SMTP.__init__() (#1700) (#1788)Stéphane Wirtel2017-05-241-0/+1
|
* Fix spelling mistakes in tkinter.py (#1754)Vijay Kumar2017-05-231-5/+5
| | | Ran the docstrings through spell checker, and fixed spelling issues.
* bpo-30003: Fix handling escape characters in HZ codec (#1720) (#1556)Xiang Zhang2017-05-221-0/+4
|
* [2.7] bpo-30415: Add new tests for the fnmatch module. (GH-1684). (#1696)Serhiy Storchaka2017-05-211-11/+104
| | | (cherry picked from commit 817554715b5578b0bac5c35e6ec9a1abd8649e53)
* bpo-30409: locale.getpreferredencoding doesn't return result (#1672)Sean McCully2017-05-211-13/+10
|
* [2.7] bpo-27945: Fixed various segfaults with dict. (GH-1657) (#1681)Serhiy Storchaka2017-05-201-0/+91
| | | | | Based on patches by Duane Griffin and Tim Mitchell. (cherry picked from commit 753bca3934a7618a4fa96e107ad1c5c18633a683)
* [2.7] bpo-25794: Fix `type.__setattr__()` for non-interned or unicode ↵Serhiy Storchaka2017-05-201-0/+43
| | | | | | attribute names. (GH-1652) (#1675) Based on patch by Eryk Sun. (cherry picked from commit d896985bb2de49046f9b6879e906d1e4db255e23)
* bpo-26434: Fix multiprocessing grandchilds in a Windows service (GH-1167)Marc Schlaich2017-05-191-1/+2
| | | Patch by Davin with help from Marc.
* [2.7] bpo-30375: Correct the stacklevel of regex compiling warnings. (#1595) ↵Serhiy Storchaka2017-05-181-21/+21
| | | | | | | | | (#1648) Warnings emitted when compile a regular expression now always point to the line in the user code. Previously they could point into inners of the re module if emitted from inside of groups or conditionals. (cherry picked from commit c7ac7280c321b3c1679fe5f657a6be0f86adf173)
* [2.7] bpo-30363: Backport warnings in the re module. (#1577)Serhiy Storchaka2017-05-184-18/+110
| | | | | | Running Python with the -3 option now warns about regular expression syntax that is invalid or has different semantic in Python 3 or will change the behavior in future Python versions.
* bpo-30365: Backport warnings and fix bugs in ElementTree. (#1581)Serhiy Storchaka2017-05-172-51/+66
| | | | | | | | | | | | | | | | | | Running Python with the -3 option now emits deprecation warnings for getchildren() and getiterator() methods of the Element class in the xml.etree.cElementTree module and when pass the html argument to xml.etree.ElementTree.XMLParser(). Fixed a deprecation warning about the doctype() method of the xml.etree.ElementTree.XMLParser class. Now it is emitted only when define the doctype() method in the subclass of XMLParser. Fixed a bug in the test_bug_200708_close test method. An EchoTarget instance was incorrectly passed to XMLParser() as the html argument and silently ignored. Tests no longer failed when use the -m option for running only selected test methods. Checking warnings now is more specific, warnings are expected only when use deprecated features.
* bpo-30329: Catch Windows error 10022 on shutdown() (#1538) (#1624)Victor Stinner2017-05-171-2/+4
| | | | | | | Catch the Windows socket WSAEINVAL error (code 10022) in imaplib on shutdown(SHUT_RDWR): An invalid operation was attempted This error occurs sometimes on SSL connections. (cherry picked from commit 83a2c2879839da2e10037f5e4af1bd1dafbf1a52)
* bpo-30357 each test in test_thread waits until all spawned threads finish ↵grzgrzgrz32017-05-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | (#1583) * bpo-30357 each test in test_thread waits until all spawn threads finish * bpo-30357 each test in test_thread waits until all spawn threads finish * bpo-30357: test_thread now uses threading_cleanup() (#1592) test_thread: setUp() now uses support.threading_setup() and support.threading_cleanup() to wait until threads complete to avoid random side effects on following tests. Co-Authored-By: Victor Stinner <victor.stinner@gmail.com> * bpo-30357: test_thread now uses threading_cleanup() (#1592) test_thread: setUp() now uses support.threading_setup() and support.threading_cleanup() to wait until threads complete to avoid random side effects on following tests. Co-Authored-By: Victor Stinner <victor.stinner@gmail.com>
* bpo-11790: Fix sporadic failures in ↵Victor Stinner2017-05-151-1/+7
| | | | | test_multiprocessing.WithProcessesTestCondition. (#1591) (cherry picked from commit f25a8de845d20349a265442eb0f3dcd71d0d7ac5)
* [2.7] bpo-30366: Backport tests for test.support. (#1582)Serhiy Storchaka2017-05-152-35/+452
| | | | | | | Also backport new functions temp_dir() and python_is_optimized(). temp_cwd() now accepts None as a name (means using tempfile.mkdtemp). check_syntax_error() now accepts arguments lineno and offset. Use more specific error messages in get_attribute().
* bpo-6393: Fix locale.getprerredencoding() on macOS (#1555)Victor Stinner2017-05-121-1/+13
| | | | | | Fix for bpo-6393: Python crashes on OSX when $LANG is set to some (but not all) invalid values due to an invalid result from nl_langinfo (cherry picked from commit 6d77e07196bfb5dfa4de6f5d80b2619c0643a75e)
* bpo-30342: Fix sysconfig.is_python_build() on VS9.0 (#1544)Victor Stinner2017-05-122-0/+7
| | | | Fix sysconfig.is_python_build() if Python is built with Visual Studio 2008 (VS 9.0).
* [2.7] bpo-30283: regrtest: backport test_slow_interrupted() and ↵Victor Stinner2017-05-112-25/+75
| | | | | | | | | | | | | | | | | | | | | | | | | test_coverage() (#1541) * bpo-30283: regrtest: backport test_coverage() * Add --coverage option, the option was already described in the doc * When coverage is used, regrtest now pass all options to runtest() and calls also accumulate_result() (as done when coverage is not used). * bpo-25260: Fix coverage on Windows: remove the list of ignored directories. * bpo-30283: regrtest: backport test_slow_interrupted() * Fix regrtest to report interrupted tests as omitted rather than failed. * bpo-25260: Fix coverage on Windows: remove the list of ignored directories. * bpo-30283: Fix test_regrtest on Visual Studio 2008 Skip Tools\buildbot\test.bat and PCbuild\rt.bat if Python was not compiled in PCbuild (but compiled in PC\VS9.0\ for example).
* bpo-15526: test_startfile changes the cwd (#1537)Victor Stinner2017-05-101-12/+15
| | | | | | | | | | | | Try to fix test_startfile's inability to clean up after itself in time. Patch by Jeremy Kloth. Fix the following support.rmtree() error while trying to remove the temporary working directory used by Python tests: WindowsError: [Error 32] The process cannot access the file because it is being used by another process: ... Original commit: 8a53dbeb7a9d0ae3e446f36e56cf9acfabe443c1
* bpo-30283: Backport regrtest features from master to 2.7 (#1516)Victor Stinner2017-05-092-57/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * regrtest: add --slowest alias to --slow * make buildbottest: add --slowest option * regrtest: add "- " prefix to --slowest output * regrtest: Fix an outdated comment * regrtest: replace PermissionError Replace PermissionError with OSError and check on exc.errno. PermissionError was added to Python 3.3. * regrtest: add -3 -tt options to run Python scripts * regrtest: backport --list-tests option * regrtest: backport "Tests result: xxx" summary * regrtest: backport total duration * regrtest: add timestamp to the progress * regrtest: describe previous test state * Add the state of the test: passed, failed, etc. * If a test took longer than 30 seconds, log its execution time * regrtest: -jN logs running workers * regrtest: mention if tests are run in parallel * regrtest: parallel mode is more verbose during wait Display running tests every 30 seconds if no test completed in the meanwhile. * test_regrtest: fix typo in SubprocessRun
* [2.7] bpo-30283: Backport test_regrtest from master to 2.7 (#1513)Victor Stinner2017-05-092-22/+473
| | | | | | | | | | * bpo-30283: regrtest: add --testdir option * bpo-30283: Backport _testcapi.raise_signal() Function used by test_regrtest to simulate an interrupted unit test. * bpo-30283: Backport test_regrtest from master
* Fix SyntaxWarning on importing test_inspect (#1512)Victor Stinner2017-05-091-5/+11
| | | | | | | | | Fix the following warning when test_inspect.py is compiled to test_inspect.pyc: test_inspect.py:505: SyntaxWarning: tuple parameter unpacking has been removed in 3.x def spam_deref(a, b, c, d=3, (e, (f,))=(4, (5,)), *g, **h): Replace also test.test_support import with test.support.