Release date: 2017-08-07
Release date: 2017-07-23
XML_SetHashSalt()
.
splithost('//127.0.0.1#@evil.com/')
now correctly returns the
127.0.0.1
host, instead of treating
@evil.com
as the host in an
authentification (
login@host
).
bool(range)
works even if
len(range)
引发
OverflowError
.
bpo-29403
:修复
unittest.mock
‘s autospec to not fail on method-bound builtin functions. Patch by Aaron Gallagher.
bpo-30961 : Fix decrementing a borrowed reference in tracemalloc.
bpo-30886 : Fix multiprocessing.Queue.join_thread(): it now waits until the thread completes, even if the thread was started by the same process which created the queue.
bpo-29854 : Fix segfault in readline when using readline’s history-size option. Patch by Nir Soffer.
bpo-30807 : signal.setitimer() may disable the timer when passed a tiny value.
Tiny values (such as 1e-6) are valid non-zero values for setitimer(), which is specified as taking microsecond-resolution intervals. However, on some platform, our conversion routine could convert 1e-6 into a zero interval, therefore disabling the timer instead of (re-)scheduling it.
bpo-30441 : Fix bug when modifying os.environ while iterating over it
bpo-30532 : Fix email header value parser dropping folding white space in certain cases.
bpo-29169 : Update zlib to 1.2.11.
bpo-30879 : os.listdir() and os.scandir() now emit bytes names when called with bytes- like argument.
bpo-30746
: Prohibited the ‘=’ character in environment variable names in
os.putenv()
and
os.spawn*()
.
bpo-29755 : Fixed the lgettext() family of functions in the gettext module. They now always return bytes.
bpo-30645 : Fix path calculation in imp.load_package(), fixing it for cases when a package is only shipped with bytecodes. Patch by Alexandru Ardelean.
bpo-23890 : unittest.TestCase.assertRaises() now manually breaks a reference cycle to not keep objects alive longer than expected.
bpo-30149 : inspect.signature() now supports callables with variable- argument parameters wrapped with partialmethod. Patch by Dong-hee Na.
bpo-29931 : Fixed comparison check for ipaddress.ip_interface objects. Patch by Sanjay Sundaresan.
bpo-24484 : Avoid race condition in multiprocessing cleanup.
bpo-28994 : The traceback no longer displayed for SystemExit raised in a callback registered by atexit.
bpo-30508 : Don’t log exceptions if Task/Future “cancel()” method was called.
bpo-28556 : Updates to typing module: Add generic AsyncContextManager, add support for ContextManager on all versions. Original PRs by Jelle Zijlstra and Ivan Levkivskyi
bpo-29870 : Fix ssl sockets leaks when connection is aborted in asyncio/ssl implementation. Patch by Michaël Sghaïer.
bpo-29743 : Closing transport during handshake process leaks open socket. Patch by Nikolay Kim
bpo-27585 : Fix waiter cancellation in asyncio.Lock. Patch by Mathieu Sornay.
bpo-30418 : On Windows, subprocess.Popen.communicate() now also ignore EINVAL on stdin.write() if the child process is still running but closed the pipe.
bpo-30378 : Fix the problem that logging.handlers.SysLogHandler cannot handle IPv6 addresses.
bpo-29960 : Preserve generator state when _random.Random.setstate() raises an exception. Patch by Bryan Olson.
bpo-30414 : multiprocessing.Queue._feed background running thread do not break from main loop on exception.
bpo-30003 : Fix handling escape characters in HZ codec. Based on patch by Ma Lin.
bpo-30301 : Fix AttributeError when using SimpleQueue.empty() under spawn and forkserver start methods.
bpo-30329 : imaplib and poplib now catch the Windows socket WSAEINVAL error (code 10022) on shutdown(SHUT_RDWR): An invalid operation was attempted. This error occurs sometimes on SSL connections.
bpo-30375 : Warnings emitted when compile a regular expression now always point to the line in the user code. Previously they could point into inners of the re module if emitted from inside of groups or conditionals.
bpo-30048
: Fixed
Task.cancel()
can be ignored when the task is running coroutine and the coroutine returned without any more
await
.
bpo-29990 : Fix range checking in GB18030 decoder. Original patch by Ma Lin.
bpo-26293 : Change resulted because of zipfile breakage. (See also: bpo-29094 )
bpo-30243 : Removed the __init__ methods of _json’s scanner and encoder. Misusing them could cause memory leaks or crashes. Now scanner and encoder objects are completely initialized in the __new__ methods.
bpo-30185 : Avoid KeyboardInterrupt tracebacks in forkserver helper process when Ctrl-C is received.
bpo-28556 : Various updates to typing module: add typing.NoReturn type, use WrapperDescriptorType, minor bug-fixes. Original PRs by Jim Fasarakis- Hilliard and Ivan Levkivskyi.
bpo-30205 : Fix getsockname() for unbound AF_UNIX sockets on Linux.
bpo-30070 : Fixed leaks and crashes in errors handling in the parser module.
bpo-30061 : Fixed crashes in IOBase methods __next__() and readlines() when readline() or __next__() respectively return non-sizeable object. Fixed possible other errors caused by not checking results of PyObject_Size(), PySequence_Size(), or PyMapping_Size().
bpo-30068 : _io._IOBase.readlines will check if it’s closed first when hint is present.
bpo-29694 : Fixed race condition in pathlib mkdir with flags parents=True. Patch by Armin Rigo.
bpo-29692 : Fixed arbitrary unchaining of RuntimeError exceptions in contextlib.contextmanager. Patch by Siddharth Velankar.
bpo-29998 : Pickling and copying ImportError now preserves name and path attributes.
bpo-29942 : Fix a crash in itertools.chain.from_iterable when encountering long runs of empty iterables.
bpo-27863 : Fixed multiple crashes in ElementTree caused by race conditions and wrong types.
bpo-28699 : Fixed a bug in pools in multiprocessing.pool that raising an exception at the very first of an iterable may swallow the exception or make the program hang. Patch by Davin Potts and Xiang Zhang.
bpo-25803 : Avoid incorrect errors raised by Path.mkdir(exist_ok=True) when the OS gives priority to errors such as EACCES over EEXIST.
bpo-29861 : Release references to tasks, their arguments and their results as soon as they are finished in multiprocessing.Pool.
bpo-29884 : faulthandler: Restore the old sigaltstack during teardown. Patch by Christophe Zeitouny.
bpo-25455 : Fixed crashes in repr of recursive buffered file-like objects.
bpo-29800 : Fix crashes in partial.__repr__ if the keys of partial.keywords are not strings. Patch by Michael Seifert.
bpo-29742 : get_extra_info() raises exception if get called on closed ssl transport. Patch by Nikolay Kim.
bpo-8256 : Fixed possible failing or crashing input() if attributes “encoding” or “errors” of sys.stdin or sys.stdout are not set or are not strings.
bpo-28298 : Fix a bug that prevented array ‘Q’, ‘L’ and ‘I’ from accepting big intables (objects that have __int__) as elements. Patch by Oren Milman.
bpo-29615 : SimpleXMLRPCDispatcher no longer chains KeyError (or any other exception) to exception(s) raised in the dispatched methods. Patch by Petr Motejlek.
bpo-29704 : asyncio.subprocess.SubprocessStreamProtocol no longer closes before all pipes are closed.
bpo-29703 : Fix asyncio to support instantiation of new event loops in child processes.
bpo-29376 : Fix assertion error in threading._DummyThread.is_alive().
bpo-29110 : Fix file object leak in aifc.open() when file is given as a filesystem path and is not in valid AIFF format. Patch by Anthony Zhang.
bpo-28961 : Fix unittest.mock._Call helper: don’t ignore the name parameter anymore. Patch written by Jiajun Huang.
bpo-29532 : Altering a kwarg dictionary passed to functools.partial() no longer affects a partial object after creation.
bpo-28556 : Various updates to typing module: typing.Counter, typing.ChainMap, improved ABC caching, etc. Original PRs by Jelle Zijlstra, Ivan Levkivskyi, Manuel Krebber, and Łukasz Langa.
bpo-29100 : Fix datetime.fromtimestamp() regression introduced in Python 3.6.0: check minimum and maximum years.
bpo-29519 : Fix weakref spewing exceptions during interpreter shutdown when used with a rare combination of multiprocessing and custom codecs.
bpo-29416 : Prevent infinite loop in pathlib.Path.mkdir
bpo-29444 : Fixed out-of-bounds buffer access in the group() method of the match object. Based on patch by WGH.
bpo-29335 : Fix subprocess.Popen.wait() when the child process has exited to a stopped instead of terminated state (ex: when under ptrace).
bpo-29290 : Fix a regression in argparse that help messages would wrap at non-breaking spaces.
bpo-28735 : Fixed the comparison of mock.MagickMock with mock.ANY.
bpo-29011 : Fix an important omission by adding Deque to the typing module.
bpo-29219 : Fixed infinite recursion in the repr of uninitialized ctypes.CDLL instances.
bpo-28969 : Fixed race condition in C implementation of functools.lru_cache. KeyError could be raised when cached function with full cache was simultaneously called from differen threads with the same uncached arguments.
bpo-29142 : In urllib.request, suffixes in no_proxy environment variable with leading dots could match related hostnames again (e.g. .b.c matches a.b.c). Patch by Milan Oberkirch.
bpo-30822 : Fix regrtest command line parser to allow passing -u extralargefile to run test_zipfile64.
bpo-30383 : regrtest: Enhance regrtest and backport features from the master branch.
Add options: –coverage, –testdir, –list-tests (list test files, don’t run them), –list-cases (list test identifiers, don’t run them, bpo-30523 ), –matchfile (load a list of test filters from a text file, bpo-30540 ), –slowest (alias to –slow).
Enhance output: add timestamp, test result, currently running tests, “Tests result: xxx” summary with total duration, etc.
Fix reference leak hunting in regrtest, –huntrleaks: regrtest now warms up caches, create explicitly all internal singletons which are created on demand to prevent false positives when checking for reference leaks. ( bpo-30675 ).
bpo-30357 : test_thread: setUp() now uses support.threading_setup() and support.threading_cleanup() to wait until threads complete to avoid random side effects on following tests. Initial patch written by Grzegorz Grzywacz.
bpo-28087 : Skip test_asyncore and test_eintr poll failures on macOS. Skip some tests of select.poll when running on macOS due to unresolved issues with the underlying system poll function on some macOS versions.
bpo-30197 : Enhanced functions swap_attr() and swap_item() in the test.support module. They now work when delete replaced attribute or item inside the with statement. The old value of the attribute or item (or None if it doesn’t exist) now will be assigned to the target of the “as” clause, if there is one.
bpo-29571
: to match the behaviour of the
re.LOCALE
flag, test_re.test_locale_flag now uses
locale.getpreferredencoding(False)
to determine the candidate encoding for the test regex (allowing it to correctly skip the test when the default locale encoding is a multi-byte encoding)
make test
,
make install
and some other make targets when configured with
--enable- optimizations
.
make touch
with
make regen-all
.
--enable-optimization
didn’t work.
Release date: 2017-01-17
There were no code changes between 3.5.3rc1 and 3.5.3 final.
Release date: 2017-01-02
complex(1.0,
{2:3})
. Patch by Soumya Sharma.
m_methods
field to be used to add module level functions to instances
of non-module types returned from
Py_create_mod
. Patch by Xiang Zhang.
bpo-15812 : inspect.getframeinfo() now correctly shows the first line of a context. Patch by Sam Breese.
bpo-29094 : Offsets in a ZIP file created with extern file object and modes “w” and “x” now are relative to the start of the file.
bpo-13051 : Fixed recursion errors in large or resized curses.textpad.Textbox. Based on patch by Tycho Andersen.
bpo-29119 : Fix weakrefs in the pure python version of collections.OrderedDict move_to_end() method. Contributed by Andra Bogildea.
bpo-9770 : curses.ascii predicates now work correctly with negative integers.
bpo-28427 : old keys should not remove new values from WeakValueDictionary when collecting from another thread.
bpo-28923 : Remove editor artifacts from Tix.py.
bpo-28871 : Fixed a crash when deallocate deep ElementTree.
bpo-19542 : Fix bugs in WeakValueDictionary.setdefault() and WeakValueDictionary.pop() when a GC collection happens in another thread.
bpo-20191 : Fixed a crash in resource.prlimit() when pass a sequence that doesn’t own its elements as limits.
bpo-28779 : multiprocessing.set_forkserver_preload() would crash the forkserver process if a preloaded module instantiated some multiprocessing objects such as locks.
bpo-28847 : dbm.dumb now supports reading read-only files and no longer writes the index file when it is not changed.
bpo-25659 : In ctypes, prevent a crash calling the from_buffer() and from_buffer_copy() methods on abstract classes like Array.
bpo-28732 : Fix crash in os.spawnv() with no elements in args
bpo-28485 : Always raise ValueError for negative compileall.compile_dir(workers=...) parameter, even when multithreading is unavailable.
bpo-28387 : Fixed possible crash in _io.TextIOWrapper deallocator when the garbage collector is invoked in other thread. Based on patch by Sebastian Cufre.
bpo-27517 : LZMA compressor and decompressor no longer raise exceptions if given empty data twice. Patch by Benjamin Fogle.
bpo-28549 : Fixed segfault in curses’s addch() with ncurses6.
bpo-28449 : tarfile.open() with mode “r” or “r:” now tries to open a tar file with compression before trying to open it without compression. Otherwise it had 50% chance failed with ignore_zeros=True.
bpo-23262 : The webbrowser module now supports Firefox 36+ and derived browsers. Based on patch by Oleg Broytman.
bpo-27939 : Fixed bugs in tkinter.ttk.LabeledScale and tkinter.Scale caused by representing the scale as float value internally in Tk. tkinter.IntVar now works if float value is set to underlying Tk variable.
bpo-28255 : calendar.TextCalendar().prmonth() no longer prints a space at the start of new line after printing a month’s calendar. Patch by Xiang Zhang.
bpo-20491 : The textwrap.TextWrapper class now honors non-breaking spaces. Based on patch by Kaarle Ritvanen.
bpo-28353 : os.fwalk() no longer fails on broken links.
bpo-25464 : Fixed HList.header_exists() in tkinter.tix module by addin a workaround to Tix library bug.
bpo-28488 : shutil.make_archive() no longer add entry ”./” to ZIP archive.
bpo-24452 : Make webbrowser support Chrome on Mac OS X.
bpo-20766 : Fix references leaked by pdb in the handling of SIGINT handlers.
bpo-26293 : Fixed writing ZIP files that starts not from the start of the file. Offsets in ZIP file now are relative to the start of the archive in conforming to the specification.
bpo-28321 : Fixed writing non-BMP characters with binary format in plistlib.
bpo-28322 : Fixed possible crashes when unpickle itertools objects from incorrect pickle data. Based on patch by John Leitch.
Fix possible integer overflows and crashes in the mmap module with unusual usage patterns.
bpo-1703178 : Fix the ability to pass the –link-objects option to the distutils build_ext command.
bpo-28253 : Fixed calendar functions for extreme months: 0001-01 and 9999-12.
Methods itermonthdays() and itermonthdays2() are reimplemented so that they don’t call itermonthdates() which can cause datetime.date under/overflow.
bpo-28275 : Fixed possible use after free in the decompress() methods of the LZMADecompressor and BZ2Decompressor classes. Original patch by John Leitch.
bpo-27897 : Fixed possible crash in sqlite3.Connection.create_collation() if pass invalid string-like object as a name. Patch by Xiang Zhang.
bpo-18893 : Fix invalid exception handling in Lib/ctypes/macholib/dyld.py. Patch by Madison May.
bpo-27611 : Fixed support of default root window in the tkinter.tix module.
bpo-27348 : In the traceback module, restore the formatting of exception messages like “Exception: None”. This fixes a regression introduced in 3.5a2.
bpo-25651 : Allow falsy values to be used for msg parameter of subTest().
bpo-27932 : Prevent memory leak in win32_ver().
Fix UnboundLocalError in socket._sendfile_use_sendfile.
bpo-28075 : Check for ERROR_ACCESS_DENIED in Windows implementation of os.stat(). Patch by Eryk Sun.
bpo-25270 : Prevent codecs.escape_encode() from raising SystemError when an empty bytestring is passed.
bpo-28181 : Get antigravity over HTTPS. Patch by Kaartic Sivaraam.
bpo-25895 : Enable WebSocket URL schemes in urllib.parse.urljoin. Patch by Gergely Imreh and Markus Holtermann.
bpo-27599 : Fixed buffer overrun in binascii.b2a_qp() and binascii.a2b_qp().
bpo-19003
: m email.generator now replaces only
\r
and/or
\n
line endings, per the RFC, instead of all unicode line endings.
bpo-28019 : itertools.count() no longer rounds non-integer step in range between 1.0 and 2.0 to 1.
bpo-25969 : Update the lib2to3 grammar to handle the unpacking generalizations added in 3.5.
bpo-14977 : mailcap now respects the order of the lines in the mailcap files (“first match”), as required by RFC 1542. Patch by Michael Lazar.
bpo-24594 : Validates persist parameter when opening MSI database
bpo-17582 : xml.etree.ElementTree nows preserves whitespaces in attributes (Patch by Duane Griffin. Reviewed and approved by Stefan Behnel.)
bpo-28047 : Fixed calculation of line length used for the base64 CTE in the new email policies.
bpo-27445 : Don’t pass str(_charset) to MIMEText.set_payload(). Patch by Claude Paroz.
bpo-22450
: urllib now includes an
Accept: */*
header among the default headers. This makes the results of REST API requests more consistent and predictable especially when proxy servers are involved.
lib2to3.pgen3.driver.load_grammar() now creates a stable cache file between runs given the same Grammar.txt input regardless of the hash randomization setting.
bpo-27570 : Avoid zero-length memcpy() etc calls with null source pointers in the “ctypes” and “array” modules.
bpo-22233 : Break email header lines only on the RFC specified CR and LF characters, not on arbitrary unicode line breaks. This also fixes a bug in HTTP header parsing.
bpo-27988 : Fix email iter_attachments incorrect mutation of payload list.
bpo-27691 : Fix ssl module’s parsing of GEN_RID subject alternative name fields in X.509 certs.
bpo-27850 : Remove 3DES from ssl module’s default cipher list to counter measure sweet32 attack (CVE-2016-2183).
bpo-27766 : Add ChaCha20 Poly1305 to ssl module’s default ciper list. (Required OpenSSL 1.1.0 or LibreSSL).
bpo-26470 : Port ssl and hashlib module to OpenSSL 1.1.0.
Remove support for passing a file descriptor to os.access. It never worked but previously didn’t raise.
bpo-12885 : Fix error when distutils encounters symlink.
bpo-27881 : Fixed possible bugs when setting sqlite3.Connection.isolation_level. Based on patch by Xiang Zhang.
bpo-27861 : Fixed a crash in sqlite3.Connection.cursor() when a factory creates not a cursor. Patch by Xiang Zhang.
bpo-19884 : Avoid spurious output on OS X with Gnu Readline.
bpo-27706 : Restore deterministic behavior of random.Random().seed() for string seeds using seeding version 1. Allows sequences of calls to random() to exactly match those obtained in Python 2. Patch by Nofar Schnider.
bpo-10513 : Fix a regression in Connection.commit(). Statements should not be reset after a commit.
A new version of typing.py from https://github.com/python/typing : - Collection (only for 3.6) ( bpo-27598 ) - Add FrozenSet to __all__ (upstream #261) - fix crash in _get_type_vars() (upstream #259) - Remove the dict constraint in ForwardRef._eval_type (upstream #252)
bpo-27539
: Fix unnormalised
Fraction.__pow__
result in the case of negative exponent and negative base.
bpo-21718 : cursor.description is now available for queries using CTEs.
bpo-2466 : posixpath.ismount now correctly recognizes mount points which the user does not have permission to access.
bpo-27773 : Correct some memory management errors server_hostname in _ssl.wrap_socket().
bpo-26750 : unittest.mock.create_autospec() now works properly for subclasses of property() and other data descriptors.
In the curses module, raise an error if window.getstr() or window.instr() is passed a negative value.
bpo-27783 : Fix possible usage of uninitialized memory in operator.methodcaller.
bpo-27774 : Fix possible Py_DECREF on unowned object in _sre.
bpo-27760 : Fix possible integer overflow in binascii.b2a_qp.
bpo-27758 : Fix possible integer overflow in the _csv module for large record lengths.
bpo-27568 : Prevent HTTPoxy attack (CVE-2016-1000110). Ignore the HTTP_PROXY variable when REQUEST_METHOD environment is set, which indicates that the script is in CGI mode.
bpo-27656 : Do not assume sched.h defines any SCHED_* constants.
bpo-27130 : In the “zlib” module, fix handling of large buffers (typically 4 GiB) when compressing and decompressing. Previously, inputs were limited to 4 GiB, and compression and decompression operations did not properly handle results of 4 GiB.
bpo-27533 : Release GIL in nt._isdir
bpo-17711 : Fixed unpickling by the persistent ID with protocol 0. Original patch by Alexandre Vassalotti.
bpo-27522 : Avoid an unintentional reference cycle in email.feedparser.
bpo-26844 : Fix error message for imp.find_module() to refer to ‘path’ instead of ‘name’. Patch by Lev Maximov.
bpo-23804 : Fix SSL zero-length recv() calls to not block and not raise an error about unclean EOF.
bpo-27466 : Change time format returned by http.cookie.time2netscape, confirming the netscape cookie format and making it consistent with documentation.
bpo-26664
: Fix activate.fish by removing mis-use of
$
.
bpo-22115 : Fixed tracing Tkinter variables: trace_vdelete() with wrong mode no longer break tracing, trace_vinfo() now always returns a list of pairs of strings, tracing in the “u” mode now works.
Fix a scoping issue in importlib.util.LazyLoader which triggered an UnboundLocalError when lazy-loading a module that was already put into sys.modules.
bpo-27079 : Fixed curses.ascii functions isblank(), iscntrl() and ispunct().
bpo-26754 : Some functions (compile() etc) accepted a filename argument encoded as an iterable of integers. Now only strings and byte-like objects are accepted.
bpo-27048 : Prevents distutils failing on Windows when environment variables contain non-ASCII characters
bpo-27330 : Fixed possible leaks in the ctypes module.
bpo-27238 : Got rid of bare excepts in the turtle module. Original patch by Jelle Zijlstra.
bpo-27122 : When an exception is raised within the context being managed by a contextlib.ExitStack() and one of the exit stack generators catches and raises it in a chain, do not re-raise the original exception when exiting, let the new chained one through. This avoids the PEP 479 bug described in issue25782.
Release date: 2016-06-26
Release date: 2016-06-12
*
) unpacking in function calls. Based on patch by Hagen Fürstenau
and Daniel Urban.
f1, f2 = lambda: 1, lambda:
1.0
is now correctly compiled to two different functions:
f1()
返回
1
(
int
) 和
f2()
返回
1.0
(
int
), even if
1
and
1.0
相等。
os.urandom()
now calls
getrandom()
with
GRND_NONBLOCK
to fall back on reading
/dev/urandom
if the urandom
entropy pool is not initialized yet. Patch written by Colm Buckley.
bpo-27164 : In the zlib module, allow decompressing raw Deflate streams with a predefined zdict. Based on patch by Xiang Zhang.
bpo-24291 : Fix wsgiref.simple_server.WSGIRequestHandler to completely write data to the client. Previously it could do partial writes and truncate data. Also, wsgiref.handler.ServerHandler can now handle stdout doing partial writes, but this is deprecated.
bpo-26373 : subprocess.Popen.communicate now correctly ignores BrokenPipeError when the child process dies before .communicate() is called in more/all circumstances.
bpo-21776 : distutils.upload now correctly handles HTTPError. Initial patch by Claudiu Popa.
bpo-27114 : Fix SSLContext._load_windows_store_certs fails with PermissionError
bpo-18383 : Avoid creating duplicate filters when using filterwarnings and simplefilter. Based on patch by Alex Shkop.
bpo-27057 : Fix os.set_inheritable() on Android, ioctl() is blocked by SELinux and fails with EACCESS. The function now falls back to fcntl(). Patch written by Michał Bednarski.
bpo-27014 : Fix infinite recursion using typing.py. Thanks to Kalle Tuure!
bpo-14132 : Fix urllib.request redirect handling when the target only has a query string. Original fix by Ján Janech.
bpo-17214 : The “urllib.request” module now percent-encodes non-ASCII bytes found in redirect target URLs. Some servers send Location header fields with non- ASCII bytes, but “http.client” requires the request target to be ASCII- encodable, otherwise a UnicodeEncodeError is raised. Based on patch by Christian Heimes.
bpo-26892 : Honor debuglevel flag in urllib.request.HTTPHandler. Patch contributed by Chi Hsuan Yen.
bpo-22274 : In the subprocess module, allow stderr to be redirected to stdout even when stdout is not redirected. Patch by Akira Li.
bpo-26807 : mock_open ‘files’ no longer error on readline at end of file. Patch from Yolanda Robla.
bpo-25745 : Fixed leaking a userptr in curses panel destructor.
bpo-26977 : Removed unnecessary, and ignored, call to sum of squares helper in statistics.pvariance.
bpo-26881 : The modulefinder module now supports extended opcode arguments.
bpo-23815 : Fixed crashes related to directly created instances of types in _tkinter and curses.panel modules.
bpo-17765 : weakref.ref() no longer silently ignores keyword arguments. Patch by Georg Brandl.
bpo-26873 : xmlrpc now raises ResponseError on unsupported type tags instead of silently return incorrect result.
bpo-26711 : Fixed the comparison of plistlib.Data with other types.
bpo-24114
: Fix an uninitialized variable in
ctypes.util
.
The bug only occurs on SunOS when the ctypes implementation searches for the
crle
program. Patch by Xiang Zhang. Tested on SunOS by Kees Bos.
bpo-26864 : In urllib.request, change the proxy bypass host checking against no_proxy to be case-insensitive, and to not match unrelated host names that happen to have a bypassed hostname as a suffix. Patch by Xiang Zhang.
bpo-26634 : recursive_repr() now sets __qualname__ of wrapper. Patch by Xiang Zhang.
bpo-26804 : urllib.request will prefer lower_case proxy environment variables over UPPER_CASE or Mixed_Case ones. Patch contributed by Hans- Peter Jansen.
bpo-26837 : assertSequenceEqual() now correctly outputs non-stringified differing items (like bytes in the -b mode). This affects assertListEqual() and assertTupleEqual().
bpo-26041 : Remove “will be removed in Python 3.7” from deprecation messages of platform.dist() and platform.linux_distribution(). Patch by Kumaripaba Miyurusara Athukorala.
bpo-26822 : itemgetter, attrgetter and methodcaller objects no longer silently ignore keyword arguments.
bpo-26733 : Disassembling a class now disassembles class and static methods. Patch by Xiang Zhang.
bpo-26801
: Fix error handling in
shutil.get_terminal_size()
, catch
AttributeError
而不是
NameError
. Patch written by Emanuel Barry.
bpo-24838 : tarfile’s ustar and gnu formats now correctly calculate name and link field limits for multibyte character encodings like utf-8.
os.urandom()
on Solaris 11.3 and newer when reading
more than 1,024 bytes: call
getrandom()
multiple times with a limit of
1024 bytes per call.
warnings.formatwarning()
now catches exceptions on
linecache.getline(...)
to be able to log
ResourceWarning
emitted late during the Python shutdown process.
pyclbr.readmodule()
and
pyclbr.readmodule_ex()
to support importing packages.
<~
is optional now in base64.a85decode() with
adobe=True. Patch by Swati Jaiswal.
level
is specified but without an
accompanying package specified.
**
pattern in
pathlib.Path.[r]glob().
*.pyc
file).
--pgo
and
--pgo-job
arguments to
PCbuild\build.bat
for building with Profile-Guided Optimization. The
old
PCbuild\build_pgo.bat
script is now deprecated, and simply calls
PCbuild\build.bat --pgo %*
.
configure
, including a
new
--with-icc
标志。
Release date: 2015-12-06
Release date: 2015-11-22
**
.
PCbuild\rt.bat
now accepts an unlimited number of arguments to pass
along to regrtest.py. Previously there was a limit of 9.
Release date: 2015-09-13
Release date: 2015-09-09
Release date: 2015-09-07
Release date: 2015-08-25
from .. import ...
statement will trigger an ImportError instead of
an AttributeError.
Release date: 2015-08-09
-w
command line option, a
test run is no longer marked as a failure if all tests succeed when re-
run.
Release date: 2015-07-26
inspect.getsource
to return
incorrect results on nested functions.
Release date: 2015-07-05
Release date: 2015-05-31
Release date: 2015-05-24
tkinter._fix
module used for setting up the
Tcl/Tk environment on Windows with a private function in the
_tkinter
module that makes no permanent changes to the environment.
Release date: 2015-04-19
from subprocess import *
.
socket.socket.sendall()
does no more reset the socket
timeout each time data is sent successfully. The socket timeout is now the
maximum total duration to send all data.
socket.socket.connect()
now waits until the connection
completes instead of raising
InterruptedError
if the connection is
interrupted by signals, signal handlers don’t raise an exception and the
socket is blocking or has a timeout.
socket.socket.connect()
still
raise
InterruptedError
for non-blocking sockets.
Release date: 2015-03-28
'\'
and ASCII letter now raise a deprecation warning and will be forbidden in
Python 3.6.
signal.sigwaitinfo()
and
signal.sigtimedwait()
are
now retried when interrupted by a signal not in the
sigset
parameter, if
the signal handler does not raise an exception. signal.sigtimedwait()
recomputes the timeout with a monotonic clock when it is retried.
Release date: 2015-03-09
bpo-22524 : New os.scandir() function, part of the PEP 471: “os.scandir() function – a better and faster directory iterator”. Patch written by Ben Hoyt.
bpo-23103 : Reduced the memory consumption of IPv4Address and IPv6Address.
bpo-21793 : BaseHTTPRequestHandler again logs response code as numeric, not as stringified enum. Patch by Demian Brecht.
bpo-23476 : In the ssl module, enable OpenSSL’s X509_V_FLAG_TRUSTED_FIRST flag on certificate stores when it is available.
bpo-23576 : Avoid stalling in SSL reads when EOF has been reached in the SSL layer but the underlying connection hasn’t been closed.
bpo-23504 : Added an __all__ to the types module.
bpo-23563 : Optimized utility functions in urllib.parse.
bpo-7830 : Flatten nested functools.partial.
bpo-20204 : Added the __module__ attribute to _tkinter classes.
bpo-19980 : Improved help() for non-recognized strings. help(‘’) now shows the help on str. help(‘help’) now shows the help on help(). Original patch by Mark Lawrence.
bpo-23521 : Corrected pure python implementation of timedelta division.
Eliminated OverflowError from
timedelta * float
for some floats; Corrected rounding in timedlta true division.
bpo-21619 : Popen objects no longer leave a zombie after exit in the with statement if the pipe was broken. Patch by Martin Panter.
bpo-22936 : Make it possible to show local variables in tracebacks for both the traceback module and unittest.
bpo-15955 : Add an option to limit the output size in bz2.decompress(). Patch by Nikolaus Rath.
bpo-6639 : Module-level turtle functions no longer raise TclError after closing the window.
bpo-814253 : Group references and conditional group references now work in lookbehind assertions in regular expressions. (See also: bpo-9179 )
bpo-23215 : Multibyte codecs with custom error handlers that ignores errors consumed too much memory and raised SystemError or MemoryError. Original patch by Aleksi Torhamo.
bpo-5700 : io.FileIO() called flush() after closing the file. flush() was not called in close() if closefd=False.
bpo-23374 : Fixed pydoc failure with non-ASCII files when stdout encoding differs from file system encoding (e.g. on Mac OS).
bpo-23481 : Remove RC4 from the SSL module’s default cipher list.
bpo-21548 : Fix pydoc.synopsis() and pydoc.apropos() on modules with empty docstrings.
bpo-22885 : Fixed arbitrary code execution vulnerability in the dbm.dumb module. Original patch by Claudiu Popa.
bpo-23239 : ssl.match_hostname() now supports matching of IP addresses.
bpo-23146 : Fix mishandling of absolute Windows paths with forward slashes in pathlib.
bpo-23096 : Pickle representation of floats with protocol 0 now is the same for both Python and C implementations.
bpo-19105 : pprint now more efficiently uses free space at the right.
bpo-14910 : Add allow_abbrev parameter to argparse.ArgumentParser. Patch by Jonathan Paugh, Steven Bethard, paul j3 and Daniel Eriksson.
bpo-21717 : tarfile.open() now supports ‘x’ (exclusive creation) mode.
bpo-23344 : marshal.dumps() is now 20-25% faster on average.
bpo-20416 : marshal.dumps() with protocols 3 and 4 is now 40-50% faster on average.
bpo-23421 : Fixed compression in tarfile CLI. Patch by wdv4758h.
bpo-23367 : Fix possible overflows in the unicodedata module.
bpo-23361 : Fix possible overflow in Windows subprocess creation code.
logging.handlers.QueueListener now takes a respect_handler_level keyword argument which, if set to True, will pass messages to handlers taking handler levels into account.
bpo-19705 : turtledemo now has a visual sorting algorithm demo. Original patch from Jason Yeo.
bpo-23801 : Fix issue where cgi.FieldStorage did not always ignore the entire preamble to a multipart body.
Release date: 2015-02-08
PyObject_IsInstance
and
PyObject_IsSubclass
在
common case that the second argument has metaclass
type
.
PyErr_FormatV
function, similar to
PyErr_Format
but accepting a
va_list
自变量。
ioctl(FIOCLEX)
, but calling it fails
with errno is ENOTTY: “Inappropriate ioctl for device”. set_inheritable()
now falls back to the slower
fcntl()
(
F_GETFD
and then
F_SETFD
).
__qualname__
attribute to generator, the
qualified name, and use it in the representation of a generator
(
repr(gen)
). The default name of the generator (
__name__
attribute) is now get from the function instead of the code. Use
gen.gi_code.co_name
获取代码的名称。
else
keyword (e.g.
True if
42else
False
) to be valid syntax.
\x00
to be used as a fill character when using str,
int, float, and complex __format__ methods.
email.feedparser.FeedParser
now handles (malformed)
headers with no key rather than assuming the body has started.
json.dumps(..., ensure_ascii=False)
as fast as the
default case of
ensure_ascii=True
. Patch by Naoki Inada.
sys.is_finalizing()
to know about
interpreter shutdown.
--sort-keys
option to json.tool CLI.
errors
attribute on TestLoader
exposes these non-fatal errors encountered during discovery.
-j
option to enable parallel building of extension modules.
bufsize=1
in subprocess.Popen() selects line
buffering, rather than block buffering. Patch by Akira Li.
**
模式。
pattern
is added and documented. Patch given by Robert
Collins, tweaked by Barry Warsaw.
threading.Lock.acquire()
,
threading.RLock.acquire()
and socket
operations now use a monotonic clock, instead of the system clock, when a
timeout is used.
Pathlib.mkdir()
to mimic
mkdir -p
and
os.makedirs()
functionality. When true, ignore
FileExistsErrors. Patch by Berker Peksag.
"\033[1034h"
into stdout. This
sequence is used on some terminal (ex: TERM=xterm-256color”) to enable
support of 8 bit characters.
fstat()
故障。
Py_ssize_t()
type instead of
int
for the size to support reading more than 2 GB at once. On
Windows, the size is truncted to INT_MAX. As any call to os.read(), the OS
may read less bytes than the number of requested bytes.
None
is passed
作为
REG_BINARY
value to SetValueEx. Patch by John Ehresman.
st_file_attributes
field to os.stat_result on
Windows.
numpy.str_
).
unsafe
to Mock. It raises
AttributeError
incase of an attribute startswith assert or assret.
Host:
header and reconnection when using
http.client.HTTPConnection.set_tunnel(). Patch by Nikolaus Rath.
tempfile.NamedTemporaryFile()
, close the file descriptor if
io.open()
fails
assertRaisesRegex
and
assertWarnsRegex
现在引发
TypeError if the second argument is not a string or compiled regex.
LC_TYPE
locale is the POSIX locale (
C
locale),
sys.stdin
and
sys.stdout
are now using the
surrogateescape
error handler, instead of the
strict
error
handler.
email.message.Message.attach
now returns a more useful
error message if
attach
is called on a message for which
is_multipart
为 False。
PCbuild\build_ssl.py
script has been re-written and re-named to
PCbuild\prepare_ssl.py
, and takes care of configuring OpenSSL source
for both 32 and 64 bit platforms. OpenSSL sources obtained from
svn.python.org will always be pre-configured and ready to build.
_Py_char2wchar()
to
Py_DecodeLocale()
,
rename
_Py_wchar2char()
to
Py_EncodeLocale()
, and document
these functions.
calloc()
而不是
malloc()
for large objects which is faster and
use less memory.
make venv PYTHON=../python
to
create a venv for generating the documentation, e.g.,
make html
PYTHON=venv/bin/python3
.
Doc/make.bat
script to make
it much more comparable to
Doc/Makefile
.
load_package_tests
function to test.support and used
it to implement/augment test discovery in test_asyncio, test_email,
test_importlib, test_json, and test_tools.
yield from
to 2to3.
PCbuild\..\externals
而不是
PCbuild\..\..
.
Release date: 2014-03-16
Release date: 2014-03-09
pip
command in addition to the versioned
pip3
and
pip3.4
命令。
Release date: 2014-02-23
Release date: 2014-02-10
Release date: 2014-01-26
Release date: 2014-01-05
Release date: 2013-11-24
inet_ntop
and
inet_pton
to
socket module. Patch by Atsuo Ishimoto.
package_data
are no longer added to the
filelist, preventing failure outlined in the ticket.
ssl.match_hostname()
to follow RFC 6125,
for security reasons. It now doesn’t match multiple wildcards nor
wildcards inside IDN fragments.
Release date: 2013-10-20
PyThreadState.tick_counter
field
contextlib.ignore
context manager to
contextlib.suppress
in order to be more consistent with existing
descriptions of that operation elsewhere in the language and standard
library documentation (Patch by Zero Piraeus).
tarfile
.
codecs.encode
and
codecs.decode
.
'\u'
and
'\U'
in native strings.
inspect.getmembers
and
inspect.classify_class_attrs
to attempt activating descriptors before falling back to a __dict__ search
for faulty descriptors.
inspect.classify_class_attrs
no longer returns
Attributes whose home class is None.
char*
arguments now changed to
const char*
.
Py_SetStandardStreamEncoding
pre-initialization API
to allow embedding applications like Blender to force a particular
encoding and error handler for the standard IO streams (initial patch by
Bastien Montagne)
pdb.find_function()
.
Release date: 2013-09-29
inspect.classify_class_attrs()
now correctly finds class
attributes returned by
dir()
that are located in the metaclass.
urllib.request.Request
now allows the method to be
indicated on the class and no longer sets it to None in
__init__
.
PYTHONFAULTHANDLER
environment variable now only enables the
faulthandler module if the variable is non-empty. Same behaviour than
other variables like
PYTHONDONTWRITEBYTECODE
.
traceback.clear_frames
will clear the local
variables of all the stack frames referenced by a traceback object.
Release date: 2013-09-09
signal.set_wakeup_fd()
, report an exception instead of
ignoring the error.
readline.__doc__
being
None
in the new
readline activation code in
site.py
.
pyvenv
now takes a –copies argument allowing copies
instead of symlinks even where symlinks are available and the default.
python -m dis
now uses argparse for argument processing.
Patch by Michele Orrù.
rfc822Name
(email),
dNSName
(DNS) and
uniformResourceIdentifier
(URI).
textwrap.shorten()
to collapse and truncate a piece
of text to a given length.
Release date: 2013-08-03
from ... import ...
.
python --version
now prints version string to stdout, and not
to stderr. Patch by Berker Peksag and Michael Dickens.
struct
timespec
‘s “tv_nsec” member is not a C long.
-X showrefcount
选项。
\x
escape now raise a
SyntaxError and a full traceback including line number.
collections.Chainmap.new_child
to allow
the new child map to be specified explicitly.
fromkeys
on a dict subclass
received a nonempty dict from the constructor.
Py_uintptr_t
而不是
size_t
. Patch by Serhiy
Storchaka.
AT_FDCWD
as (int). Required on Solaris 10
(which defines
AT_FDCWD
as
0xffd19553
), harmless on other platforms.
super()
to RuntimeErrors.
ast.parse()
in an
exception handler on code with syntax errors.
\r\n
appears at end of 65535 bytes without other newlines.
struct.iter_unpack
allows for streaming struct
unpacking.
subprocess.check_output
now accepts an
input
自变量,
allowing the subprocess’s stdin to be provided as a (byte) string. Patch
by Zack Weinberg.
uri
parameter to pass the
filename as a URI, allowing custom options to be passed.
self
.
--enable-shared
) now
fills the
os.environ
variable correctly.
unittest.installHandler
no longer assumes SIGINT handler is
set to a callable object.
\A
,
\Z
,和
\B
now correctly match the A, Z, and B
literals when used inside character classes (e.g.
'[\A]'
). Patch by
Matthew Barnett.
SSLContext.set_servername_callback()
method. Patch by Daniel Black.
parser.popitem()
no longer raises
ValueError. This makes
parser.clean()
work correctly.
parser['section'] = {}
now preserves
section order within the parser. This makes
parser.update()
preserve
section order as well.
parser['DEFAULT'] = {}
now correctly
clears previous values stored in the default section. Same goes for
parser.update({'DEFAULT': {}})
.
with
statement. Patch by
Serhiy Storchaka.
sys.getallocatedblocks()
返回
number of memory blocks currently allocated.
.nfs*
files instead of choking later
on. Initial patch by SilentGhost and Jeff Ramnani.
data:
URLs. Patch by
Mathias Panzenböck.
weakref.WeakMethod
to simulate weak
references to bound methods.
file://
urls.
Connection: close
header in its
responses.
lzma.LZMAFile
(see also
bpo-16034
).
bz2.BZ2File
implementation. Initial patch by Serhiy Storchaka.
pty.spawn()
now returns the child process status returned by
os.waitpid()
.
subprocess.poll()
now properly handles
errno.ECHILD
to
return a returncode of 0 when the child has already exited or cannot be
waited on.
Mock.assert_called_once_with()
.
unittest -m
claims executable is “python”, not “python3”.
TextTestResult.__init__()
super call.
csv.Reader
parsing issue with ending quote characters.
Patch by Serhiy Storchaka.
Calendar.itermonthdates()
after
datetime.MAXYEAR
. Patch by Cédric Krier.
xml.etree.ElementTree
now serializes correctly the empty HTML
elements ‘meta’ and ‘param’.
SocketIO.{readable,writable,seekable}
methods now raise
ValueError when the file-like object is closed. Patch by Alessandro
Moura.
curses
module: window.encoding.
atexit
hook in
multiprocessing
. Original patch by
Chris McDonough.
io.BytesIO
and
io.StringIO
objects now raise ValueError when the
object has been closed. Patch by Alessandro Moura.
subprocess.DEVNULL
in webbrowser, instead of opening
os.devnull
explicitly and leaving it open.
webbrowser.UnixBrowser
no longer passes empty arguments to
Popen when
%action
substitutions produce empty strings.
argparse
type function (specified by add_argument) only
once. Before, the type function was called twice in the case where the
default was specified and the argument was given as well. This was
especially problematic for the FileType type, as a default file would
always be opened, even if a file argument was specified on the command
line. (See also:
bpo-11839
)
action='append'
,
type='str'
and
default=[]
.
hashlib
module has four additional hash algorithms:
sha3_224
,
sha3_256
,
sha3_384
and
sha3_512
. As part of the patch some common
code was moved from _hashopenssl.c to hashlib.h.
__main__.py
and
regrtest.py
in
Lib/test
.
-R
option to regrtest now also checks for memory
allocation leaks, using
sys.getallocatedblocks()
.
os.getgrouplist()
test by not assuming that it gives
the same output as
id -G
.
os.chdir()
fails inside
test.support.temp_cwd()
. Patch by Chris Jerdonek.
TestMaildir.test_create_tmp()
. Patch by
Serhiy Storchaka.
asdl_c.py
that resulted in a TypeError
after 2801bf875a24 (see #15801).
char*
arguments of PyObject_CallFunction() and
PyObject_CallMethod() now changed to
const char*
. Based on patches by
Jörg Müller and Lars Buitinck.
hash()
can truncate the value returned from an
object’s custom
__hash__()
方法。
subprocess.Popen()
‘s cwd
自变量。
int()
‘s signature and
自变量。
argparse
docs, re: add_argument() type and
default arguments. Patch contributed by Chris Jerdonek.
(For information about older versions, consult the HISTORY file.)