summaryrefslogtreecommitdiff
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* Python 3.8.0b4v3.8.0b4Łukasz Langa2019-08-291-88/+109
|
* [3.8] bpo-37834: Prevent shutil.rmtree exception (GH-15602) (#15603)Łukasz Langa2019-08-291-1/+1
| | | | | | | when built on non-Windows system without fd system call support, like older versions of macOS. (cherry picked from commit 7fcc2088a50a4ecb80e5644cd195bee209c9f979) Co-authored-by: Ned Deily <nad@python.org>
* [3.8] bpo-37034: Display argument name on errors with keyword arguments with ↵Serhiy Storchaka2019-08-292-42/+95
| | | | | | | Argument Clinic. (GH-13593). (GH-15599) (cherry picked from commit 4901fe274bc82b95dc89bcb3de8802a3dfedab32) Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
* bpo-36743: __get__ is sometimes called without the owner argument (GH-12992) ↵Miss Islington (bot)2019-08-293-5/+5
| | | | | | | (GH-15589) (cherry picked from commit 0dac68f1e593c11612ed54af9edb865d398f3b05) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
* bpo-37960: Silence only necessary errors in repr() of buffered and text ↵Miss Islington (bot)2019-08-291-4/+4
| | | | | | | streams. (GH-15543) (cherry picked from commit b235a1b47394eedc5f8ea4cf214f56c4c6932e59) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-37372: Fix error unpickling datetime.time objects from Python 2 with ↵Miss Islington (bot)2019-08-291-9/+18
| | | | | | | seconds>=24. (GH-14307) (cherry picked from commit 122376df550b71dd3bec0513c7483cc1714212fa) Co-authored-by: Justin Blanchard <UncombedCoconut@gmail.com>
* [3.8] bpo-37950: Fix ast.dump() when call with incompletely initialized ↵Serhiy Storchaka2019-08-292-15/+53
| | | | | | node. (GH-15510) (GH-15582) (cherry picked from commit e64f948e762a6b9fd02e2902ccf42438df6fcb61)
* bpo-36871: Ensure method signature is used when asserting mock calls to a ↵Miss Islington (bot)2019-08-292-1/+83
| | | | | | | | | | | | | | | | | | method (GH15578) * Fix call_matcher for mock when using methods * Add NEWS entry * Use None check and convert doctest to unittest * Use better name for mock in tests. Handle _SpecState when the attribute was not accessed and add tests. * Use reset_mock instead of reinitialization. Change inner class constructor signature for check * Reword comment regarding call object lookup logic (cherry picked from commit c96127821ebda50760e788b1213975a0d5bea37f) Co-authored-by: Xtreak <tir.karthi@gmail.com>
* bpo-35946: Improve assert_called_with documentation (GH-11796)Miss Islington (bot)2019-08-281-1/+1
| | | | | (cherry picked from commit f5896a05edf5df91fb1b55bd481ba5b2a3682f4e) Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
* bpo-34775: Return NotImplemented in PurePath division. (GH-9509) (GH-15172)Miss Islington (bot)2019-08-292-2/+49
| | | | | (cherry picked from commit 4c69be22df3852f17873a74d015528d9a8ae92d6) Co-authored-by: aiudirog <aiudirog@gmail.com>
* bpo-18378: Recognize "UTF-8" as a valid name in locale._parse_localename ↵Miss Islington (bot)2019-08-282-0/+40
| | | | | | | (GH-14736) (cherry picked from commit b0caf329815120acf50287e29858093d328b0e3c) Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
* [3.8] bpo-37482: Fix email address name with encoded words and special chars ↵bsiem2019-08-292-0/+27
| | | | | | | | | | | | | | | | | | | | | | (GH-14561) (GH-15380) Special characters in email address header display names are normally put within double quotes. However, encoded words (=?charset?x?...?=) are not allowed withing double quotes. When the header contains a word with special characters and another word that must be encoded, the first one must also be encoded. In the next example, the display name in the From header is quoted and therefore the comma is allowed; in the To header, the comma is not within quotes and not encoded, which is not allowed and therefore rejected by some mail servers. From: "Foo Bar, France" <foo@example.com> To: Foo Bar, =?utf-8?q?Espa=C3=B1a?= <foo@example.com> https://bugs.python.org/issue37482 (cherry picked from commit df0c21ff46c5c37b6913828ef8c7651f523432f8) Co-authored-by: bsiem <52461103+bsiem@users.noreply.github.com>
* closes bpo-37965: Fix compiler warning of distutils CCompiler.test_function. ↵Miss Islington (bot)2019-08-281-1/+2
| | | | | | | | | | | | (GH-15561) https://bugs.python.org/issue37965 https://bugs.python.org/issue37965 Automerge-Triggered-By: @benjaminp (cherry picked from commit 55aabee07501e1468082b3237620e4ecd75c5da6) Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
* bpo-36582: Make collections.UserString.encode() return bytes, not str ↵Miss Islington (bot)2019-08-272-6/+18
| | | | | | | (GH-13138) (GH-15557) (cherry picked from commit 2a16eea71f56c2d8f38c295c8ce71a9a9a140aff) Co-authored-by: Daniel Fortunov <asqui@users.noreply.github.com>
* Fix an invalid assertEqual() call in test_descr.py (GH-15318)Miss Islington (bot)2019-08-261-5/+1
| | | | | (cherry picked from commit 6b2e3256b6752055498f41f343fb22100845bc9d) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-37664: Update ensurepip bundled wheels, again (GH-15483)Steve Dower2019-08-263-2/+2
|
* bpo-34679: Restore instantiation Windows IOCP event loop from non-main ↵Miss Islington (bot)2019-08-262-1/+23
| | | | | | | | | | thread (GH-15492) * Restore running proactor event loop from non-main thread Co-Authored-By: Kyle Stanley <aeros167@gmail.com> (cherry picked from commit 1c0600998681295735a18690fae184b0c9a4ca51) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* [3.8] bpo-36917: Add default implementation of ↵Miss Islington (bot)2019-08-262-0/+82
| | | | | | | | ast.NodeVisitor.visit_Constant(). (GH-15490) (GH-15509) It emits a deprecation warning and calls corresponding method visit_Num(), visit_Str(), etc. (cherry picked from commit c3ea41e9bf100a5396b851488c3efe208e5e2179)
* bpo-37805: Add tests for json.dump(..., skipkeys=True) (GH-15489)Miss Islington (bot)2019-08-261-0/+10
| | | | | | | | https://bugs.python.org/issue37805 Automerge-Triggered-By: @methane (cherry picked from commit 44cd86bbdddb1f7b05deba2c1986a1e98f992429) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* bpo-37824: Properly handle user input warnings in IDLE shell. (GH-15500)Miss Islington (bot)2019-08-262-14/+9
| | | | | | Cease turning SyntaxWarnings into SyntaxErrors. (cherry picked from commit 1039f39c9c6edb4c185856c19316d3a4eb561c38) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* [3.8] bpo-37757: Disallow PEP 572 cases that expose implementation details ↵Nick Coghlan2019-08-263-38/+84
| | | | | | | | | | | | | | | | | | | (GH-15491) - drop TargetScopeError in favour of raising SyntaxError directly as per the updated PEP 572 - comprehension iteration variables are explicitly local, but named expression targets in comprehensions are nonlocal or global. Raise SyntaxError as specified in PEP 572 - named expression targets in the outermost iterable of a comprehension have an ambiguous target scope. Avoid resolving that question now by raising SyntaxError. PEP 572 originally required this only for cases where the bound name conflicts with the iteration variable in the comprehension, but CPython can't easily restrict the exception to that case (as it doesn't know the target variable names when visiting the outermost iterator expression) (cherry picked from commit 5dbe0f59b7a4f39c7c606b48056bc29e406ebf78)
* bpo-37929: IDLE: avoid Squeezer-related config dialog crashes (GH-15452)Miss Islington (bot)2019-08-243-50/+26
| | | | | | | | | | | | These were caused by keeping around a reference to the Squeezer instance and calling it's load_font() upon config changes, which sometimes happened even if the shell window no longer existed. This change completely removes that mechanism, instead having the editor window properly update its width attribute, which can then be used by Squeezer. (cherry picked from commit d4b4c00b57d24f6ee2cf3a96213406bb09953df3) Co-authored-by: Tal Einat <taleinat+github@gmail.com>
* [3.8] bpo-37942: Improve argument clinic float converter (GH-15470) (GH-15480)Raymond Hettinger2019-08-241-8/+20
| | | (cherry picked from commit aef9ad82f7f667cd001a7112d3bc636e918626f7)
* bpo-37798: Test both Python and C versions in test_statistics.py (GH-15453) ↵Miss Islington (bot)2019-08-241-33/+73
| | | | | | | (GH-15467) (cherry picked from commit 8ad22a42267d4ecb1c080d420933680cc126363e) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* bpo-37772: fix zipfile.Path.iterdir() outputs (GH-15170) (#15461)Miss Islington (bot)2019-08-242-52/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix Path._add_implied_dirs to include all implied directories * fix Path._add_implied_dirs to include all implied directories * Optimize code by using sets instead of lists * 📜🤖 Added by blurb_it. * fix Path._add_implied_dirs to include all implied directories * Optimize code by using sets instead of lists * 📜🤖 Added by blurb_it. * Add tests to zipfile.Path.iterdir() fix * Update test for zipfile.Path.iterdir() * remove whitespace from test file * Rewrite NEWS blurb to describe the user-facing impact and avoid implementation details. * remove redundant [] within set comprehension * Update to use unique_everseen to maintain order and other suggestions in review * remove whitespace and add back add_dirs in tests * Add new standalone function parents using posixpath to get parents of a directory * removing whitespace (sorry) * Remove import pathlib from zipfile.py * Rewrite _parents as a slice on a generator of the ancestry of a path. * Remove check for '.' and '/', now that parents no longer returns those. * Separate calculation of implied dirs from adding those * Re-use _implied_dirs in tests for generating zipfile with dir entries. * Replace three fixtures (abcde, abcdef, abde) with one representative example alpharep. * Simplify implementation of _implied_dirs by collapsing the generation of parent directories for each name. (cherry picked from commit a4e2991bdc993b60b6457c8a38d6e4a1fc845781) Co-authored-by: shireenrao <shireenrao@gmail.com>
* [3.8] bpo-37830: Fix compilation of break and continue in finally. ↵Serhiy Storchaka2019-08-244-6/+61
| | | | | | | | | (GH-15320) (GH-15456) Fix compilation of "break" and "continue" in the "finally" block when the corresponding "try" block contains "return" with a non-constant value. (cherry picked from commit ef61c524ddeeb56da3858b86e349e7288d68178e)
* bpo-19119: Remove invalid test and rename a misnamed test (GH-15442) (GH-15447)Miss Islington (bot)2019-08-231-14/+1
| | | | | (cherry picked from commit 4101181fd87c2fab6456663d3c8cc99377cf0463) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
* bpo-37798: Add C fastpath for statistics.NormalDist.inv_cdf() (GH-15266) ↵Miss Islington (bot)2019-08-231-73/+82
| | | | | | | (GH-15441) (cherry picked from commit 0a18ee4be7ba215f414bef04598e0849504f9f1e) Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* bpo-36763: PyConfig_Read() handles PySys_AddXOption() (GH-15431) (GH-15435)Victor Stinner2019-08-231-0/+17
| | | | | | | | | | | | PyConfig_Read() is now responsible to handle early calls to PySys_AddXOption() and PySys_AddWarnOption(). Options added by PySys_AddXOption() are now handled the same way than PyConfig.xoptions and command line -X options. For example, PySys_AddXOption(L"faulthandler") enables faulthandler as expected. (cherry picked from commit 120b707a6d43452e067daa55a8fdca69f9424abc)
* bpo-37549: os.dup() fails for standard streams on Windows 7 (GH-15389)Miss Islington (bot)2019-08-231-0/+5
| | | | | (cherry picked from commit 5be666010e4df65dc4d831435cc92340ea369f94) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-26589: Add http status code 451 (GH-15413) (GH-15436)Miss Islington (bot)2019-08-232-0/+6
| | | | | (cherry picked from commit 8f080b09953a2d862de5c74edf414a54ea3dbea5) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
* bpo-36763: Implement PyWideStringList_Insert() of PEP 587 (GH-15423)Miss Islington (bot)2019-08-231-6/+10
| | | | | (cherry picked from commit 3842f2997fbd4dc840986aad2bb94656815e243b) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-37915: Fix comparison between tzinfo objects and timezone objects (GH-15390)Miss Islington (bot)2019-08-231-0/+5
| | | | | | | | https://bugs.python.org/issue37915 Automerge-Triggered-By: @pablogsal (cherry picked from commit 4be11c009abe88175fa164b45e4838e7267dfa97) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-28556: Add a regression test to typing (GH-15396)Miss Islington (bot)2019-08-221-0/+17
| | | | | | | | This adds a regression test for the issue found in the Python 2 backport, see https://github.com/python/typing/issues/656 https://bugs.python.org/issue28556 (cherry picked from commit 8889627b53e1eea2e32590f1867fbb0b0fc7407f) Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
* Add missing space to warning message (GH-14915) (GH-15379)Miss Islington (bot)2019-08-211-1/+1
| | | | | | This typo was introduced in GH-13409 when changing the message text. (cherry picked from commit c4106af38bbcb180725fe0d9478e6a11f7a5e7b9) Co-authored-by: Florian Bruhin <me@the-compiler.org>
* bpo-37834: Fix test on Windows 7 (GH-15377)Miss Islington (bot)2019-08-211-0/+3
| | | | | (cherry picked from commit 374be59b8e479afa8c7a8ae6e77e98915e2f6d45) Co-authored-by: Steve Dower <steve.dower@python.org>
* bpo-9949: Call normpath() in realpath() and avoid unnecessary prefixes ↵Steve Dower2019-08-212-5/+10
| | | | (GH-15376)
* bpo-36311: Fixes decoding multibyte characters around chunk boundaries and ↵Miss Islington (bot)2019-08-211-3/+17
| | | | | | | improves decoding performance (GH-15083) (cherry picked from commit 7ebdda0dbee7df6f0c945a7e1e623e47676e112d) Co-authored-by: Steve Dower <steve.dower@python.org>
* bpo-37834: Normalise handling of reparse points on Windows (GH-15370)Steve Dower2019-08-215-31/+159
| | | | | | | | | | bpo-37834: Normalise handling of reparse points on Windows * ntpath.realpath() and nt.stat() will traverse all supported reparse points (previously was mixed) * nt.lstat() will let the OS traverse reparse points that are not name surrogates (previously would not traverse any reparse point) * nt.[l]stat() will only set S_IFLNK for symlinks (previous behaviour) * nt.readlink() will read destinations for symlinks and junction points only bpo-1311: os.path.exists('nul') now returns True on Windows * nt.stat('nul').st_mode is now S_IFCHR (previously was an error)
* bpo-9949: Enable symlink traversal for ntpath.realpath (GH-15287)Miss Islington (bot)2019-08-215-31/+291
| | | | | (cherry picked from commit 75e064962ee0e31ec19a8081e9d9cc957baf6415) Co-authored-by: Steve Dower <steve.dower@python.org>
* Fix difflib `?` hint in diff output when dealing with tabs (GH-15201)Miss Islington (bot)2019-08-212-23/+18
| | | | | (cherry picked from commit e1c638da6a065af6803028ced1afcc679e63f59d) Co-authored-by: Anthony Sottile <asottile@umich.edu>
* bpo-35518: Skip test that relies on a deceased network service. (GH-15349)Miss Islington (bot)2019-08-201-0/+1
| | | | | | | | | | | | | | | | If this service had thoroughly vanished, we could just ignore the test until someone gets around to either recreating such a service or redesigning the test to somehow work locally. The `support.transient_internet` mechanism catches the failure to resolve the domain name, and skips the test. But in fact the domain snakebite.net does still exist, as do its nameservers -- and they can be quite slow to reply. As a result this test can easily take 20-30s before it gets auto-skipped. So, skip the test explicitly up front. (cherry picked from commit 5b95a1507e349da5adae6d2ab57deac3bdd12f15) Co-authored-by: Greg Price <gnprice@gmail.com>
* bpo-37868: Improve is_dataclass for instances. (GH-15325)Miss Islington (bot)2019-08-192-2/+29
| | | | | (cherry picked from commit b0f4dab8735f692bcfedcf0fa9a25e238a554bab) Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
* bpo-36502: Correct documentation of str.isspace() (GH-15019) (GH-15296)Greg Price2019-08-191-1/+12
| | | | | | | | | | | | | | | | | | The documented definition was much broader than the real one: there are tons of characters with general category "Other", and we don't (and shouldn't) treat most of them as whitespace. Rewrite the definition to agree with the comment on _PyUnicode_IsWhitespace, and with the logic in makeunicodedata.py, which is what generates that function and so ultimately governs. Add suitable breadcrumbs so that a reader who wants to pin down exactly what this definition means (what's a "bidirectional class" of "B"?) can do so. The `unicodedata` module documentation is an appropriate central place for our references to Unicode's own copious documentation, so point there. Also add to the isspace() test a thorough check that the implementation agrees with the intended definition.
* bpo-37642: Update acceptable offsets in timezone (GH-14878) (#15227)Paul Ganssle2019-08-152-3/+31
| | | | | | | | | | | This fixes an inconsistency between the Python and C implementations of the datetime module. The pure python version of the code was not accepting offsets greater than 23:59 but less than 24:00. This is an accidental legacy of the original implementation, which was put in place before tzinfo allowed sub-minute time zone offsets. GH-14878 (cherry picked from commit 92c7e30adf5c81a54d6e5e555a6bdfaa60157a0d)
* bpo-37849: IDLE: fix completion window positioning above line (GH-15267)Miss Islington (bot)2019-08-142-2/+18
| | | | | (cherry picked from commit 71662dc2f12a7e77e5e1dfe64ec87c1b459c3f59) Co-authored-by: Tal Einat <taleinat+github@gmail.com>
* [3.8] bpo-37531: Fix regrtest timeout for subprocesses (GH-15072) (GH-15279)Victor Stinner2019-08-146-18/+78
| | | | | | | | | | | | * bpo-37531: Fix regrtest timeout for subprocesses (GH-15072) Co-Authored-By: Joannah Nanjekye <joannah.nanjekye@ibm.com> (cherry picked from commit b0c8369c603633f445ccbb5ca7a8742145ff9eec) * bpo-36511: Fix failures in Windows ARM32 buildbot (GH-15181) (cherry picked from commit ed70a344b5fbddea85726ebc1964ee0cfdef9c40) Backport also minor fixes from master (fix typo, remove importlib import).
* bpo-25172: Add test for crypt ImportError on Windows (GH-15252)Miss Islington (bot)2019-08-131-7/+28
| | | | | (cherry picked from commit 243a73deee4ac61fe06602b7ed56b6df01e19f27) Co-authored-by: shireenrao <shireenrao@gmail.com>
* bpo-25172: Raise appropriate ImportError msg when crypt module used on ↵Miss Islington (bot)2019-08-131-1/+10
| | | | | | | Windows (GH-15149) (cherry picked from commit f4e725f224b864bf9bf405ff7f863cda46fca1cd) Co-authored-by: shireenrao <shireenrao@gmail.com>
* bpo-37583: Add err 113 to support.get_socket_conn_refused_errs() (GH-14729)Miss Islington (bot)2019-08-131-0/+3
| | | | | | | Add error number 113 EHOSTUNREACH to get_socket_conn_refused_errs() of test.support. (cherry picked from commit 1ac2a83f30312976502fda042db5ce18d10ceec2) Co-authored-by: Hai Shi <shihai1992@gmail.com>