summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix idlelib.help comments (GH-15669)Terry Jan Reedy2019-09-051-24/+25
|
* bpo-38030: Fix os.stat failures on block devices on Windows (GH-15681)Steve Dower2019-09-041-0/+8
|
* closes bpo-37966: Fully implement the UAX #15 quick-check algorithm. (GH-15558)Greg Price2019-09-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The purpose of the `unicodedata.is_normalized` function is to answer the question `str == unicodedata.normalized(form, str)` more efficiently than writing just that, by using the "quick check" optimization described in the Unicode standard in UAX #15. However, it turns out the code doesn't implement the full algorithm from the standard, and as a result we often miss the optimization and end up having to compute the whole normalized string after all. Implement the standard's algorithm. This greatly speeds up `unicodedata.is_normalized` in many cases where our partial variant of quick-check had been returning MAYBE and the standard algorithm returns NO. At a quick test on my desktop, the existing code takes about 4.4 ms/MB (so 4.4 ns per byte) when the partial quick-check returns MAYBE and it has to do the slow normalize-and-compare: $ build.base/python -m timeit -s 'import unicodedata; s = "\uf900"*500000' \ -- 'unicodedata.is_normalized("NFD", s)' 50 loops, best of 5: 4.39 msec per loop With this patch, it gets the answer instantly (58 ns) on the same 1 MB string: $ build.dev/python -m timeit -s 'import unicodedata; s = "\uf900"*500000' \ -- 'unicodedata.is_normalized("NFD", s)' 5000000 loops, best of 5: 58.2 nsec per loop This restores a small optimization that the original version of this code had for the `unicodedata.normalize` use case. With this, that case is actually faster than in master! $ build.base/python -m timeit -s 'import unicodedata; s = "\u0338"*500000' \ -- 'unicodedata.normalize("NFD", s)' 500 loops, best of 5: 561 usec per loop $ build.dev/python -m timeit -s 'import unicodedata; s = "\u0338"*500000' \ -- 'unicodedata.normalize("NFD", s)' 500 loops, best of 5: 512 usec per loop
* bpo-38022: IDLE: upgrade help.html to sphinx 2.x HTML5 output (GH-15664)Tal Einat2019-09-032-167/+229
| | | | | The HTML5 output from Sphinx 2.x adds '<p>' tags within list elements. Using a new prevtag attribute, ignore these instead of emitting unwanted '\n\n'. Also stop looking for 'first' classes on tags (no longer present) and fix the bug of double-spacing instead of single spacing after <pre> blocks.
* bpo-35771: IDLE: Fix flaky tool-tip hover delay tests (GH-15634)Tal Einat2019-09-033-48/+66
| | | | Extending the hover delay in test_tooltip should avoid spurious test_idle failures. One longer delay instead of two shorter delays results in a net speedup.
* Enforce PEP 257 conventions in ftplib.py (GH-15604)Alan Yee2019-09-031-8/+5
| | | | | -`"""` over `'''` -no blank line either before or after the docstring. -place the closing quotes on a line by themselves
* bpo-38010 Sync importlib.metadata with importlib_metadata 0.20. (GH-15646)Jason R. Coombs2019-09-022-3/+17
| | | Sync importlib.metadata with importlib_metadata 0.20.
* bpo-15999: Clean up of handling boolean arguments. (GH-15610)Serhiy Storchaka2019-09-0112-38/+38
| | | | | | * Use the 'p' format unit instead of manually called PyObject_IsTrue(). * Pass boolean value instead 0/1 integers to functions that needs boolean. * Convert some arguments to boolean only once.
* bpo-15999: Always pass bool instead of int to socket.setblocking(). (GH-15621)Serhiy Storchaka2019-09-015-16/+16
|
* bpo-15999: Always pass bool instead of int to the expat parser. (GH-15622)Serhiy Storchaka2019-09-015-36/+36
|
* bpo-36543: Remove old-deprecated ElementTree features. (GH-12707)Serhiy Storchaka2019-09-012-81/+10
| | | | | Remove methods Element.getchildren(), Element.getiterator() and ElementTree.getiterator() and the xml.etree.cElementTree module.
* bpo-37764: Fix infinite loop when parsing unstructured email headers. (GH-15239)Ashwin Ramaswami2019-08-313-3/+53
| | | | | | | | | | | | Fixes a case in which email._header_value_parser.get_unstructured hangs the system for some invalid headers. This covers the cases in which the header contains either: - a case without trailing whitespace - an invalid encoded word https://bugs.python.org/issue37764 This fix should also be backported to 3.7 and 3.8 https://bugs.python.org/issue37764
* Fix typos mostly in comments, docs and test names (GH-15209)Min ho Kim2019-08-3021-29/+29
|
* IDLE: Fix 2 typos found by Min ho Kim. (GH-15617)Terry Jan Reedy2019-08-302-2/+2
|
* bpo-37140: Fix StructUnionType_paramfunc() (GH-15612)Victor Stinner2019-08-301-6/+45
| | | | | | | | | | | | Fix a ctypes regression of Python 3.8. When a ctypes.Structure is passed by copy to a function, ctypes internals created a temporary object which had the side effect of calling the structure finalizer (__del__) twice. The Python semantics requires a finalizer to be called exactly once. Fix ctypes internals to no longer call the finalizer twice. Create a new internal StructParam_Type which is only used by _ctypes_callproc() to call PyMem_Free(ptr) on Py_DECREF(argument). StructUnionType_paramfunc() creates such object.
* bpo-37976: Prevent shadowing of TypeError in zip() (GH-15592)Sergey Fedoseev2019-08-302-0/+24
|
* Steven Bethard designated a new maintainer for argparse (GH-15605)Raymond Hettinger2019-08-301-0/+1
|
* bpo-37834: Prevent shutil.rmtree exception (GH-15602)Ned Deily2019-08-291-1/+1
| | | | when built on non-Windows system without fd system call support, like older versions of macOS.
* bpo-37933: Fix faulthandler.cancel_dump_traceback_later() (GH-15440)Thomas A Caswell2019-08-291-0/+11
| | | | Fix faulthandler.cancel_dump_traceback_later() call if cancel_dump_traceback_later() was not called previously.
* bpo-37034: Display argument name on errors with keyword arguments with ↵Rémi Lapeyre2019-08-292-42/+95
| | | | Argument Clinic. (GH-13593)
* bpo-36833: Add tests for Datetime C API Macros (GH-14842)Joannah Nanjekye2019-08-291-0/+59
| | | | Added tests for PyDateTime_xxx_GET_xxx() macros of the C API of the datetime module.
* bpo-10978: Semaphores can release multiple threads at a time (GH-15588)Raymond Hettinger2019-08-292-9/+47
|
* bpo-36743: __get__ is sometimes called without the owner argument (#12992)Raymond Hettinger2019-08-293-5/+5
|
* bpo-37372: Fix error unpickling datetime.time objects from Python 2 with ↵Justin Blanchard2019-08-291-9/+18
| | | | seconds>=24. (GH-14307)
* bpo-37950: Fix ast.dump() when call with incompletely initialized node. ↵Serhiy Storchaka2019-08-292-15/+53
| | | | (GH-15510)
* bpo-37960: Silence only necessary errors in repr() of buffered and text ↵Serhiy Storchaka2019-08-291-4/+4
| | | | streams. (GH-15543)
* bpo-35946: Improve assert_called_with documentation (GH-11796)Rémi Lapeyre2019-08-291-1/+1
|
* bpo-36871: Ensure method signature is used when asserting mock calls to a ↵Xtreak2019-08-292-1/+83
| | | | | | | | | | | | | | | | method (GH13261) * 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
* bpo-37964: Make sure test works if TESTFN is in a non-ASCII directory. ↵Benjamin Peterson2019-08-291-3/+3
| | | | (GH-15568)
* bpo-18378: Recognize "UTF-8" as a valid name in locale._parse_localename ↵Ronald Oussoren2019-08-292-0/+40
| | | | (GH-14736)
* closes bpo-37964: add F_GETPATH command to fcntl (GH-15550)Vinay Sharma2019-08-291-0/+6
| | | | | | | https://bugs.python.org/issue37964 Automerge-Triggered-By: @benjaminp
* closes bpo-37965: Fix compiler warning of distutils CCompiler.test_function. ↵Anonymous Maarten2019-08-281-1/+2
| | | | | | | | | | | | (GH-15560) https://bugs.python.org/issue37965 https://bugs.python.org/issue37965 Automerge-Triggered-By: @benjaminp
* bpo-36582: Make collections.UserString.encode() return bytes, not str (GH-13138)Daniel Fortunov2019-08-282-6/+18
|
* bpo-37328: remove deprecated HTMLParser.unescape (GH-14186)Inada Naoki2019-08-272-15/+0
| | | It is deprecated since Python 3.4.
* Fix an invalid assertEqual() call in test_descr.py (GH-15318)Zackery Spytz2019-08-261-5/+1
|
* bpo-37664: Update ensurepip bundled wheels, again (GH-15483)Pradyun Gedam2019-08-263-2/+2
| | | | | | | | | | | | /cc @ambv since this needs to be included in 3.8 -- see https://github.com/pypa/pip/issues/6885. Sorry about the last minute PR! https://bugs.python.org/issue37664 Automerge-Triggered-By: @zooba
* bpo-34679: Restore instantiation Windows IOCP event loop from non-main ↵Andrew Svetlov2019-08-262-1/+23
| | | | | | | | thread (#15492) * Restore running proactor event loop from non-main thread Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
* bpo-27575: port set intersection logic into dictview intersection (GH-7696)Forest Gregg2019-08-261-0/+14
|
* bpo-36917: Add default implementation of ast.NodeVisitor.visit_Constant(). ↵Serhiy Storchaka2019-08-262-0/+82
| | | | | | | (GH-15490) It emits a deprecation warning and calls corresponding method visit_Num(), visit_Str(), etc.
* bpo-37805: Add tests for json.dump(..., skipkeys=True) (GH-15489)Dong-hee Na2019-08-261-0/+10
| | | | | | | https://bugs.python.org/issue37805 Automerge-Triggered-By: @methane
* bpo-37824: Properly handle user input warnings in IDLE shell. (GH-15500)Terry Jan Reedy2019-08-262-14/+9
| | | Cease turning SyntaxWarnings into SyntaxErrors.
* bpo-29553: Fix ArgumentParser.format_usage() for mutually exclusive groups ↵Flavian Hautbois2019-08-252-2/+48
| | | | | (GH-14976) Co-authored-by: Andrew Nester <andrew.nester.dev@gmail.com>
* bpo-37757: Disallow PEP 572 cases that expose implementation details (GH-15131)Nick Coghlan2019-08-253-38/+84
| | | | | | | | | | | | | | | - 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)
* bpo-34880: Add the LOAD_ASSERTION_ERROR opcode. (GH-15073)Zackery Spytz2019-08-254-3/+20
| | | | Fix assert statement misbehavior if AssertionError is shadowed.
* bpo-37929: IDLE: avoid Squeezer-related config dialog crashes (GH-15452)Tal Einat2019-08-253-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.
* bpo-37942: Improve argument clinic float converter (GH-15470)Raymond Hettinger2019-08-251-8/+20
|
* bpo-19072: Make @classmethod support chained decorators (GH-8405)Berker Peksag2019-08-242-0/+60
|
* bpo-37798: Test both Python and C versions in test_statistics.py (GH-15453)Dong-hee Na2019-08-241-33/+73
|
* bpo-37772: fix zipfile.Path.iterdir() outputs (GH-15170)shireenrao2019-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.
* bpo-37830: Fix compilation of break and continue in finally. (GH-15320)Serhiy Storchaka2019-08-244-6/+61
| | | | | | Fix compilation of "break" and "continue" in the "finally" block when the corresponding "try" block contains "return" with a non-constant value.