summaryrefslogtreecommitdiffstats
path: root/Misc/NEWS.d/next/Library
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-38716: stop rotating handlers from setting inherited namer and rotator ↵l0rb2019-11-061-0/+1
| | | | to None (GH-17072)
* closes bpo-38713: Expose P_PIDFD in os if it's defined. (GH-17071)Benjamin Peterson2019-11-061-0/+2
| | | https://bugs.python.org/issue38713
* bpo-38692: Add os.pidfd_open. (GH-17063)Benjamin Peterson2019-11-061-0/+1
|
* bpo-38422: Clarify docstrings of pathlib suffix(es) (GH-16679)Ram Rachum2019-11-021-0/+1
| | | | | | | | | | Whenever I use `path.suffix` I have to check again whether it includes the dot or not. I decided to add it to the docstring so I won't have to keep checking. https://bugs.python.org/issue38422 Automerge-Triggered-By: @pitrou
* bpo-38312: Add curses.{get,set}_escdelay and curses.{get,set}_tabsize. ↵Anthony Sottile2019-10-311-0/+3
| | | | (GH-16938)
* bpo-38586: setting logging.Handler .name property in fileConfig (GH-16918)Lucas Cimon2019-10-311-0/+1
|
* bpo-36993: Improve error reporting for zipfiles with bad zip64 extra data. ↵Daniel Hillier2019-10-291-0/+2
| | | | (GH-14656)
* bpo-38602: Add fcntl.F_OFD_XXXX for fcntlmodule (GH-16956)Dong-hee Na2019-10-281-0/+3
|
* bpo-38334: Fix seeking backward on an encrypted zipfile.ZipExtFile. (GH-16937)Serhiy Storchaka2019-10-271-0/+1
| | | Test by Daniel Hillier.
* bpo-33348: parse expressions after * and ** in lib2to3 (GH-6586)Zsolt Dollenstein2019-10-241-0/+2
| | | | | | | | | | These are valid even in python 2.7 https://bugs.python.org/issue33348 Automerge-Triggered-By: @gpshead
* bpo-30618: add readlink to pathlib.Path (GH-8285)Girts2019-10-231-0/+1
| | | | | | | | | | | This adds a "readlink" method to pathlib.Path objects that calls through to os.readlink. https://bugs.python.org/issue30618 Automerge-Triggered-By: @gpshead
* bpo-34679: ProactorEventLoop only uses set_wakeup_fd() in main thread (GH-16901)Victor Stinner2019-10-231-0/+2
| | | | bpo-34679, bpo-38563: asyncio.ProactorEventLoop.close() now only calls signal.set_wakeup_fd() in the main thread.
* bpo-31202: Preserve case of literal parts in Path.glob() on Windows. (GH-16860)Serhiy Storchaka2019-10-211-0/+2
|
* bpo-38493: Add os.CLD_KILLED and os.CLD_STOPPED. (GH-16821)Dong-hee Na2019-10-211-0/+2
|
* bpo-36321: Fix misspelled attribute name in namedtuple() (GH-16858)Raymond Hettinger2019-10-201-0/+2
|
* bpo-38521: Fix error in NormalDist.__eq__() (GH-16840)Raymond Hettinger2019-10-181-0/+1
|
* bpo-27657: Fix urlparse() with numeric paths (#661)Tim Graham2019-10-181-0/+2
| | | | | | | | | | * 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.
* bpo-33604: Raise TypeError on missing hmac arg. (GH-16805)Gregory P. Smith2019-10-181-0/+3
| | | | | | | | | | 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.
* bpo-37587: json: Use _PyUnicodeWriter when scanning string. (GH-15591)Inada Naoki2019-10-171-0/+2
|
* bpo-37961, tracemalloc: add Traceback.total_nframe (GH-15545)Julien Danjou2019-10-151-0/+2
| | | | Add a total_nframe field to the traces collected by the tracemalloc module. This field indicates the original number of frames before it was truncated.
* bpo-38478: Correctly handle keyword argument with same name as ↵Pablo Galindo2019-10-151-0/+3
| | | | positional-only parameter (GH-16800)
* bpo-32498: urllib.parse.unquote also accepts bytes (GH-7768)Stein Karlsen2019-10-141-0/+2
|
* bpo-38431: Fix __repr__ method of InitVar to work with typing objects. ↵Samuel Colvin2019-10-131-0/+1
| | | | | | (GH-16702)
* bpo-38378: Rename parameters "out" and "in" of os.sendfile(). (GH-16742)Serhiy Storchaka2019-10-131-0/+2
| | | | | | | They conflicted with keyword "in". Also rename positional-only parameters of private os._fcopyfile() for consistency.
* bpo-38417: Add umask support to subprocess (GH-16726)Gregory P. Smith2019-10-121-0/+2
| | | | On POSIX systems, allow the umask to be set in the child process before we exec.
* bpo-35800: Deprecate smtpd.MailmanProxy (GH-11675)Samuel Colvin2019-10-121-0/+1
| | | | | | Since `smtpd.MailmanProxy` is already broken, it is not formally deprecated in 3.9. It will be removed in 3.10. https://bugs.python.org/issue35800
* bpo-38449: Revert "bpo-22347: Update mimetypes.guess_type to allow oper ↵Abhilash Raj2019-10-122-2/+2
| | | | | | | | | parsing of URLs (GH-15522)" (GH-16724) This reverts commit 87bd2071c756188b6cd577889fb1682831142ceb. https://bugs.python.org/issue38449
* bpo-38109: Add missing constants to Lib/stat.py (GH-16665)Ronan Lamy2019-10-101-0/+3
| | | | | 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.
* closes bpo-36161: Use thread-safe ttyname_r instead of ttyname. (GH-14868)Antonio Gutierrez2019-10-091-0/+1
| | | Signed-off-by: Antonio Gutierrez <chibby0ne@gmail.com>
* bpo-38405: Make nested subclasses of typing.NamedTuple pickleable. (GH-16641)Serhiy Storchaka2019-10-081-0/+1
|
* bpo-38371: Tkinter: deprecate the split() method. (GH-16584)Serhiy Storchaka2019-10-081-0/+3
|
* bpo-25988: Do not expose abstract collection classes in the collections ↵Serhiy Storchaka2019-10-071-0/+2
| | | | module. (GH-10596)
* bpo-38332: Catch KeyError from unknown cte in encoded-word. (GH-16503)Andrei Troie2019-10-051-0/+3
| | | KeyError should cause a failure in parsing the encoded word and should be caught and raised as a _InvalidEWError instead.
* bpo-38341: Add SMTPNotSupportedError in the exports of smtplib (#16525)nde2019-10-051-0/+1
| | | | | | Add SMTPNotSupportedError in the exports of smtplib Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
* bpo-13153: Use OS native encoding for converting between Python and Tcl. ↵Serhiy Storchaka2019-10-041-0/+4
| | | | | | | | | | | | | (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).
* bpo-38319: Fix shutil._fastcopy_sendfile(): set sendfile() max block size ↵Giampaolo Rodola2019-10-011-0/+2
| | | | (GH-16491)
* bpo-32689: Updates shutil.move to allow for Path objects to be used as ↵Maxwell A McKinnon2019-10-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | source arg (GH-15326) Important work originally done by @emilyemorehouse two years ago and nearly ready to go in. This bug has affected many people and in some cases has been a dealbreaker to the adoption of the otherwise wonderful pathlib and PEP519. https://stackoverflow.com/questions/33625931/copy-file-with-pathlib-in-python. This adds the outstanding test request from that PR @vstinner (https://github.com/python/cpython/pull/5393). Test fails without the change, passes with it, along with every other test in test_shutil. Some variants were experimented with to make the one line change and the most performant one was picked. # Added Test for PathLike directory destination, the current fail case ``` Lib/test/test_shutil.py::TestMove::test_move_file_pathlike FAILED [100%] ============================================================== FAILURES =============================================================== __________________________________________________ TestMove.test_move_file_pathlike ___________________________________________________ self = <test.test_shutil.TestMove testMethod=test_move_file_pathlike> def test_move_file_pathlike(self): # Move a file to another location on the same filesystem. src = pathlib.Path(self.src_file) > self._check_move_file(src, self.dst_dir, self.dst_file) Lib/test/test_shutil.py:1563: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Lib/test/test_shutil.py:1545: in _check_move_file shutil.move(src, dst) /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/shutil.py:562: in move real_dst = os.path.join(dst, _basename(src)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = PosixPath('/var/folders/r2/psq74t5x3nbfzlph8bh2pvdw0000gn/T/tmp9ie0wh9_/foo') def _basename(path): # A basename() variant which first strips the trailing slash, if present. # Thus we always get the last component of the path, even for directories. sep = os.path.sep + (os.path.altsep or '') > return os.path.basename(path.rstrip(sep)) E AttributeError: 'PosixPath' object has no attribute 'rstrip' /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/shutil.py:526: AttributeError ============================================== 1 failed, 102 deselected in 0.30 seconds =============================================== ``` After change: ``` ========================================================= test session starts ========================================================= platform darwin -- Python 3.7.4, pytest-5.0.1, py-1.8.0, pluggy-0.12.0 -- /Users/maxwellmckinnon/.venvs/TA3.7/bin/python3.7 cachedir: .pytest_cache rootdir: /Users/maxwellmckinnon/dev/cpython plugins: cov-2.7.1, mock-1.10.4 collected 103 items / 102 deselected / 1 selected Lib/test/test_shutil.py::TestMove::test_move_file_pathlike PASSED [100%] ============================================== 1 passed, 102 deselected in 0.06 seconds =============================================== ``` Running all the tests in test_shutil.py ``` ╰─ pytest Lib/test/test_shutil.py -v ========================================================= test session starts ========================================================= platform darwin -- Python 3.7.4, pytest-5.0.1, py-1.8.0, pluggy-0.12.0 -- /Users/maxwellmckinnon/.venvs/TA3.7/bin/python3.7 cachedir: .pytest_cache rootdir: /Users/maxwellmckinnon/dev/cpython plugins: cov-2.7.1, mock-1.10.4 collected 103 items Lib/test/test_shutil.py::TestShutil::test_chown PASSED [ 0%] Lib/test/test_shutil.py::TestShutil::test_copy PASSED [ 1%] ... Lib/test/test_shutil.py::TermsizeTests::test_stty_match SKIPPED [ 99%] Lib/test/test_shutil.py::PublicAPITests::test_module_all_attribute PASSED [100%] ================================================ 96 passed, 7 skipped in 1.25 seconds ================================================= ``` # Performance Considerations Is it considered poor form to get rid of _basename altogether and make use of pathlib in the move function? I'm not sure if the idea is for all these modules to strictly avoid circular dependencies. They are already using os.path which is just as much a citizen in 3.8 as pathlib right? e.g. `real_dst = os.path.join(dst, _basename(src))` becomes `real_dst = Path(dst) / Path(src).name` I've looked around and familiarized myself, and I now think importing pathlib here is fine. My only remaining concern is that of performance. Here's the performance difference for this step. ``` In [46]: %timeit real_dst = os.path.join("a/b/c", _basename('b/')) 2.71 µs ± 62.6 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) In [47]: %timeit real_dst = Path("a/b/c") / Path('b/').name 12.4 µs ± 65.3 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) ``` Is 10us significant or insignificant compared to the least expensive operation this function will do? I don't know. Let's find out. ``` In [55]: %timeit os.rename('/tmp/a/a.txt', '/tmp/a/b.txt'); os.rename('/tmp/a/b.txt', '/tmp/a/a.txt') 124 µs ± 2.18 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each) ``` 62us to rename. 10us seems significant enough that we wouldn't want to favor the Path sugar suggestion. 16% speed decrease from adding the 10us. What do people think? I was hoping to get to use pathlib.Path here, but I suspect for this low level move, it should be as fast as possible, and 16% is not worth one line of sugary code to me. https://bugs.python.org/issue32689 Automerge-Triggered-By: @gvanrossum
* bpo-38242: Revert "bpo-36889: Merge asyncio streams (GH-13251)" (#16482)Yury Selivanov2019-09-301-0/+1
| | | See https://bugs.python.org/issue38242 for more details
* bpo-38163: Child mocks detect their type as sync or async (GH-16471)Lisa Roach2019-09-301-0/+4
|
* bpo-38161: Removes _AwaitEvent from AsyncMock. (GH-16443)Lisa Roach2019-09-301-0/+1
|
* bpo-38019: correctly handle pause/resume reading of closed asyncio unix pipe ↵Andrew Svetlov2019-09-291-0/+1
| | | | (GH-16472)
* bpo-38108: Makes mock objects inherit from Base (GH-16060)Lisa Roach2019-09-291-0/+2
|
* bpo-38115: Deal with invalid bytecode offsets in lnotab (GH-16079)T. Wouters2019-09-281-0/+1
| | | | | | | | | | 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.
* bpo-38216, bpo-36274: Allow subclasses to separately override validation and ↵Jason R. Coombs2019-09-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* bpo-28009: Fix uuid.uuid1() and uuid.get_node() on AIX (GH-8672)Michael Felt2019-09-261-0/+4
|
* bpo-38112: Compileall improvements (GH-16012)Lumír 'Frenzy' Balhar2019-09-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Raise the limit of maximum path depth to actual recursion limit * Add posibilities to adjust a path compiled in .pyc file. Now, you can: - Strip a part of path from a beggining of path into compiled file example "-s /test /test/build/real/test.py" → "build/real/test.py" - Append some new path to a beggining of path into compiled file example "-p /boo real/test.py" → "/boo/real/test.py" You can also use both options in the same time. In that case, striping is done before appending. * Add a possibility to specify multiple optimization levels Each optimization level then leads to separated compiled file. Use `action='append'` instead of `nargs='+'` for the -o option. Instead of `-o 0 1 2`, specify `-o 0 -o 1 -o 2`. It's more to type, but much more explicit. * Add a symlinks limitation feature This feature allows us to limit byte-compilation of symbolic links if they are pointing outside specified dir (build root for example).
* bpo-38142: Updated _hashopenssl.c to be PEP 384 compliant (#16071)Christian Heimes2019-09-251-0/+1
| | | | * Updated _hashopenssl.c to be PEP 384 compliant * Remove refleak test from test_hashlib. The updated type no longer accepts random arguments to __init__.
* bpo-38248: Fix inconsistent immediate asyncio.Task cancellation (GH-16330)Yury Selivanov2019-09-251-0/+1
|
* bpo-38265: Update os.pread to accept the length type as Py_ssize_t. (GH-16359)Dong-hee Na2019-09-251-0/+2
|
* bpo-38136: Updates await_count and call_count to be different things (GH-16192)Lisa Roach2019-09-241-0/+3
|