summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-35409: Ignore GeneratorExit in async_gen_athrow_throw (GH-14755)Miss Islington (bot)2019-11-191-0/+27
| | | | | | | | Ignore `GeneratorExit` exceptions when throwing an exception into the `aclose` coroutine of an asynchronous generator. https://bugs.python.org/issue35409 (cherry picked from commit 8e0de2a4808d7c2f4adedabff89ee64e0338790a) Co-authored-by: Vincent Michel <vxgmichel@gmail.com>
* bpo-38453: Ensure correct short path is obtained for test (GH-17184)Miss Islington (bot)2019-11-161-3/+21
| | | | | (cherry picked from commit 7c6130c8c36c941255365e5414c956fc919b8629) Co-authored-by: Steve Dower <steve.dower@python.org>
* bpo-38453: Ensure ntpath.realpath correctly resolves relative paths (GH-16967)Steve Dower2019-11-152-15/+49
| | | | | Ensure isabs() is always True for \\?\ prefixed paths Avoid unnecessary usage of readlink() to avoid resolving broken links incorrectly Ensure shutil tests run in test directory
* bpo-38785: Prevent asyncio from crashing (GH-17144)Miss Islington (bot)2019-11-131-0/+39
| | | | | | | | if parent `__init__` is not called from a constructor of object derived from `asyncio.Future` https://bugs.python.org/issue38785 (cherry picked from commit dad6be5ffe48beb74fad78cf758b886afddc7aed) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* [3.8] closes bpo-27805: Ignore ESPIPE in initializing seek of append-mode ↵Benjamin Peterson2019-11-121-0/+11
| | | | | | files. (GH-17136) This change, which follows the behavior of C stdio's fdopen and Python 2's file object, allows pipes to be opened in append mode.. (cherry picked from commit 74fa9f723f700a342e582b5ad4b51a2c4801cd1c)
* bpo-22367: Add tests for fcntl.lockf(). (GH-17010)Miss Islington (bot)2019-11-091-1/+28
| | | | | (cherry picked from commit befa032d8869e0fab4732d910f3887642879d644) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* [3.8] Slightly improve plistlib test coverage. (GH-17025) (GH-17028)Jon Janzen2019-11-021-5/+21
| | | | | | | | | | | | | | * Add missing test class (mistake in GH-4455) * Increase coverage with 4 more test cases * Rename neg_uid to huge_uid in test_modified_uid_huge * Replace test_main() with unittest.main() * Update plistlib docs. (cherry picked from commit d0d9f7cfa36bafa4e1d9e73eb08835180d376df1) Co-authored-by: Jon Janzen <jjjonjanzen@gmail.com>
* bpo-38640: Allow break and continue in always false while loops (GH-16992)Miss Skeleton (bot)2019-10-301-0/+18
| | | | | (cherry picked from commit 6c3e66a34b95fff07df0ad5086104dd637a091ce) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-36993: Improve error reporting for zipfiles with bad zip64 extra data. ↵Miss Skeleton (bot)2019-10-291-0/+222
| | | | | | | (GH-14656) (cherry picked from commit da6ce58dd5ac109485af45878fca6bfd265b43e9) Co-authored-by: Daniel Hillier <daniel.hillier@gmail.com>
* bpo-38334: Fix seeking backward on an encrypted zipfile.ZipExtFile. (GH-16937)Miss Skeleton (bot)2019-10-271-0/+38
| | | | | | Test by Daniel Hillier. (cherry picked from commit 5c32af7522d908e8c7da0243af37618433289cc5) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-38535: Fix positions for AST nodes for calls without arguments in ↵Miss Skeleton (bot)2019-10-261-6/+6
| | | | | | | decorators. (GH-16861) (cherry picked from commit 26ae9f6d3d755734c9f371b9356325afe5764813) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-34679: ProactorEventLoop only uses set_wakeup_fd() in main thread (GH-16901)Miss Skeleton (bot)2019-10-231-0/+2
| | | | | | | bpo-34679, bpo-38563: asyncio.ProactorEventLoop.close() now only calls signal.set_wakeup_fd() in the main thread. (cherry picked from commit 1b53a24fb4417c764dd5933bce505f5c94249ca6) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-31202: Preserve case of literal parts in Path.glob() on Windows. (GH-16860)Miss Skeleton (bot)2019-10-211-0/+4
| | | | | (cherry picked from commit 10ecbadb799ddf3393d1fc80119a3db14724d381) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-38525: Fix a segmentation fault when using reverse iterators of empty ↵Miss Islington (bot)2019-10-191-0/+25
| | | | | | | | dict (GH-16846) The reverse iterator for empty dictionaries was not handling correctly shared-key dictionaries. (cherry picked from commit 24dc2f8c56697f9ee51a4887cf0814b6600c1815) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* bpo-38521: Fix error in NormalDist.__eq__() (GH-16840) (GH-16842)Miss Islington (bot)2019-10-181-0/+4
| | | | | (cherry picked from commit 5eabec022b9a10734fcf58faad02c4d233592f64) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
* [3.8] bpo-27657: Fix urlparse() with numeric paths (GH-661) (#16839)Senthil Kumaran2019-10-181-4/+6
| | | | | | | | | | | | * bpo-27657: Fix urlparse() with numeric paths Revert parsing decision from bpo-754016 in favor of the documented consensus in bpo-16932 of how to treat strings without a // to designate the netloc. * bpo-22891: Remove urlsplit() optimization for 'http' prefixed inputs. (cherry picked from commit 5a88d50ff013a64fbdb25b877c87644a9034c969) Co-authored-by: Tim Graham <timograham@gmail.com>
* bpo-33604: Raise TypeError on missing hmac arg. (GH-16805)Miss Islington (bot)2019-10-181-1/+6
| | | | | | | | | | | | | Also updates the documentation to clarify the situation surrounding the digestmod parameter that is required despite its position in the argument list as of 3.8.0 as well as removing old python2 era references to "binary strings". We indavertently had this raise ValueError in 3.8.0 for the missing arg. This is not considered an API change as no reasonable code would be catching this missing argument error in order to handle it. (cherry picked from commit f33c57d5c780da1500619f548585792bb5b750ee) Co-authored-by: Gregory P. Smith <greg@krypto.org>
* bpo-35998: Fix test_asyncio.test_start_tls_server_1() (GH-16815)Miss Islington (bot)2019-10-161-14/+10
| | | | | | | | | | | | | main() is now responsible to send the ANSWER, rather than ServerProto. main() now waits until it got the HELLO before sending the ANSWER over the new transport. Previously, there was a race condition between main() replacing the protocol and the protocol sending the ANSWER once it gets the HELLO. TLSv1.3 was disabled for the test: reenable it. (cherry picked from commit fab4ef2df0857ab0c97f3058ac5ec3280c4eb891) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-38478: Correctly handle keyword argument with same name as ↵Miss Islington (bot)2019-10-151-0/+10
| | | | | | | positional-only parameter (GH-16800) (cherry picked from commit f3ef06a7cb347ab7bd3cc2b0b3dcebe4f9ff36f9) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* [3.8] bpo-36389: Backport debug enhancements from master (GH-16796)Victor Stinner2019-10-152-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-36389: _PyObject_CheckConsistency() available in release mode (GH-16612) bpo-36389, bpo-38376: The _PyObject_CheckConsistency() function is now also available in release mode. For example, it can be used to debug a crash in the visit_decref() function of the GC. Modify the following functions to also work in release mode: * _PyDict_CheckConsistency() * _PyObject_CheckConsistency() * _PyType_CheckConsistency() * _PyUnicode_CheckConsistency() Other changes: * _PyMem_IsPtrFreed(ptr) now also returns 1 if ptr is NULL (equals to 0). * _PyBytesWriter_CheckConsistency() now returns 1 and is only used with assert(). * Reorder _PyObject_Dump() to write safe fields first, and only attempt to render repr() at the end. (cherry picked from commit 6876257eaabdb30f27ebcbd7d2557278ce2e5705) * bpo-36389: Fix _PyBytesWriter in release mode (GH-16624) Fix _PyBytesWriter API when Python is built in release mode with assertions. (cherry picked from commit 60ec6efd96d95476fe5e38c491491add04f026e5) * bpo-38070: Enhance visit_decref() debug trace (GH-16631) subtract_refs() now pass the parent object to visit_decref() which pass it to _PyObject_ASSERT(). So if the "is freed" assertion fails, the parent is used in debug trace, rather than the freed object. The parent object is more likely to contain useful information. Freed objects cannot be inspected are are displayed as "<object at xxx is freed>" with no other detail. (cherry picked from commit 4d5f94b8cd20f804c7868c5395a15aa6032f874c) * Fix also a typo in PYMEM_DEADBYTE macro comment * bpo-36389: Add newline to _PyObject_AssertFailed() (GH-16629) Add a newline between the verbose object dump and the Py_FatalError() logs for readability. (cherry picked from commit 7775349895088a7ae68cecf0c74cf817f15e2c74)
* [3.8] bpo-38456: Use /bin/true in test_subprocess (GH-16737)Gregory P. Smith2019-10-141-39/+51
| | | | | | | | | | | | | | | * [3.8] bpo-38456: Use /bin/true in test_subprocess (GH-16736) Instead of sys.executable, "-c", "pass" or "import sys; sys.exit(0)" use /bin/true when it is available. On a reasonable machine this shaves up to two seconds wall time off the otherwise ~40sec execution on a --with-pydebug build. It should be more notable on many buildbots or overloaded slower I/O systems (CI, etc).. (cherry picked from commit 67b93f80c764bca01c81c989d74a99df208bea4d) * Handle when there is no 'true' command backport of 46113e0cf32748f66cf64cd633984d143b433cd1 by Pablo Galindo.
* bpo-38453: Resolve test directories before chdir to them (GH-16723)Miss Islington (bot)2019-10-141-1/+1
| | | | | (cherry picked from commit d83fc2702951f56a7339aa95d62414ed6e0fb40d) Co-authored-by: Steve Dower <steve.dower@python.org>
* bpo-38469: Handle named expression scope with global/nonlocal keywords ↵Miss Islington (bot)2019-10-141-0/+45
| | | | | | | | (GH-16755) (#16760) The symbol table handing of PEP572's assignment expressions is not resolving correctly the scope of some variables in presence of global/nonlocal keywords in conjunction with comprehensions. (cherry picked from commit fd5c414880b2e05720b9cf14ab0b0d7ae2b7d925) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-38431: Fix __repr__ method of InitVar to work with typing objects. ↵Miss Islington (bot)2019-10-131-0/+2
| | | | | | | (GH-16702) (cherry picked from commit 793cb85437299a3da3d74fe65480d720af330cbb) Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
* bpo-38332: Catch KeyError from unknown cte in encoded-word. (GH-16503)Miss Islington (bot)2019-10-122-0/+14
| | | | | | KeyError should cause a failure in parsing the encoded word and should be caught and raised as a _InvalidEWError instead. (cherry picked from commit 65dcc8a8dc41d3453fd6b987073a5f1b30c5c0fd) Co-authored-by: Andrei Troie <andreitroie90@gmail.com>
* [3.8] bpo-38449: Revert "bpo-22347: Update mimetypes.guess_type to allow ↵Abhilash Raj2019-10-122-9/+1
| | | | | | | | | | | | oper parsing of URLs" (GH-16724) (GH-16728) This reverts commit 87bd2071c756188b6cd577889fb1682831142ceb. The reason for revert is a regression caused by the change in 3.8.0rc1, see bpo-38449 for more details. https://bugs.python.org/issue38449 (cherry picked from commit 19a3d873005e5730eeabdc394c961e93f2ec02f0) Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
* bpo-38347: find pathfix for Python scripts whose name contain a '-' (GH-16536)Miss Islington (bot)2019-10-111-6/+28
| | | | | | pathfix.py: Assume all files that end on '.py' are Python scripts when working recursively. (cherry picked from commit 2b7dc40b2af6578181808ba73c1533fc114e55df) Co-authored-by: Ruediger Pluem <r.pluem@gmx.de>
* Re-enable the OverflowError test for test_truediv on test_complex (GH-16591)Miss Islington (bot)2019-10-101-2/+1
| | | | | (cherry picked from commit 1dbe5373851acb85ba91f0be7b83c69563acd68d) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* bpo-38109: Add missing constants to Lib/stat.py (GH-16665) (GH-16690)Miss Islington (bot)2019-10-101-6/+2
| | | | | | | | Add missing stat.S_IFDOOR, stat.S_IFPORT, stat.S_IFWHT, stat.S_ISDOOR, stat.S_ISPORT, and stat.S_ISWHT values to the Python implementation of the stat module. (cherry picked from commit 7bb14316b8ceddb813f31040a299af94a57ab339) Co-authored-by: Ronan Lamy <ronan.lamy@gmail.com>
* [3.8] bpo-38379: don't claim objects are collected when they aren't ↵Pablo Galindo2019-10-091-0/+70
| | | | | | | | | | | | | | | | | | | | (GH-16658) (GH-16683) * [bpo-38379](https://bugs.python.org/issue38379): when a finalizer resurrects an object, nothing is actually collected in this run of gc. Change the stats to relect that truth. (cherry picked from commit ecbf35f9335b0420cb8adfda6f299d6747a16515) Co-authored-by: Tim Peters <tim.peters@gmail.com> https://bugs.python.org/issue38379 Automerge-Triggered-By: @pablogsal
* bpo-37531: regrtest ignores output on timeout (GH-16659)Miss Islington (bot)2019-10-091-27/+37
| | | | | | | | | | | | | | bpo-37531, bpo-38207: On timeout, regrtest no longer attempts to call `popen.communicate() again: it can hang until all child processes using stdout and stderr pipes completes. Kill the worker process and ignores its output. Reenable test_regrtest.test_multiprocessing_timeout(). bpo-37531: Change also the faulthandler timeout of the main process from 1 minute to 5 minutes, for Python slowest buildbots. (cherry picked from commit 0ec618af98ac250a91ee9c91f8569e6df6772758) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.8] bpo-38395: Fix ownership in weakref.proxy methods (GH-16632) (GH-16662)Pablo Galindo2019-10-081-0/+20
| | | | | | | | | | | | | | | | The implementation of weakref.proxy's methods call back into the Python API using a borrowed references of the weakly referenced object (acquired via PyWeakref_GET_OBJECT). This API call may delete the last reference to the object (either directly or via GC), leaving a dangling pointer, which can be subsequently dereferenced. To fix this, claim a temporary ownership of the referenced object when calling the appropriate method. Some functions because at the moment they do not need to access the borrowed referent, but to protect against future changes to these functions, ownership need to be fixed in all potentially affected methods.. (cherry picked from commit 10cd00a9e3c22af37c748ea5a417f6fb66601e21) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-38405: Make nested subclasses of typing.NamedTuple pickleable. (GH-16641)Miss Islington (bot)2019-10-081-7/+21
| | | | | (cherry picked from commit 13abda41003daf599587991d8291f0dacf6e9519) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-13153: Use OS native encoding for converting between Python and Tcl. ↵Miss Islington (bot)2019-10-041-0/+5
| | | | | | | | | | | | | | | (GH-16545) On Windows use UTF-16 (or UTF-32 for 32-bit Tcl_UniChar) with the "surrogatepass" error handler for converting to/from Tcl Unicode objects. On Linux use UTF-8 with the "surrogateescape" error handler for converting to/from Tcl String objects. Converting strings from Tcl to Python and back now never fails (except MemoryError). (cherry picked from commit 06cb94bc8419b9a24df6b0d724fcd8e40c6971d6) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-38355: Fix ntpath.realpath failing on sys.executable (GH-16551)Miss Islington (bot)2019-10-031-7/+5
| | | | | (cherry picked from commit a0e3d27e4e3cb5b67e325df080fb18b70c2910cf) Co-authored-by: Steve Dower <steve.dower@python.org>
* [3.8] bpo-36670, regrtest: Fix WindowsLoadTracker() for partial line ↵Victor Stinner2019-10-035-74/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-16550) (GH-16560) * bpo-36670, regrtest: Fix WindowsLoadTracker() for partial line (GH-16550) WindowsLoadTracker.read_output() now uses a short buffer for incomplete line. (cherry picked from commit 3e04cd268ee9a57f95dc78d8974b21a6fac3f666) * bpo-36670: Enhance regrtest WindowsLoadTracker (GH-16553) The last line is now passed to the parser even if it does not end with a newline, but only if it's a valid value. (cherry picked from commit c65119d5bfded03f80a9805889391b66fa7bf551) * bpo-36670: Enhance regrtest (GH-16556) * Add log() method: add timestamp and load average prefixes to main messages. * WindowsLoadTracker: * LOAD_FACTOR_1 is now computed using SAMPLING_INTERVAL * Initialize the load to the arithmetic mean of the first 5 values of the Processor Queue Length value (so over 5 seconds), rather than 0.0. * Handle BrokenPipeError and when typeperf exit. * format_duration(1.5) now returns '1.5 sec', rather than '1 sec 500 ms' (cherry picked from commit 098e25672f1c3578855d5ded4f5147795c9ed956)
* bpo-38338, test.pythoninfo: add more ssl infos (GH-16539)Miss Islington (bot)2019-10-021-0/+31
| | | | | | | | test.pythoninfo now logs environment variables used by OpenSSL and Python ssl modules, and logs attributes of 3 SSL contexts (SSLContext, default HTTPS context, stdlib context). (cherry picked from commit b3e7045f8314e7b62cd95861d207fe2f97e47198) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-36670: regrtest bug fixes (GH-16537)Miss Islington (bot)2019-10-021-10/+12
| | | | | | | | | | * Fix TestWorkerProcess.__repr__(): start_time is only valid if _popen is not None. * Fix _kill(): don't set _killed to True if _popen is None. * _run_process(): only set _killed to False after calling run_test_in_subprocess(). (cherry picked from commit 2ea71a07d0a720707094ee55f78fd232c40724bc) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-36670: Multiple regrtest bugfixes (GH-16511)Miss Islington (bot)2019-10-013-133/+175
| | | | | | | | | | | | | | | | | | | * Windows: Fix counter name in WindowsLoadTracker. Counter names are localized: use the registry to get the counter name. Original change written by Lorenz Mende. * Regrtest.main() now ensures that the Windows load tracker is also killed if an exception is raised * TestWorkerProcess now ensures that worker processes are no longer running before exiting: kill also worker processes when an exception is raised. * Enhance regrtest messages and warnings: include test name, duration, add a worker identifier, etc. * Rename MultiprocessRunner to TestWorkerProcess * Use print_warning() to display warnings. Co-Authored-By: Lorenz Mende <Lorenz.mende@gmail.com> (cherry picked from commit 982bfa4da07b2e5749a0f4e68f99e972bcc3a549) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* [3.8] bpo-38270: More fixes for strict crypto policy (GH-16418) (#16437)Christian Heimes2019-09-303-11/+32
| | | | | | | | | | | | | | | | test_hmac and test_hashlib test built-in hashing implementations and OpenSSL-based hashing implementations. Add more checks to skip OpenSSL implementations when a strict crypto policy is active. Use EVP_DigestInit_ex() instead of EVP_DigestInit() to initialize the EVP context. The EVP_DigestInit() function clears alls flags and breaks usedforsecurity flag again. Signed-off-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue38270. (cherry picked from commit 90558158093c0ad893102158fd3c2dd9f864e82e) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-30773: Fix ag_running; prohibit running athrow/asend/aclose in parallel ↵Miss Islington (bot)2019-09-301-62/+16
| | | | | | | (GH-7468) (#16486) (cherry picked from commit fc4a044a3c54ce21e9ed150f7d769fb479d34c49) Co-authored-by: Yury Selivanov <yury@magic.io>
* bpo-38242: Revert "bpo-36889: Merge asyncio streams (GH-13251)" (#16482) ↵Yury Selivanov2019-09-305-979/+192
| | | | | (#16485) See https://bugs.python.org/issue38242 for more details
* bpo-38317: Fix PyConfig.warnoptions priority (GH-16478)Miss Islington (bot)2019-09-291-2/+26
| | | | | | | | | | | | Fix warnings options priority: PyConfig.warnoptions has the highest priority, as stated in the PEP 587. * Document options order in PyConfig.warnoptions documentation. * Make PyWideStringList_INIT macro private: replace "Py" prefix with "_Py". * test_embed: add test_init_warnoptions(). (cherry picked from commit fb4ae152a9930f0e00cae8b2807f534058cf341a) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-38019: correctly handle pause/resume reading of closed asyncio unix pipe ↵Miss Islington (bot)2019-09-291-0/+27
| | | | | | | (GH-16472) (cherry picked from commit 58498bc7178608b1ab031994ca09c43889ce3e76) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-38115: Deal with invalid bytecode offsets in lnotab (GH-16079) (GH-16464)Gregory P. Smith2019-09-281-1/+76
| | | | | | | | | | | | Document that lnotab can contain invalid bytecode offsets (because of terrible reasons that are difficult to fix). Make dis.findlinestarts() ignore invalid offsets in lnotab. All other uses of lnotab in CPython (various reimplementations of addr2line or line2addr in Python, C and gdb) already ignore this, because they take an address to look for, instead. Add tests for the result of dis.findlinestarts() on wacky constructs in test_peepholer.py, because it's the easiest place to add them. (cherry picked from commit c8165036f374cd2ee64d4314eeb2514f7acb5026)
* bpo-38216, bpo-36274: Allow subclasses to separately override validation and ↵Miss Islington (bot)2019-09-281-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | encoding behavior (GH-16448) * bpo-38216: Allow bypassing input validation * bpo-36274: Also allow the URL encoding to be overridden. * bpo-38216, bpo-36274: Add tests demonstrating a hook for overriding validation, test demonstrating override encoding, and a test to capture expectation of the interface for the URL. * Call with skip_host to avoid tripping on the host checking in the URL. * Remove obsolete comment. * Make _prepare_path_encoding its own attr. This makes overriding just that simpler. Also, don't use the := operator to make backporting easier. * Add a news entry. * _prepare_path_encoding -> _encode_prepared_path() * Once again separate the path validation and request encoding, drastically simplifying the behavior. Drop the guarantee that all processing happens in _prepare_path. (cherry picked from commit 7774d7831e8809795c64ce27f7df52674581d298) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* bpo-38243, xmlrpc.server: Escape the server_title (GH-16373)Miss Islington (bot)2019-09-271-0/+16
| | | | | | | Escape the server title of xmlrpc.server.DocXMLRPCServer when rendering the document page as HTML. (cherry picked from commit e8650a4f8c7fb76f570d4ca9c1fbe44e91c8dfaa) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* [3.8] bpo-38275: Skip ssl tests for disabled versions (GH-16386) (GH-16425)Christian Heimes2019-09-261-51/+145
| | | | | | | | | | test_ssl now handles disabled TLS/SSL versions better. OpenSSL's crypto policy and run-time settings are recognized and tests for disabled versions are skipped. Signed-off-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue38275 (cherry picked from commit df6ac7e2b82d921a6e9ff5571b40c6dbcf635581)
* bpo-38239: Fix test_gdb for Link Time Optimization (LTO) (GH-16422)Miss Islington (bot)2019-09-261-2/+9
| | | | | (cherry picked from commit 64b4a3a2deabcd4103fac2759a311fe94159b4d1) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* [3.8] bpo-38234: Backport init path config changes from master (GH-16423)Victor Stinner2019-09-262-50/+418
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-38234: Py_SetPath() uses the program full path (GH-16357) Py_SetPath() now sets sys.executable to the program full path (Py_GetProgramFullPath()), rather than to the program name (Py_GetProgramName()). Fix also memory leaks in pathconfig_set_from_config(). (cherry picked from commit 1ce152a42eaa917d7763bce93f1e1ca72530d7ca) * bpo-38234: Add tests for Python init path config (GH-16358) (cherry picked from commit bb6bf7d342b4503a6227fd209fac934905b6a1aa) * bpo-38234: test_embed: test pyvenv.cfg and pybuilddir.txt (GH-16366) Add test_init_pybuilddir() and test_init_pyvenv_cfg() to test_embed to test pyvenv.cfg and pybuilddir.txt configuration files. Fix sysconfig._generate_posix_vars(): pybuilddir.txt uses UTF-8 encoding, not ASCII. (cherry picked from commit 52ad33abbfb6637d74932617c7013bae0ccf6e32) * bpo-38234: Cleanup getpath.c (GH-16367) * search_for_prefix() directly calls reduce() if found is greater than 0. * Add calculate_pybuilddir() subfunction. * search_for_prefix(): add path string buffer for readability. * Fix some error handling code paths: release resources on error. * calculate_read_pyenv(): rename tmpbuffer to filename. * test.pythoninfo now also logs windows.dll_path (cherry picked from commit 221fd84703c545408bbb4a6e0b58459651331f5c) * bpo-38234: Fix test_embed pathconfig tests (GH-16390) bpo-38234: On macOS and FreeBSD, the temporary directory can be symbolic link. For example, /tmp can be a symbolic link to /var/tmp. Call realpath() to resolve all symbolic links. (cherry picked from commit 00508a7407d7d300b487532e2271534b20e378a7) * bpo-38234: Add test_init_setpath_config() to test_embed (GH-16402) * Add test_embed.test_init_setpath_config(): test Py_SetPath() with PyConfig. * test_init_setpath() and test_init_setpythonhome() no longer call Py_SetProgramName(), but use the default program name. * _PyPathConfig: isolated, site_import and base_executable fields are now only available on Windows. * If executable is set explicitly in the configuration, ignore calculated base_executable: _PyConfig_InitPathConfig() copies executable to base_executable. * Complete path config documentation. (cherry picked from commit 8bf39b606ef7b02c0279a80789f3c4824b0da5e9) * bpo-38234: Complete init config documentation (GH-16404) (cherry picked from commit 88feaecd46a8f427e30ef7ad8cfcddfe392a2402) * bpo-38234: Fix test_embed.test_init_setpath_config() on FreeBSD (GH-16406) Explicitly preinitializes with a Python preconfiguration to avoid Py_SetPath() implicit preinitialization with a compat preconfiguration. Fix also test_init_setpath() and test_init_setpythonhome() on macOS: use self.test_exe as the executable (and base_executable), rather than shutil.which('python3'). (cherry picked from commit 49d99f01e6e51acec5ca57a02e857f0796bc418b) * bpo-38234: Py_Initialize() sets global path configuration (GH-16421) * Py_InitializeFromConfig() now writes PyConfig path configuration to the global path configuration (_Py_path_config). * Add test_embed.test_get_pathconfig(). * Fix typo in _PyWideStringList_Join(). (cherry picked from commit 12f2f177fc483723406d7917194e7f655a20631b)