summaryrefslogtreecommitdiffstats
path: root/Misc/NEWS.d/next/Library
Commit message (Collapse)AuthorAgeFilesLines
* Fix `mock.patch.dict` to be stopped with `mock.patch.stopall` (#17606)Mario Corchero2020-01-241-0/+2
| | | | | As the function was not registering in the active patches, the mocks started by `mock.patch.dict` were not being stopped when `mock.patch.stopall` was being called.
* bpo-29435: Allow is_tarfile to take a filelike obj (GH-18090)William Woodruff2020-01-231-0/+2
| | | `is_tarfile()` now supports `name` being a file or file-like object.
* bpo-35182: fix communicate() crash after child closes its pipes (GH-17020) ↵Alex Rebert2020-01-221-0/+3
| | | | | | | | | (GH-18117) When communicate() is called in a loop, it crashes when the child process has already closed any piped standard stream, but still continues to be running Co-authored-by: Andriy Maletsky <andriy.maletsky@gmail.com>
* bpo-39366: Remove xpath() and xgtitle() methods of NNTP (GH-18035)Dong-hee Na2020-01-221-0/+2
|
* bpo-39406: Implement os.putenv() with setenv() if available (GH-18128)Victor Stinner2020-01-221-0/+3
| | | | | If setenv() C function is available, os.putenv() is now implemented with setenv() instead of putenv(), so Python doesn't have to handle the environment variable memory.
* Revert "bpo-39413: Implement os.unsetenv() on Windows (GH-18104)" (GH-18124)Victor Stinner2020-01-221-1/+0
| | | This reverts commit 56cd3710a1ea3ba872d345ea1bebc86ed08bc8b8.
* bpo-39353: Deprecate the binhex module (GH-18025)Victor Stinner2020-01-221-0/+4
| | | | | | | | Deprecate binhex4 and hexbin4 standards. Deprecate the binhex module and the following binascii functions: * b2a_hqx(), a2b_hqx() * rlecode_hqx(), rledecode_hqx() * crc_hqx()
* bpo-39413: Implement os.unsetenv() on Windows (GH-18104)Victor Stinner2020-01-211-0/+1
| | | | | The os.unsetenv() function is now also available on Windows. It is implemented with SetEnvironmentVariableW(name, NULL).
* bpo-39389: gzip: fix compression level metadata (GH-18077)William Chargin2020-01-211-0/+2
| | | | | | As described in RFC 1952, section 2.3.1, the XFL (eXtra FLags) byte of a gzip member header should indicate whether the DEFLATE algorithm was tuned for speed or compression ratio. Prior to this patch, archives emitted by the `gzip` module always indicated maximum compression.
* bpo-39396: Fix math.nextafter(-0.0, +0.0) on AIX 7.1 (GH-18094)Victor Stinner2020-01-211-0/+1
| | | | Move also math.nextafter() on math.ulp() tests from IsCloseTests to MathTests.
* bpo-39377: json: Remove the encoding option. (GH-18075)Inada Naoki2020-01-201-0/+2
|
* bpo-38536: locale: Remove trailing space in formatted currency (GH-16864)Inada Naoki2020-01-201-0/+2
|
* bpo-39357: Remove buffering parameter of bz2.BZ2File (GH-18028)Victor Stinner2020-01-161-0/+4
| | | | | | | Remove the buffering parameter of bz2.BZ2File. Since Python 3.0, it was ignored and using it was emitting a DeprecationWarning. Pass an open file object to control how the file is opened. The compresslevel parameter becomes keyword-only.
* bpo-39350: Remove deprecated fractions.gcd() (GH-18021)Victor Stinner2020-01-161-0/+2
| | | | Remove fractions.gcd() function, deprecated since Python 3.5 (bpo-22486): use math.gcd() instead.
* bpo-39351: Remove base64.encodestring() (GH-18022)Victor Stinner2020-01-161-0/+3
| | | | | Remove base64.encodestring() and base64.decodestring(), aliases deprecated since Python 3.1: use base64.encodebytes() and base64.decodebytes() instead.
* bpo-37958: Adding get_profile_dict to pstats (GH-15495)Daniel Olshansky2020-01-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pstats is really useful or profiling and printing the output of the execution of some block of code, but I've found on multiple occasions when I'd like to access this output directly in an easily usable dictionary on which I can further analyze or manipulate. The proposal is to add a function called get_profile_dict inside of pstats that'll automatically return this data the data in an easily accessible dict. The output of the following script: ``` import cProfile, pstats import pprint from pstats import func_std_string, f8 def fib(n): if n == 0: return 0 if n == 1: return 1 return fib(n-1) + fib(n-2) pr = cProfile.Profile() pr.enable() fib(5) pr.create_stats() ps = pstats.Stats(pr).sort_stats('tottime', 'cumtime') def get_profile_dict(self, keys_filter=None): """ Returns a dict where the key is a function name and the value is a dict with the following keys: - ncalls - tottime - percall_tottime - cumtime - percall_cumtime - file_name - line_number keys_filter can be optionally set to limit the key-value pairs in the retrieved dict. """ pstats_dict = {} func_list = self.fcn_list[:] if self.fcn_list else list(self.stats.keys()) if not func_list: return pstats_dict pstats_dict["total_tt"] = float(f8(self.total_tt)) for func in func_list: cc, nc, tt, ct, callers = self.stats[func] file, line, func_name = func ncalls = str(nc) if nc == cc else (str(nc) + '/' + str(cc)) tottime = float(f8(tt)) percall_tottime = -1 if nc == 0 else float(f8(tt/nc)) cumtime = float(f8(ct)) percall_cumtime = -1 if cc == 0 else float(f8(ct/cc)) func_dict = { "ncalls": ncalls, "tottime": tottime, # time spent in this function alone "percall_tottime": percall_tottime, "cumtime": cumtime, # time spent in the function plus all functions that this function called, "percall_cumtime": percall_cumtime, "file_name": file, "line_number": line } func_dict_filtered = func_dict if not keys_filter else { key: func_dict[key] for key in keys_filter } pstats_dict[func_name] = func_dict_filtered return pstats_dict pp = pprint.PrettyPrinter(depth=6) pp.pprint(get_profile_dict(ps)) ``` will produce: ``` {"<method 'disable' of '_lsprof.Profiler' objects>": {'cumtime': 0.0, 'file_name': '~', 'line_number': 0, 'ncalls': '1', 'percall_cumtime': 0.0, 'percall_tottime': 0.0, 'tottime': 0.0}, 'create_stats': {'cumtime': 0.0, 'file_name': '/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/cProfile.py', 'line_number': 50, 'ncalls': '1', 'percall_cumtime': 0.0, 'percall_tottime': 0.0, 'tottime': 0.0}, 'fib': {'cumtime': 0.0, 'file_name': 'get_profile_dict.py', 'line_number': 5, 'ncalls': '15/1', 'percall_cumtime': 0.0, 'percall_tottime': 0.0, 'tottime': 0.0}, 'total_tt': 0.0} ``` As an example, this can be used to generate a stacked column chart using various visualization tools which will assist in easily identifying program bottlenecks. https://bugs.python.org/issue37958 Automerge-Triggered-By: @gpshead
* bpo-38630: Fix subprocess.Popen.send_signal() race condition (GH-16984)Victor Stinner2020-01-151-0/+5
| | | | | | | On Unix, subprocess.Popen.send_signal() now polls the process status. Polling reduces the risk of sending a signal to the wrong process if the process completed, the Popen.returncode attribute is still None, and the pid has been reassigned (recycled) to a new different process.
* bpo-39329: Add timeout parameter for smtplib.LMTP constructor (GH-17998)Dong-hee Na2020-01-141-0/+2
|
* bpo-38901: Allow setting a venv's prompt to the basename of the current ↵Vinay Sajip2020-01-141-0/+3
| | | | | | directory. (GH-17946) When a prompt value of '.' is specified, os.path.basename(os.getcwd()) is used to configure the prompt for the created venv.
* bpo-38361: syslog: fixed making default "ident" from sys.argv[0] (GH-16557)Václav Bartoš2020-01-141-0/+1
| | | | | | | | | | The default value of "ident" parameter should be sys.argv[0] with leading path components stripped, but it contained the last slash, i.e. '/program' instead of 'program'. BPO issue: https://bugs.python.org/issue38361 https://bugs.python.org/issue38361
* bpo-39259: smtp.SMTP/SMTP_SSL now reject timeout = 0 (GH-17958)Dong-hee Na2020-01-141-0/+3
|
* bpo-39259: ftplib.FTP/FTP_TLS now reject timeout = 0 (GH-17959)Dong-hee Na2020-01-131-0/+3
|
* bpo-39310: Add math.ulp(x) (GH-17965)Victor Stinner2020-01-131-0/+1
| | | | Add math.ulp(): return the value of the least significant bit of a float.
* bpo-39313: Add an option to RefactoringTool for using exec as a function ↵Batuhan Taşkaya2020-01-121-0/+2
| | | | | | | | (GH-17967) https://bugs.python.org/issue39313 Automerge-Triggered-By: @pablogsal
* bpo-38293: Allow shallow and deep copying of property objects (GH-16438)Guðni Natan Gunnarsson2020-01-121-0/+1
| | | | | | | | | | | | | | | | | | Copying property objects results in a TypeError. Steps to reproduce: ``` >>> import copy >>> obj = property() >>> copy.copy(obj) ```` This affects both shallow and deep copying. My idea for a fix is to add property objects to the list of "atomic" objects in the copy module. These already include types like functions and type objects. I also added property objects to the unit tests test_copy_atomic and test_deepcopy_atomic. This is my first PR, and it's highly likely I've made some mistake, so please be kind :) https://bugs.python.org/issue38293
* bpo-39288: Add math.nextafter(x, y) (GH-17937)Victor Stinner2020-01-121-0/+2
| | | Return the next floating-point value after x towards y.
* bpo-39259: nntplib.NNTP/NNTP_SSL now reject timeout = 0 (GH-17936)Dong-hee Na2020-01-111-0/+3
| | | | | nntplib.NNTP and nntplib.NNTP_SSL now raise a ValueError if the given timeout for their constructor is zero to prevent the creation of a non-blocking socket.
* bpo-39297: Update for importlib_metadata 1.4. (GH-17947)Jason R. Coombs2020-01-111-0/+1
| | | | | | | | | | * bpo-39297: Update for importlib_metadata 1.4. Includes performance updates. * 📜🤖 Added by blurb_it. * Update blurb Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-39259: poplib now rejects timeout = 0 (GH-17912)Dong-hee Na2020-01-101-0/+3
| | | | | poplib.POP3 and poplib.POP3_SSL now raise a ValueError if the given timeout for their constructor is zero to prevent the creation of a non-blocking socket.
* bpo-35292: Avoid calling mimetypes.init when http.server is imported (GH-17822)An Long2020-01-081-0/+1
|
* bpo-39242: Updated the Gmane domain into news.gmane.io (GH-17903)Dong-hee Na2020-01-081-0/+3
|
* bpo-38871: Fix lib2to3 for filter-based statements that contain lambda ↵Dong-hee Na2020-01-071-0/+2
| | | | | | (GH-17780) Correctly parenthesize filter-based statements that contain lambda expressions in lib2to3.
* bpo-38615: Add timeout parameter for IMAP4 and IMAP4_SSL constructor (GH-17203)Dong-hee Na2020-01-071-0/+5
| | | | | | | | imaplib.IMAP4 and imaplib.IMAP4_SSL now have an optional *timeout* parameter for their constructors. Also, the imaplib.IMAP4.open() method now has an optional *timeout* parameter with this change. The overridden methods of imaplib.IMAP4_SSL and imaplib.IMAP4_stream were applied to this change.
* bpo-39198: Ensure logging global lock is released on exception in ↵Derek Brown2020-01-071-0/+1
| | | | isEnabledFor (GH-17689)
* bpo-39239: epoll.unregister() no longer ignores EBADF (GH-17882)Victor Stinner2020-01-071-0/+2
| | | | The select.epoll.unregister() method no longer ignores the EBADF error.
* bpo-38907: In http.server script, restore binding to IPv4 on Windows. (GH-17851)Jason R. Coombs2020-01-061-0/+1
|
* bpo-39152: add missing ttk.Scale.configure return value (GH-17815)Terry Jan Reedy2020-01-051-0/+2
| | | | tkinter.ttk.Scale().configure([name]) now returns a configuration tuple for name or a list thereof for all options. Based on patch Giovanni Lombardo.
* bpo-39055: Reject a trailing \n in base64.b64decode() with validate=True. ↵Serhiy Storchaka2020-01-051-0/+2
| | | | (GH-17616)
* bpo-39056: Fix handling invalid warning category in the -W option. (GH-17618)Serhiy Storchaka2020-01-051-0/+2
| | | No longer import the re module if it is not needed.
* bpo-39057: Fix urllib.request.proxy_bypass_environment(). (GH-17619)Serhiy Storchaka2020-01-051-0/+2
| | | Ignore leading dots and no longer ignore a trailing newline.
* bpo-28367: Add additional baud rates for termios (GH-13142)Anthony Shaw2020-01-041-0/+13
| | | | | | Co-authored-by: Andrey Smirnov <andrew.smirnov@gmail.com>. Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* Fix #39191: Don't spawn a task before failing (#17796)Andrew Svetlov2020-01-041-0/+3
|
* bpo-39158: ast.literal_eval() doesn't support empty sets (GH-17742)Raymond Hettinger2020-01-031-0/+1
|
* bpo-39142: Avoid converting namedtuple instances to ConvertingTuple. (GH-17773)Vinay Sajip2020-01-011-0/+5
| | | | | | | This uses the heuristic of assuming a named tuple is a subclass of tuple with a _fields attribute. This change means that contents of a named tuple wouldn't be converted - if a user wants to have ConvertingTuple functionality from a namedtuple, they will have to implement it themselves.
* bpo-39019: Implement missing __class_getitem__ for SpooledTemporaryFile ↵Batuhan Taşkaya2019-12-301-0/+1
| | | | | | (GH-17560)
* bpo-39019: Implement missing __class_getitem__ for subprocess classes (GH-17558)Batuhan Taşkaya2019-12-301-0/+2
|
* Fix import path for asyncio.TimeoutError (#17691)Andrew Svetlov2019-12-241-0/+1
|
* bpo-38914 Do not require email field in setup.py. (GH-17388)Jürgen Gmach2019-12-231-0/+5
| | | | | | | | | | | | | | | | | | When checking `setup.py` and when the `author` field was provided, but the `author_email` field was missing, erroneously a warning message was displayed that the `author_email` field is required. The specs do not require the `author_email`field: https://packaging.python.org/specifications/core-metadata/#author The same is valid for `maintainer` and `maintainer_email`. The warning message has been adjusted. modified: Doc/distutils/examples.rst modified: Lib/distutils/command/check.py https://bugs.python.org/issue38914
* bpo-38878: Fix os.PathLike __subclasshook__ (GH-17336)Bar Harel2019-12-221-0/+2
| | | | Quick subclasshook fix using the same method is being used in collections.abc (up to a certain degree).
* Python 3.9.0a2v3.9.0a2Łukasz Langa2019-12-1840-93/+0
|