summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* update pydoc topicsBenjamin Peterson2017-08-261-80/+13577
|
* bpo-31258: test_urllib2_localnet uses addCleanup(server.stop) (#3184)Victor Stinner2017-08-221-90/+57
| | | | Use self.addCleanup(self.server.stop) to stop the HTTP server. Some tests didn't stop the server like test_https().
* bpo-31258: test_signal: call waitpid() to prevent zombie process (#3183)Victor Stinner2017-08-221-0/+3
|
* bpo-30871: Add test.pythoninfo (#3174) (#3175)Victor Stinner2017-08-222-1/+433
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-30871: Add test.pythoninfo (#3075) * Add Lib/test/pythoninfo.py: script collecting various informations about Python to help debugging test failures. * regrtest: remove sys.hash_info and sys.flags from header. * Travis CI, Appveyor: run pythoninfo before tests (cherry picked from commit b907abc88589f7bea52c5afe172ececc6edcda70) * bpo-30871: pythoninfo: add expat and _decimal (#3121) * bpo-30871: pythoninfo: add expat and _decimal * Remove _decimal.__version__ The string is hardcoded, not really interesting. (cherry picked from commit f6ebd838f00b4c211c72d85ee49749e910cd3afe) * bpo-30871: Add "make pythoninfo" (#3120) (cherry picked from commit a3a01a2fceab2188b282ab9911f79c99a4c32273) * bpo-30871: pythoninfo: more sys, os, time data (#3130) * bpo-30871: pythoninfo: more sys, os, time data PythonInfo now converts types other than intger to string by default. * fix typo (cherry picked from commit ad7eaed54382b346784e51a6f0122ce81e8842b5) * bpo-31231: Fix pythoninfo in Travis config (#3134) bpo-31231, bpo-30871: Replace "./python -m test.pythoninfo" with "make pythoninfo", since macOS uses ./python.exe. (cherry picked from commit 92b1f90143286385c0ff5be98d3721b90580a912) (cherry picked from commit 29d007bb670b486788f73c2d742b0ad0b679ff13)
* regrtest: fix test to choose if header should be displayed (#3172)Victor Stinner2017-08-211-12/+12
| | | Check "tests" before its value is replaced.
* bpo-30263: regrtest: add system load average (#3165)Victor Stinner2017-08-212-4/+34
| | | Add the CPU count in the header.
* bpo-31069, test_multiprocessing: Fix dangling process (#3103) (#3105)Victor Stinner2017-08-161-1/+2
| | | | | Fix a warning about dangling processes in test_rapid_restart() of _test_multiprocessing: join the process. (cherry picked from commit 17657bb9458ff8f8804b7637d61686a68f4b9471)
* [2.7] bpo-30714: ALPN changes for OpenSSL 1.1.0f (#3094)Christian Heimes2017-08-151-2/+3
| | | | | | | | | | | OpenSSL 1.1.0 to 1.1.0e aborted the handshake when server and client could not agree on a protocol using ALPN. OpenSSL 1.1.0f changed that. The most recent version now behaves like OpenSSL 1.0.2 again. The ALPN callback can pretend to not been set. See https://github.com/openssl/openssl/pull/3158 for more details Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit a5c1bab352671e043645163ca50c5211aa657acd)
* bpo-31067: test_subprocess calls reap_children() (#2931) (#3073)Victor Stinner2017-08-111-0/+2
| | | | | test_subprocess now also calls reap_children() in tearDown(), not only on setUp(). (cherry picked from commit cc42c121eb5346f673247f95dac575aadb77d66c)
* bpo-31173: Rewrite WSTOPSIG test of test_subprocess (#3055) (#3071)Victor Stinner2017-08-111-33/+26
| | | | | | | | | | | | | | The current test_child_terminated_in_stopped_state() function test creates a child process which calls ptrace(PTRACE_TRACEME, 0, 0) and then crash (SIGSEGV). The problem is that calling os.waitpid() in the parent process is not enough to close the process: the child process remains alive and so the unit test leaks a child process in a strange state. Closing the child process requires non-trivial code, maybe platform specific. Remove the functional test and replaces it with an unit test which mocks os.waitpid() using a new _testcapi.W_STOPCODE() function to test the WIFSTOPPED() path. (cherry picked from commit 7b7c6dcfff6a35333988a3c74c895ed19dff2e09)
* [2.7] bpo-31160: Backport reap_children fixes from master to 2.7 (#3063)Victor Stinner2017-08-102-0/+11
| | | | | | | | | | | | | | * bpo-31160: regrtest now reaps child processes (#3044) Add a post_test_cleanup() function which currently only calls support.reap_children(). (cherry picked from commit e3510d74aacc477c30f42f2b941d69689bbc478e) * bpo-31160: test_tempfile: Fix reap_children() warning (#3056) TestRandomNameSequence.test_process_awareness() now calls os.waitpid() to avoid leaking a zombie process. (cherry picked from commit 6c8c2943d996b59a48d331f61f22cbe72933910e)
* [2.7] bpo-31150: Wait for child process in test_forkinthread to avoid thread ↵Ammar Askar2017-08-091-0/+2
| | | | reaped warnings (#3042)
* ttk: fix LabeledScale and OptionMenu destroy() method (#3026)Victor Stinner2017-08-081-2/+7
| | | | | | | | bpo-31135: Call the parent destroy() method even if the used attribute doesn't exist. The LabeledScale.destroy() method now also explicitly clears label and scale attributes to help the garbage collector to destroy all widgets.
* [2.7] bpo-31107: Fix copyreg mangled slot names calculation. (GH-2989). (#3004)Shane Harvey2017-08-052-1/+15
| | | (cherry picked from commit c4c9866064f03646c686d7e08b00aeb203c35c19)
* bpo-29902: Emit a Py3k deprecation warning when pickling or copying (#2823)Serhiy Storchaka2017-08-023-14/+76
| | | | | | some builtin and extension objects that don't support pickling explicitly and are pickled incorrectly by default (like memoryview or staticmethod).
* bpo-29519: weakref spewing exceptions during interp finalization (#2958)INADA Naoki2017-07-311-2/+2
| | | (cherry pick from 9cd7e17640a49635d1c1f8c2989578a8fc2c1de6)
* [2.7] bpo-31044: Skip test_posix.test_makedev() on FreeBSD (#2915) (#2918)Victor Stinner2017-07-271-0/+4
| | | | | | | | | | | * bpo-31044: Skip test_posix.test_makedev() on FreeBSD (#2915) There is a bug in FreeBSD CURRENT with 64-bit dev_t. Skip the test if dev_t is larger than 32-bit, until the bug is fixed in FreeBSD CURRENT. (cherry picked from commit 12953ffe12ac781332b384c36b25d12216b1db62) * Fix syntax for Python 2.7
* bpo-31028: Fix test_pydoc when run directly (#2864) (#2911)Victor Stinner2017-07-271-1/+1
| | | | | | | | | | | * bpo-31028: Fix test_pydoc when run directly Fix get_pydoc_link() of test_pydoc to fix "./python Lib/test/test_pydoc.py": get the absolute path to __file__ to prevent relative directories. * Use realpath() instead of abspath() (cherry picked from commit fd46561167af6cd697191dd7ebb8c2fef5ad6493)
* bpo-30980: Fix double close in asyncore.file_wrapper (#2789) (#2900)Nir Soffer2017-07-262-1/+18
| | | | | | | | | | | | | | * bpo-30980: Fix close test to fail test_close_twice was not considering the fact that file_wrapper is duping the file descriptor. Closing the original descriptor left the duped one open, hiding the fact that close protection is not effective. * bpo-30980: Fix double close protection Invalidated self.fd before closing, handling correctly the case when os.close raises. * bpo-30980: Fix fd leak introduced in the fixed test
* bpo-30778: Skip test_bsddb3 on Windows XP (#2877)Victor Stinner2017-07-261-0/+4
| | | | | | * bpo-30778: Skip test_bsddb3 on Windows XP * Fix if, don't skip Windows Vista
* bpo-31019: Fix multiprocessing.Process.is_alive() (#2875) (#2882)Victor Stinner2017-07-261-2/+8
| | | | | | | multiprocessing.Process.is_alive() now removes the process from the _children set if the process completed. The change prevents leaking "dangling" processes. (cherry picked from commit 2db64823c20538a6cfc6033661fab5711d2d4585)
* [3.6] bpo-30595: Fix multiprocessing.Queue.get(timeout) (#2027) (#2881) (#2883)Victor Stinner2017-07-261-1/+1
| | | | | | | | | | | | | | | | | | | * bpo-30595: Fix multiprocessing.Queue.get(timeout) (#2027) multiprocessing.Queue.get() with a timeout now polls its reader in non-blocking mode if it succeeded to aquire the lock but the acquire took longer than the timeout. Co-Authored-By: Grzegorz Grzywacz <grzgrzgrz3@gmail.com> (cherry picked from commit 1b7863c3b6519c6e134c28cab8b8af0dea43e375) * bpo-30595: Increase test_queue_feeder_donot_stop_onexc() timeout (#2148) _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) (cherry picked from commit e42339d3a08a8fde3349722def85d7a8e49899be)
* [2.7] bpo-30119: fix ftplib.FTP.putline() to throw an error for a illegal ↵Dong-hee Na2017-07-262-0/+5
| | | | command (#1214) (#2894)
* test_bsddb3 tolerates smaller timeout on Windows (#2840)Victor Stinner2017-07-241-2/+9
| | | | | bpo-30850: On Windows, test04_lock_timeout2() now tolerates 50 ms whereas 100 ms is expected. The lock sometimes times out after only 58 ms. Windows clocks have a bad resolution and bad accuracy.
* bpo-30822: regrtest: fix -u extralargefile (#2788)Victor Stinner2017-07-211-4/+10
| | | | Fix also regrtest command line parser to allow passing -u extralargefile to run test_zipfile64.
* [2.7] bpo-30883: Use pythontest.net instead of debian.org in test_urllib2net ↵Ammar Askar2017-07-191-3/+3
| | | | (GH-2755)
* [2.7] bpo-30911: Add tests for bad boolean arguments for accelerated json ↵Serhiy Storchaka2017-07-131-0/+28
| | | | | | (GH-2690) (#2694) encoder and decoder.. (cherry picked from commit d3aaa2f1496aae0809c9ec9623fa528d3a2c16c2)
* [2.7] bpo-30855: Trying to fix test_use on Windows. (#2586)Victor Stinner2017-07-062-4/+3
| | | | | | | | | | | | | | * bpo-30855: Trying to fix test_use on Windows. Avoid possible weird behavior of WideInt convertion. "winfo id" always returns string hexadecimal representation. (cherry picked from commit b9d672491d5082c541bf267eb7bb99fdc6529324) * bpo-30855: Trying to fix test_use on Windows. (cherry picked from commit 29a2f7c6b38e5a6ed891aa72af38974a1ff2d372) (subTest() removed since it was introduced in Python 3)
* Fix trivial typo in json module docstring (GH-2274) (GH-2432)Mariatta2017-07-061-1/+1
| | | (cherry picked from commit 76c567ee27342d76f631a35c8291b715b2a61f3e)
* bpo-30850: Use specialized assert methods in bsddb tests. (#2584)Serhiy Storchaka2017-07-0513-83/+82
| | | This provides more information on test failures.
* bpo-30759: regrtest: list_cases() now unload modules (#2582)Victor Stinner2017-07-051-4/+12
| | | | | | | list_cases() now unload modules, as the test runner does, to prevent a failure in test_xpickle about test.pickletester loaded after loading test_cpickle: ./python -m test --list-cases test_cpickle test_xpickle
* bpo-30759: Copy test_robotparser from master (#2546)Victor Stinner2017-07-051-239/+177
| | | | | | | | | | | | | | | | | Copy Lib/test/test_robotparser.py from master to 2.7 and adapt it for Python 2.7: * Replace urllib.robotparser with robotparser * Adjust HTTPServer import * Replace io.StringIO with StringIO.StringIO * Remove tests on crawl_delay() and request_rate() since these methods were added to Python 3 * Remove subTest() * Add test_main() which explicitly lists all test cases Patch based on the commit 4da0fd06ce49132d5c2e0525c4a31f807690a9ed written by Berker Peksag. Co-Authored-By: Berker Peksag <berker.peksag@gmail.com>
* bpo-30843: regrtest fixes sys.path, restore test.bisect (#2567)Victor Stinner2017-07-053-0/+9
| | | | | * Rename again Lib/test/bisectcmd.py to Lib/test/bisect.py * regrtest now removes '' and Lib/test/ from sys.path * Use absolute import in test_bisect
* bpo-30843: Rename Lib/test/bisect.py to Lib/test/bisectcmd.py (#2563)Victor Stinner2017-07-042-4/+0
| | | | Revert test_bisect.py change: remove "from __future__ import absolute_import".
* bpo-29796: test_weakref: Fix collect_in_thread() on Windows (#2553)Victor Stinner2017-07-041-1/+1
| | | | | | | Sleep 1 ms instead of 0.1 ms to workaround a rounding issue on Windows. On Windows, time.sleep(0.0001) sleeps 0 ms, so collect_in_thread() calls gc.collect() in a loop and tests using this thread takes too long. Sleep 1 ms so time.sleep() sleeps 15.6 ms on Windows.
* 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)