summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* bpo-37876: Tests for ROT-13 codec (GH-15314)Zeth2019-09-091-0/+37
| | | | The Rot-13 codec is for educational use but does not have unit tests, dragging down test coverage. This adds a few very simple tests.
* docs: Add references to AsyncMock in unittest.mock.patch (#13681)Mario Corchero2019-09-091-4/+5
| | | | Update the docs as patch can now return an AsyncMock if the patched object is an async function.
* Mark files as executable that are meant as scripts. (GH-15354)Greg Price2019-09-093-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | This is the converse of GH-15353 -- in addition to plenty of scripts in the tree that are marked with the executable bit (and so can be directly executed), there are a few that have a leading `#!` which could let them be executed, but it doesn't do anything because they don't have the executable bit set. Here's a command which finds such files and marks them. The first line finds files in the tree with a `#!` line *anywhere*; the next-to-last step checks that the *first* line is actually of that form. In between we filter out files that already have the bit set, and some files that are meant as fragments to be consumed by one or another kind of preprocessor. $ git grep -l '^#!' \ | grep -vxFf <( \ git ls-files --stage \ | perl -lane 'print $F[3] if (!/^100644/)' \ ) \ | grep -ve '\.in$' -e '^Doc/includes/' \ | while read f; do head -c2 "$f" | grep -qxF '#!' \ && chmod a+x "$f"; \ done
* bpo-38059: Using sys.exit() over exit() in inspect.py (GH-15666)Alan Yee2019-09-091-2/+2
| | | Constants added by the site module like exit() "should not be used in programs"
* bpo-34596: Fallback to a default reason when @unittest.skip is uncalled (#9082)Naitree Zhu2019-09-092-0/+16
| | | | | | | | * bpo-34596: Fallback to a default reason when @unittest.skip is uncalled * Change default reason to empty string * Fix rst formatting of NEWS entry
* bpo-26185: Fix repr() on empty ZipInfo object (#13441)Mickaël Schoentgen2019-09-092-5/+30
| | | | | | | | | | | | * bpo-26185: Fix repr() on empty ZipInfo object It was failing on AttributeError due to inexistant but required attributes file_size and compress_size. They are now initialized to 0 in ZipInfo.__init__(). * Remove useless hasattr() in ZipInfo._open_to_write() * Completely remove file_size setting in _open_to_write().
* bpo-37212: Preserve keyword argument order in unittest.mock.call and error ↵Xtreak2019-09-092-4/+4
| | | | messages (GH-14310)
* bpo-36250: ignore ValueError from signal in non-main thread (GH-12251)Daniel Hahler2019-09-092-2/+35
| | | | Authored-By: blueyed <github@thequod.de>
* bpo-32587: Make winreg.REG_MULTI_SZ support zero-length strings (#13239)Zackery Spytz2019-09-091-0/+1
| | | | | | * bpo-32587: Make winreg.REG_MULTI_SZ support PendingFileRenameOperations * Address review comments.
* bpo-11953: Extend table of Windows WSA* error codes (GH-15004)Ngalim Siregar2019-09-091-1/+82
|
* Fix assertions regarding magic methods function body that was not executed ↵Xtreak2019-09-091-9/+2
| | | | (GH-14154)
* bpo-34410: Fix a crash in the tee iterator when re-enter it. (GH-15625)Serhiy Storchaka2019-09-091-0/+37
| | | | RuntimeError is now raised in this case.
* bpo-36018: Address more reviewer feedback (GH-15733)Raymond Hettinger2019-09-082-25/+42
|
* bpo-36946:Fix possible signed integer overflow when handling slices. (GH-15639)HongWeipeng2019-09-081-0/+5
| | | | This is a complement to PR 13375.
* bpo-38038: Remove urllib.parse._splittype from xmlrpc.client. (GH-15703)Dong-hee Na2019-09-081-6/+5
|
* bpo-38041: Refine IDLE Shell restart lines. (GH-15709)Terry Jan Reedy2019-09-063-3/+41
| | | Restart lines now always start with '=' and never end with ' ' and fill the width of the window unless that would require ending with ' ', which could be wrapped by itself and possible confusing the user.
* bpo-37064: Skip test_tools.test_pathfix if installed (GH-15705)Victor Stinner2019-09-051-1/+5
| | | | If Python is installed, skip test_tools.test_pathfix test because Tools/scripts/pathfix.py script is not installed.
* bpo-37064: Add option -k to Tools/scripts/pathfix.py (GH-15548)PatrikKopkan2019-09-051-0/+64
| | | Add flag -k to pathscript.py script: preserve shebang flags.
* bpo-36409: Remove old plistlib API deprecated in 3.4 (GH-15615)Jon Janzen2019-09-052-248/+18
| | | | * Remove implementation for old plistlib API deprecated in 3.4
* bpo-36324: Apply review comments from Allen Downey (GH-15693)Raymond Hettinger2019-09-051-21/+17
|
* bpo-38026: fix inspect.getattr_static (GH-15676)Inada Naoki2019-09-051-2/+2
| | | | | It should avoid dynamic lookup including `isinstance`. This is a regression caused by GH-5351.
* bpo-37902: IDLE: Add scrolling for IDLE browsers. (#15368)GeeTransit2019-09-055-21/+75
| | | | Modify the wheel event handler so it can also be used for module, path, and stack browsers. Patch by George Zhang.
* bpo-22347: Update mimetypes.guess_type to allow proper parsing of URLs ↵Dong-hee Na2019-09-053-2/+11
| | | | | (GH-15522) https://bugs.python.org/issue22347
* 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
|