summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* Revert "bpo-31961: subprocess now accepts path-like args (GH-4329)" ↵Miss Islington (bot)2018-02-271-31/+0
| | | | | | | | | | (GH-5912) (GH-5931) * Revert "bpo-31961: subprocess now accepts path-like args (GH-4329)" This reverts commit dd42cb71f2cb02f3a32f016137b12a146bc0d0e2. (cherry picked from commit be50a7b627d0aa37e08fa8e2d5568891f19903ce) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-31453: Add setter for min/max protocol version (GH-5259)Miss Islington (bot)2018-02-271-0/+117
| | | | | | | | | | | | | | | OpenSSL 1.1 has introduced a new API to set the minimum and maximum supported protocol version. The API is easier to use than the old OP_NO_TLS1 option flags, too. Since OpenSSL has no call to set minimum version to highest supported, the implementation emulate maximum_version = MINIMUM_SUPPORTED and minimum_version = MAXIMUM_SUPPORTED by figuring out the minumum and maximum supported version at compile time. Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit 698dde16f60729d9e3f53c23a4ddb8e5ffe818bf) Co-authored-by: Christian Heimes <christian@python.org>
* [3.7] bpo-32951: Disable SSLSocket/SSLObject constructor (GH-5864) (#5925)Christian Heimes2018-02-271-7/+13
| | | | | | | | | | | | | | | | | | | Direct instantiation of SSLSocket and SSLObject objects is now prohibited. The constructors were never documented, tested, or designed as public constructors. The SSLSocket constructor had limitations. For example it was not possible to enabled hostname verification except was ssl_version=PROTOCOL_TLS_CLIENT with cert_reqs=CERT_REQUIRED. SSLContext.wrap_socket() and SSLContext.wrap_bio are the recommended API to construct SSLSocket and SSLObject instances. ssl.wrap_socket() is also deprecated. The only test case for direct instantiation was added a couple of days ago for IDNA testing. Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit 9d50ab563df6307cabbcc9883cb8c52c614b0f22) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-32947: OpenSSL 1.1.1-pre1 / TLS 1.3 fixes (GH-5663)Miss Islington (bot)2018-02-274-65/+108
| | | | | | | | | | | | | | | | | | | | * bpo-32947: OpenSSL 1.1.1-pre1 / TLS 1.3 fixes Misc fixes and workarounds for compatibility with OpenSSL 1.1.1-pre1 and TLS 1.3 support. With OpenSSL 1.1.1, Python negotiates TLS 1.3 by default. Some test cases only apply to TLS 1.2. Other tests currently fail because the threaded or async test servers stop after failure. I'm going to address these issues when OpenSSL 1.1.1 reaches beta. OpenSSL 1.1.1 has added a new option OP_ENABLE_MIDDLEBOX_COMPAT for TLS 1.3. The feature is enabled by default for maximum compatibility with broken middle boxes. Users should be able to disable the hack and CPython's test suite needs it to verify default options. Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit 05d9fe32a1245b9a798e49e0c1eb91f110935b69) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-32960: For dataclasses, disallow inheriting frozen from non-frozen ↵Miss Islington (bot)2018-02-271-23/+61
| | | | | | | | classes and vice-versa, (GH-5919) (GH-5920) This restriction will be relaxed at a future date. (cherry picked from commit 2fa6b9eae07e2385e2acbf2e40093a21fb3a10c4) Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
* bpo-32713: Fix tarfile.itn for large/negative float values. (GH-5434)Miss Islington (bot)2018-02-271-0/+8
| | | | | (cherry picked from commit 72d9b2be36f091793ae7ffc5ad751f040c6e6ad3) Co-authored-by: Joffrey F <f.joffrey@gmail.com>
* bpo-32222: Fix pygettext skipping docstrings for funcs with arg typehints ↵Miss Islington (bot)2018-02-261-0/+88
| | | | | | | (GH-4745) (cherry picked from commit eee72d4778a5513038edd5236cdd87ccce2bc60a) Co-authored-by: Tobotimus <Tobotimus@users.noreply.github.com>
* bpo-32394: Remove some TCP options on old version Windows. (GH-5523)Miss Islington (bot)2018-02-261-0/+22
| | | | | (cherry picked from commit 19e7d48ce89422091f9af93038b9fee075d46e9e) Co-authored-by: animalize <animalize@users.noreply.github.com>
* bpo-32922: dbm.open() now encodes filename with the filesystem encoding. ↵Miss Islington (bot)2018-02-263-1/+87
| | | | | | | (GH-5832) (cherry picked from commit 6f600ff1734ca2fdcdd37a809adf8130f0d8cc4e) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-32929: Dataclasses: Change the tri-state hash parameter to the boolean ↵Miss Islington (bot)2018-02-261-116/+124
| | | | | | | | unsafe_hash. (GH-5891) (GH-5902) unsafe_hash=False is now the default. It is the same behavior as the old hash=None parameter. unsafe_hash=True will try to add __hash__. If it already exists, TypeError is raised. (cherry picked from commit dbf9cff48a4ad0fd58e1c623ce1f36c3dd3d5f38) Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
* Fix 'deecorator' typo in test/test_dataclasses (GH-5899)Miss Islington (bot)2018-02-261-1/+1
| | | | | (cherry picked from commit 973cae07d6ce7f5a93bd9cd3bcb724a96cfe14e9) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-32622: Native sendfile on windows (GH-5565)Miss Islington (bot)2018-02-253-90/+277
| | | | | | * Support sendfile on Windows Proactor event loop naively. (cherry picked from commit a19fb3c6aaa7632410d1d9dcb395d7101d124da4) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* Exhaustively test dataclass hashing when no hash= value is provided. This is ↵Miss Islington (bot)2018-02-251-0/+73
| | | | | | | in anticipation of changing how non-default hashing is handled. (GH-5834) (GH-5889) (cherry picked from commit 718070db26b35da4aedc03088c58558a833ccf6e) Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
* [3.7] bpo-31809: test secp ECDH curves (GH-4036) (#5872)Miss Islington (bot)2018-02-251-0/+52
| | | | | | Add tests to verify connection with secp384r1 ECDH curves. (cherry picked from commit b7b9225831a729bff84eb7c43bad138416b994fe) Co-authored-by: Christian Heimes <christian@python.org>
* [3.7] bpo-24334: Cleanup SSLSocket (GH-5252) (#5857)Miss Islington (bot)2018-02-241-0/+4
| | | | | | | | | | | | | | | | * The SSLSocket is no longer implemented on top of SSLObject to avoid an extra level of indirection. * Owner and session are now handled in the internal constructor. * _ssl._SSLSocket now uses the same method names as SSLSocket and SSLObject. * Channel binding type check is now handled in C code. Channel binding is always available. The patch also changes the signature of SSLObject.__init__(). In my opinion it's fine. A SSLObject is not a user-constructable object. SSLContext.wrap_bio() is the only valid factory. (cherry picked from commit 141c5e8c2437a9fed95a04c81e400ef725592a17) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-31966: Fixed WindowsConsoleIO.write() for writing empty data. (GH-5754)Miss Islington (bot)2018-02-241-0/+4
| | | | | (cherry picked from commit 42c35d9c0c8175332f50fbe034a001fe52f057b9) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.7] bpo-32819: Simplify and improve ssl.match_hostname (GH-5620) (#5847)Miss Islington (bot)2018-02-241-16/+49
| | | | | | | | | | ssl.match_hostname() has been simplified and no longer depends on re and ipaddress module for wildcard and IP addresses. Error reporting for invalid wildcards has been improved. Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit aef1283ba428e33397d87cee3c54a5110861552d) Co-authored-by: Christian Heimes <christian@python.org>
* [bpo-28414] Make all hostnames in SSL module IDN A-labels (GH-5128) (GH-5843)Miss Islington (bot)2018-02-241-26/+14
| | | | | | | | | | | | | | | Previously, the ssl module stored international domain names (IDNs) as U-labels. This is problematic for a number of reasons -- for example, it made it impossible for users to use a different version of IDNA than the one built into Python. After this change, we always convert to A-labels as soon as possible, and use them for all internal processing. In particular, server_hostname attribute is now an A-label, and on the server side there's a new sni_callback that receives the SNI servername as an A-label rather than a U-label. (cherry picked from commit 11a1493bc4198f1def5e572049485779cf54dc57) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-30028: make test.support.temp_cwd() fork-safe (GH-1066)Miss Islington (bot)2018-02-232-1/+34
| | | | | | | 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>
* Test that new_timezone can return the UTC singleton (gh-5318) (#5819)Miss Islington (bot)2018-02-221-0/+22
| | | | | (cherry picked from commit a049f5790e38fe1b1ba1d4c10ed5ab35150806fa) Co-authored-by: Paul Ganssle <pganssle@users.noreply.github.com>
* bpo-32457: Improves handling of denormalized executable path when launching ↵Miss Islington (bot)2018-02-221-0/+11
| | | | | | | Python (GH-5756) (cherry picked from commit 48e8c82fc63d2ddcddce8aa637a892839b551619) Co-authored-by: Steve Dower <steve.dower@microsoft.com>
* bpo-32556: nt._getfinalpathname, nt._getvolumepathname and nt._getdiskusage ↵Miss Islington (bot)2018-02-221-10/+36
| | | | | | | now correctly convert from bytes. (GH-5761) (cherry picked from commit 23ad6d0d1a7a6145a01494f4f3913a63d1f0250c) Co-authored-by: Steve Dower <steve.dower@microsoft.com>
* bpo-32604: Swap threads only if the interpreter is different. (gh-5783)Miss Islington (bot)2018-02-211-0/+49
| | | | | | The CPython runtime assumes that there is a one-to-one relationship (for a given interpreter) between PyThreadState and OS threads. Sending and receiving on a channel in the same interpreter was causing crashes because of this (specifically due to a check in PyThreadState_Swap()). The solution is to not switch threads if the interpreter is the same. (cherry picked from commit f53d9f2778a87bdd48eb9030f782a4ebf9e7622f) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* bpo-31848: Fix broken error handling in Aifc_read.initfp() when the SSND ↵Miss Islington (bot)2018-02-201-0/+8
| | | | | | | | | chunk is not found (GH-5240) 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>
* bpo-32409: Ensures activate.bat can handle Unicode contents (GH-5765)Miss Islington (bot)2018-02-201-0/+18
| | | | | (cherry picked from commit 6240917b773b52f8883387b9e3a5f327a4372068) Co-authored-by: Steve Dower <steve.dower@microsoft.com>
* bpo-30121: Fix test_subprocess for Windows Debug builds (GH-5758)Miss Islington (bot)2018-02-191-1/+1
| | | | | (cherry picked from commit 5537646bfacec463b450871dde31cb06c44a0556) Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
* bpo-32682: Improve libz version parsing in test_zilb (GH-5347)Miss Islington (bot)2018-02-191-4/+9
| | | | | (cherry picked from commit 4c7108a77144493d0aa6fc0105b67d3797e143f5) Co-authored-by: pmp-p <pmp-p@users.noreply.github.com>
* bpo-31333: Re-implement ABCMeta in C (GH-5733)Ivan Levkivskyi2018-02-183-394/+424
| | | | This adds C versions of methods used by ABCMeta that improve performance of various ABC operations.
* [3.7] Improves the ability to build in CI (GH-5729)Miss Islington (bot)2018-02-182-6/+13
|
* bpo-32852: Fix trace changing sys.argv to tuple. (GH-5692)Miss Islington (bot)2018-02-171-0/+10
| | | | | (cherry picked from commit 9f4223261fd129ad7b9a09b2b0d625d1bb90b22b) Co-authored-by: Kyle Altendorf <sda@fstab.net>
* bpo-32604: Clean up created subinterpreters before runtime finalization. ↵Miss Islington (bot)2018-02-171-9/+69
| | | | | | | (gh-5710) (cherry picked from commit 4c6955e2b0ccf88c705f8d1fac685a8e65f9699e) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* bpo-32841: Fix cancellation in awaiting asyncio.Condition (GH-5665)Miss Islington (bot)2018-02-141-4/+27
| | | | | (cherry picked from commit 5746510b7aef423fa4afc92b2abb919307b1dbb9) Co-authored-by: Bar Harel <bzvi7919@gmail.com>
* bpo-31787: Skip refleak check when _hashlib is not available (GH-5660)Miss Islington (bot)2018-02-131-0/+1
| | | | | (cherry picked from commit f0bc645dfede8118c84844bad319cd952c4d1905) Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
* bpo-31787: Prevent refleaks when calling __init__() more than once (GH-3995)Miss Islington (bot)2018-02-136-0/+74
| | | | | (cherry picked from commit d019bc8319ea35e93bf4baa38098ff1b57cd3ee5) Co-authored-by: Oren Milman <orenmn@gmail.com>
* bpo-29248: Fix os.readlink() on Windows (GH-5577)Miss Islington (bot)2018-02-121-0/+15
| | | | | | | The PrintNameOffset field of the reparse data buffer was treated as a number of characters instead of bytes. (cherry picked from commit 3c34aad4e7a95913ec7db8e5e948a8fc69047bf7) Co-authored-by: SSE4 <tomskside@gmail.com>
* bpo-32221: makeipaddr(): remove interface part + speedup (GH-5449) (GH-5449) ↵Miss Islington (bot)2018-02-121-0/+66
| | | | | | | (#5641) (cherry picked from commit 7766b96ab80b04509bbac708ee5ecf3c1c5934fc) Co-authored-by: Коренберг Марк <socketpair@gmail.com>
* bpo-32792: Preserve mapping order in ChainMap() (GH-5586) (#GH-5617)Miss Islington (bot)2018-02-111-0/+17
| | | | | (cherry picked from commit 3793f95f98c3112ce447288a5bf9899eb9e35423) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
* bpo-30157: Fix csv.Sniffer.sniff() regex pattern. (GH-5601) (GH-5602)Miss Islington (bot)2018-02-091-0/+10
| | | | | Co-authored-by: Jake Davis <jcdavis@awedge.net> (cherry picked from commit 2411292ba8155327125d8a1da8a4c9fa003d5909)
* bpo-32775: Fix regular expression warnings in fnmatch. (GH-5583) (GH-5596)Miss Islington (bot)2018-02-091-0/+12
| | | | | | | | | | | | fnmatch.translate() no longer produces patterns which contain set operations. Sets starting with '[' or containing '--', '&&', '~~' or '||' will be interpreted differently in regular expressions in future versions. Currently they emit warnings. fnmatch.translate() now avoids producing patterns containing such sets by accident. (cherry picked from commit 23cdbfa744f0ec0e9e7575d378df4cb758691cd3) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-30693: Fix tarfile test cleanup on MSWindows (GH-5557) (GH-5567)Miss Islington (bot)2018-02-061-4/+4
| | | | | | it was using our mocked listdir to check when the files were gone. (cherry picked from commit 4ad703b7ca463d1183539277dde90ffb1c808487) Co-authored-by: Bernhard M. Wiedemann <githubbmw@lsmod.de>
* Use assertTrue() instead of deprecated assert_(). (GH-5526) (GH-5527)Miss Islington (bot)2018-02-041-1/+1
| | | | | (cherry picked from commit 95c3262762f7d0da97ad633f40bed7cd2df9814c) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.7] bpo-32691: Use mod_spec.parent when running modules with pdb (GH-5510)Miss Islington (bot)2018-02-041-1/+32
| | | | | | Previously the module name was used, which broke relative imports when pdb was run against a plain module or submodule. (cherry picked from commit 38bfa8418f5d39bcc7478b8f7aef4a632c26172e) Co-authored-by: Mario Corchero <mariocj89@gmail.com>
* [3.7] bpo-32746: Fix multiple typos (GH-5144) (GH-5520)Miss Islington (bot)2018-02-045-12/+12
| | | | | | Fix typos found by codespell in docs, docstrings, and comments. (cherry picked from commit c3d9508ff22ece9a96892b628dd5813e2fb0cd80) Co-authored-by: Leo Arias <leo.arias@canonical.com>
* bpo-32604: Fix memory leaks in the new _xxsubinterpreters module. (GH-5507)Miss Islington (bot)2018-02-031-8/+10
| | | | | (cherry picked from commit 4e9da0d163731caa79811c723c703ee416c31826) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* bpo-32303 - Consistency fixes for namespace loaders (GH-5481) (#5503)Barry Warsaw2018-02-032-2/+20
| | | | | | | | | | * Make sure ``__spec__.loader`` matches ``__loader__`` for namespace packages. * Make sure ``__spec__.origin` matches ``__file__`` for namespace packages. https://bugs.python.org/issue32303 https://bugs.python.org/issue32305 (cherry picked from commit bbbcf8693b876daae4469765aa62f8924f39a7d2) Co-authored-by: Barry Warsaw <barry@python.org>
* bpo-32734: Fix asyncio.Lock multiple acquire safety issue (GH-5466) (#5501)Miss Islington (bot)2018-02-021-0/+50
| | | | | (cherry picked from commit 2f79c014931cbb23b08a7d16c534a3cc9607ae14) Co-authored-by: Bar Harel <bzvi7919@gmail.com>
* Revert "bpo-31356: Add context manager to temporarily disable GC GH-5495 (#5496)Miss Islington (bot)2018-02-021-70/+1
| | | | | | | | | This reverts commit 72a0d218dcc94a3cc409a9ef32dfcd5a7bbcb43c. The reverted commit had a few issues so it was unanimously decided to undo it. See the bpo issue for details. (cherry picked from commit 383b32fe108ea627699cc9c644fba5f8bae95d73) Co-authored-by: Yury Selivanov <yury@magic.io>
* bpo-32733: Make test_coroutines robust against -Werror (GH-5487) (GH-5490)Miss Islington (bot)2018-02-021-7/+2
| | | | | (cherry picked from commit 2efb9735899c7c642f3e75a121af82b1679577d3) Co-authored-by: Nathaniel J. Smith <njs@pobox.com>
* Implement TimerHandle.when() (GH-5473) (GH-5480)Miss Islington (bot)2018-02-011-0/+6
| | | | | (cherry picked from commit 3d4dbd8f019c0bbac99fc9248077044ff1039ca3) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-32583: Fix possible crashing in builtin Unicode decoders (#5325)Xiang Zhang2018-01-311-0/+52
| | | | | When using customized decode error handlers, it is possible for builtin decoders to write out-of-bounds and then crash.