summaryrefslogtreecommitdiffstats
path: root/Misc/NEWS.d/next/Library
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-38237: Make pow's arguments have more descriptive names and be keyword ↵Ammar Askar2019-09-211-0/+2
| | | | | | | | | | | | passable (GH-16302) Edit: `math.pow` changes removed on Mark's request. https://bugs.python.org/issue38237 Automerge-Triggered-By: @rhettinger
* bpo-38093: Correctly returns AsyncMock for async subclasses. (GH-15947)Lisa Roach2019-09-201-0/+2
|
* bpo-34002: Minor efficiency and clarity improvements in email package. (GH-7999)Michael Selik2019-09-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Check intersection of two sets explicitly Comparing ``len(a) > ``len(a - b)`` is essentially looking for an intersection between the two sets. If set ``b`` does not intersect ``a`` then ``len(a - b)`` will be equal to ``len(a)``. This logic is more clearly expressed as ``a & b``. * Change while/pop to a for-loop Copying the list, then repeatedly popping the first element was unnecessarily slow. I also cleaned up a couple other inefficiencies. There's no need to unpack a tuple, then re-pack and append it. The list can be created with the first element instead of empty. Secondly, the ``endswith`` method returns a bool, so there's no need for an if- statement to set ``encoding`` to True or False. * Use set.intersection to check for intersections ``a.intersection(b)`` method is more clear of purpose than ``not a.isdisjoint(b)`` and avoids an unnecessary set construction that ``a & set(b)`` performs. * Use not isdisjoint instead of intersection While it reads slightly worse, the isdisjoint method will stop when it finds a counterexample and returns a bool, rather than looping over the entire iterable and constructing a new set.
* bpo-38155: Add __all__ to datetime module (GH-16203)t k2019-09-191-0/+1
| | | https://bugs.python.org/issue38155
* bpo-34037: Fix test_asyncio failure and add loop.shutdown_default_executor() ↵Kyle Stanley2019-09-191-0/+4
| | | | (GH-15735)
* bpo-38191: Turn warnings into errors in NamedTuple() and TypedDict(). (GH-16238)Serhiy Storchaka2019-09-171-2/+1
|
* bpo-38191: Accept arbitrary keyword names in NamedTuple() and TypedDict(). ↵Serhiy Storchaka2019-09-171-0/+4
| | | | | | | | (GH-16222) This includes such names as "cls", "self", "typename", "_typename", "fields" and "_fields". Passing positional arguments by keyword is deprecated.
* bpo-37828: Fix default mock_name in unittest.mock.assert_called error (GH-16166)Abraham Toriz Cruz2019-09-171-0/+2
| | | | In the format string for assert_called the evaluation order is incorrect and hence for mock's without name, 'None' is printed whereas it should be 'mock' like for other messages. The error message is ("Expected '%s' to have been called." % self._mock_name or 'mock').
* bpo-38185: Fixed case-insensitive string comparison in sqlite3.Row indexing. ↵Serhiy Storchaka2019-09-171-0/+1
| | | | (GH-16190)
* bpo-33936: Don't call obsolete init methods with OpenSSL 1.1.0+ (GH-16140)Christian Heimes2019-09-161-0/+2
| | | | | | ``OPENSSL_VERSION_1_1`` was never defined in ``_hashopenssl.c``. https://bugs.python.org/issue33936
* bpo-38175: Fix a memory leak in comparison of sqlite3.Row objects. (GH-16155)Serhiy Storchaka2019-09-161-0/+1
|
* bpo-37206: Unrepresentable default values no longer represented as None. ↵Serhiy Storchaka2019-09-141-0/+2
| | | | | | | (GH-13933) In ArgumentClinic, value "NULL" should now be used only for unrepresentable default values (like in the optional third parameter of getattr). "None" should be used if None is accepted as argument and passing None has the same effect as not passing the argument at all.
* bpo-37953: Fix ForwardRef hash and equality checks (GH-15400)plokmijnuhby2019-09-131-0/+2
| | | | | Ideally if we stick a ForwardRef in a dictionary we would like to reliably be able to get it out again. https://bugs.python.org/issue37953
* bpo-34706: Preserve subclassing in inspect.Signature.from_callable (GH-16108)Gregory P. Smith2019-09-131-0/+1
| | | | | | | | https://bugs.python.org/issue34706 Specifically in the case of a class that does not override its constructor signature inherited from object. These are Buck Evan @bukzor's changes cherrypicked from GH-9344.
* bpo-37449: Move ensurepip off of pkgutil and to importlib.resources (GH-15109)Joannah Nanjekye2019-09-131-0/+2
| | | | | | Move ensurepip off of pkgutil and to importlib.resources. https://bugs.python.org/issue37449
* bpo-37555: Update _CallList.__contains__ to respect ANY (#14700)Elizabeth Uselton2019-09-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Flip equality to use mock calls' __eq__ * bpo-37555: Regression test demonstrating assert_has_calls not working with ANY and spec_set Co-authored-by: Neal Finne <neal@nealfinne.com> * Revert "Flip equality to use mock calls' __eq__" This reverts commit 94ddf54c5a8aab7d00d9ab93e1cc5695c28d73e7. * bpo-37555: Add regression tests for mock ANY ordering issues Add regression tests for whether __eq__ is order agnostic on _Call and _CallList, which is useful for comparisons involving ANY, especially if the ANY comparison is to a class not defaulting __eq__ to NotImplemented. Co-authored-by: Neal Finne <neal@nealfinne.com> * bpo-37555: Fix _CallList and _Call order sensitivity _Call and _CallList depend on ordering to correctly process that an object being compared to ANY with __eq__ should return True. This fix updates the comparison to check both a == b and b == a and return True if either condition is met, fixing situations from the tests in the previous two commits where assertEqual would not be commutative if checking _Call or _CallList objects. This seems like a reasonable fix considering that the Python data model specifies that if an object doesn't know how to compare itself to another object it should return NotImplemented, and that on getting NotImplemented from a == b, it should try b == a, implying that good behavior for __eq__ is commutative. This also flips the order of comparison in _CallList's __contains__ method, guaranteeing ANY will be on the left and have it's __eq__ called for equality checking, fixing the interaction between assert_has_calls and ANY. Co-author: Neal Finne <neal@neal.finne.com> * bpo-37555: Ensure _call_matcher returns _Call object * Adding ACK and news entry * bpo-37555: Replacing __eq__ with == to sidestep NotImplemented bool(NotImplemented) returns True, so it's necessary to use == instead of __eq__ in this comparison. * bpo-37555: cleaning up changes unnecessary to the final product * bpo-37555: Fixed call on bound arguments to respect args and kwargs * Revert "bpo-37555: Add regression tests for mock ANY ordering issues" This reverts commit 49c5310ad493c4356dd3bc58c03653cd9466c4fa. * Revert "bpo-37555: cleaning up changes unnecessary to the final product" This reverts commit 18e964ba0126d8964d89842cb95534b63c2d326e. * Revert "bpo-37555: Replacing __eq__ with == to sidestep NotImplemented" This reverts commit f295eaca5bceac6636c0e2b10e6c7d9a8ee8296a. * Revert "bpo-37555: Fix _CallList and _Call order sensitivity" This reverts commit 874fb697b8376fcea130116e56189061f944fde6. * Updated NEWS.d * bpo-37555: Add tests checking every function using _call_matcher both with and without spec * bpo-37555: Ensure all assert methods using _call_matcher are actually passing calls * Remove AnyCompare and use call objects everywhere. * Revert "Remove AnyCompare and use call objects everywhere." This reverts commit 24973c0b32ce7d796a7f4eeaf259832222aae0f5. * Check for exception in assert_any_await
* bpo-25068: urllib.request.ProxyHandler now lowercases the dict keys (GH-13489)Zackery Spytz2019-09-131-0/+2
|
* bpo-38153: Normalize hashlib algorithm names (GH-16083)Christian Heimes2019-09-131-0/+3
| | | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-38148: Add slots to asyncio transports (GH-16077)Andrew Svetlov2019-09-131-0/+1
| | | | | | | | * bpo-38148: Add slots to asyncio transports * Update Misc/NEWS.d/next/Library/2019-09-13-08-55-43.bpo-38148.Lnww6D.rst Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
* bpo-12144: Handle cookies with expires attribute in CookieJar.make_cookies ↵Xtreak2019-09-131-0/+2
| | | | | | | | | | | | | | (GH-13921) Handle time comparison for cookies with `expires` attribute when `CookieJar.make_cookies` is called. Co-authored-by: Demian Brecht <demianbrecht@gmail.com> https://bugs.python.org/issue12144 Automerge-Triggered-By: @asvetlov
* bpo-8538: Add support for boolean actions to argparse (GH-11478)Rémi Lapeyre2019-09-131-0/+2
| | | Co-Authored-By: remilapeyre <remi.lapeyre@henki.fr>
* bpo-37785: Fix xgettext warning in argparse (GH-15161)Jakub Kulík2019-09-131-0/+1
|
* bpo-9216: Add usedforsecurity to hashlib constructors (GH-16044)Christian Heimes2019-09-131-0/+2
| | | | | The usedforsecurity keyword only argument added to the hash constructors is useful for FIPS builds and similar restrictive environment with non-technical requirements that legacy algorithms be forbidden by their implementations without being explicitly annotated as not being used for any security related purposes. Linux distros with FIPS support benefit from this being standard rather than making up their own way(s) to do it. Contributed and Signed-off-by: Christian Heimes christian@python.org
* bpo-36046: Add user and group parameters to subprocess (GH-11950)Patrick McLean2019-09-121-0/+2
| | | | | | | | | | | | | | * subprocess: Add user, group and extra_groups paremeters to subprocess.Popen This adds a `user` parameter to the Popen constructor that will call setreuid() in the child before calling exec(). This allows processes running as root to safely drop privileges before running the subprocess without having to use a preexec_fn. This also adds a `group` parameter that will call setregid() in the child process before calling exec(). Finally an `extra_groups` parameter was added that will call setgroups() to set the supplimental groups.
* bpo-21872: fix lzma library decompresses data incompletely (GH-14048)animalize2019-09-121-0/+3
| | | | | | | * 1. add test case with wrong behavior * 2. fix bug when max_length == -1 * 3. allow b"" as valid input data for decompress_buf() * 4. when max_length >= 0, let needs_input mechanism works * add more asserts to test case
* bpo-36991: Fix incorrect exception escaping ZipFile.extract() (GH-13632)Berker Peksag2019-09-121-0/+2
|
* bpo-38132: Simplify _hashopenssl code (GH-16023)Christian Heimes2019-09-121-0/+3
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-38134: Remove PKBDF2_HMAC_fast from _hashopenssl (GH-16028)Christian Heimes2019-09-121-0/+2
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-9938: Add optional keyword argument exit_on_error to ↵Hai Shi2019-09-121-0/+1
| | | | | | | | | | | | argparse.ArgumentParser (GH-15362) Co-Authored-by: Xuanji Li <xuanji@gmail.com> https://bugs.python.org/issue9938 Automerge-Triggered-By: @matrixise
* bpo-38008: Move builtin protocol whitelist to mapping instead of list (GH-15647)Divij Rajkumar2019-09-121-0/+3
| | | | Fixes https://bugs.python.org/issue38008
* closes bpo-37405: Make socket.getsockname() always return a tuple for ↵bggardner2019-09-121-0/+2
| | | | | AF_CAN. (GH-14392) This fixes a regression from 3.5. In recent releases, `getsockname()` in the AF_CAN case has returned a string.
* bpo-38121: Sync importlib.metadata with 0.22 backport (GH-15993)Jason R. Coombs2019-09-121-0/+1
| | | | | | * bpo-38121: Sync importlib.metadata with 0.22 backport * 📜🤖 Added by blurb_it.
* bpo-32820: __format__ method for ipaddress (#5627)ewosborne2019-09-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bits method and test_bits * Cleaned up assert string * blurb * added docstring * Faster method, per Eric Smith * redoing as __format__ * added ipv6 method * test cases and cleanup * updated news * cleanup and NEWS.d * cleaned up old NEWS * removed cut and paste leftover * one more cleanup * moved to regexp, moved away from v4- and v6-specific versions of __format__ * More cleanup, added ipv6 test cases * more cleanup * more cleanup * cleanup * cleanup * cleanup per review, part 1 * addressed review comments around help string and regexp matching * wrapped v6 test strings. contiguous integers: break at 72char. with underscores: break so that it looks clean. * 's' and '' tests for pv4 and ipv6 * whitespace cleanup * Remove trailing whitespace * Remove more trailing whitespace * Remove an excess blank line
* bpo-18578: Rename and document test.bytecode_helper as ↵Joannah Nanjekye2019-09-121-0/+2
| | | | | test.support.bytecode_helper (GH-15168) Rename and document test.bytecode_helper as test.support.bytecode_helper
* bpo-28724: Add methods send_fds and recv_fds to the socket module (GH-12889)Joannah Nanjekye2019-09-111-0/+2
| | | | | | | The socket module now has the socket.send_fds() and socket.recv.fds() functions. Contributed by Joannah Nanjekye, Shinya Okano (original patch) and Victor Stinner. Co-Authored-By: Victor Stinner <vstinner@redhat.com>
* bpo-35923: Update the BuiltinImporter to use loader._ORIGIN instead of a ↵Dong-hee Na2019-09-111-0/+2
| | | | | | hard-coded value (GH-15651)
* bpo-38110: Use fdwalk for os.closerange() when available. (GH-15224)Jakub Kulík2019-09-111-0/+2
| | | Use fdwalk() on platforms that support it to implement os.closerange().
* bpo-37885: venv: Don't produce unbound variable warning on deactivate (GH-15330)Daniel Abrahamsson2019-09-111-0/+1
| | | | | | | | | | Before, running deactivate from a bash shell configured to treat undefined variables as errors (`set -u`) would produce a warning: ``` $ python3 -m venv test $ source test/bin/activate (test) $ deactivate -bash: $1: unbound variable ```
* bpo-37972: unittest.mock._Call now passes on __getitem__ to the __getattr__ ↵blhsing2019-09-111-0/+5
| | | | | | | | | | | | | | | | chaining so that call() can be subscriptable (GH-15565) * bpo-37972: unittest.mock._Call now passes on __getitem__ to the __getattr__ chaining so that call() can be subscriptable * 📜🤖 Added by blurb_it. * Update 2019-08-28-21-40-12.bpo-37972.kP-n4L.rst added name of the contributor * bpo-37972: made all dunder methods chainable for _Call * bpo-37972: delegate only attributes of tuple instead to __getattr__
* bpo-37488 : Document a warning for datetime.utcnow() and utcfromtimestamp() ↵Joannah Nanjekye2019-09-111-0/+1
| | | | | | | | | (GH-15773) https://bugs.python.org/issue37488 Automerge-Triggered-By: @pganssle
* bpo-37305: add MIME type for Web App Manifest (#14199)Filip Š2019-09-111-0/+2
| | | | | | | | * bpo-37305: add MIME type for Web App Manifest * bpo-37305: add news entry * Restore indentation and sort by value
* bpo-31163: Added return values to pathlib.Path instance's rename and replace ↵hui shang2019-09-111-0/+2
| | | | | methods. (GH-13582) * bpo-31163: Added return values to pathlib.Path instance's rename and replace methods.
* bpo-34519: Add additional aliases for HP Roman 8 (GH-8956)Michael Osipov2019-09-111-0/+1
| | | | | | | * bpo-34519: Add additional aliases for HP Roman 8 HP Roman 8 is known under mode aliases than listed in aliases.py. Patch by Michael Osipov.
* bpo-35640: Allow passing PathLike arguments to SimpleHTTPRequestHandler ↵Géry Ogam2019-09-111-0/+2
| | | | (GH-11398)
* bpo-35943: Prevent PyImport_GetModule() from returning a ↵Joannah Nanjekye2019-09-111-0/+2
| | | | partially-initialized module (GH-15057)
* bpo-20504 : in cgi.py, fix bug when a multipart/form-data request has… ↵Pierre Quentel2019-09-111-0/+2
| | | | | | | | | | | | (#10638) * bpo-20504 : in cgi.py, fix bug when a multipart/form-data request has no content-length header * Add Misc/NEWS.d/next file. * Add rst formatting for NEWS.d/next file * Reaplce assert by self.assertEqual
* bpo-35168: Make shlex.punctuation_chars read-only (#11631)Alex2019-09-111-0/+1
| | | | | | | | * bpo-35168: Documentation about shlex.punctuation_chars now states that it should be set in __init__.py * bpo-35168: Convert shlex.punctuation_chars to read-only property * Add NEWS.d entry
* bpo-37424: Avoid a hang in subprocess.run timeout output capture (GH-14490)Gregory P. Smith2019-09-111-0/+5
| | | | | | | Fixes a possible hang when using a timeout on subprocess.run() while capturing output. If the child process spawned its own children or otherwise connected its stdout or stderr handles with another process, we could hang after the timeout was reached and our child was killed when attempting to read final output from the pipes.
* bpo-32424: Deprecate xml.etree.ElementTree.Element.copy() in favor of ↵Gordon P. Hemsley2019-09-101-0/+3
| | | | copy.copy() (GH-12995)
* bpo-38086: Sync importlib.metadata with importlib_metadata 0.21. (GH-15840)Jason R. Coombs2019-09-101-0/+1
| | | https://gitlab.com/python-devs/importlib_metadata/-/tags/0.21