Release date: 2018-12-23
.mjs
file extension with
application/javascript
MIME Type.
make profile-opt
no longer replaces
CFLAGS_NODIST
with
CFLAGS
. It now adds profile-guided optimization (PGO) flags to
CFLAGS_NODIST
: existing
CFLAGS_NODIST
flags are kept.
Py_FinalizeEx()
(new in 3.6) based on Py_LIMITED_API. Patch by Arthur Neufeld.
Release date: 2018-12-11
-I
command line option (run Python in isolated mode) is now also copied by the
multiprocessing
and
distutils
modules when spawning child processes. Previously, only
-E
and
-s
options (enabled by
-I
) were copied.
str.format()
,
float.__format__()
and
complex.__format__()
methods for non-ASCII decimal point when using the “n” formatter.
'\N'
. It would read one byte beyond the end of the memory allocation.
os
methods that path-like objects are also accepted as input parameters.
socket
: Fix off-by-one bug in length check for
AF_ALG
name and type.
bytes
and
bytearray
constructors no longer convert unexpected exceptions (e.g.
MemoryError
and
KeyboardInterrupt
) 到
TypeError
.
bytes()
当
list
argument is mutated while it is iterated.
Mock
instance was used to wrap an object, if
side_effect
is used in one of the mocks of it methods, don’t call the original implementation and return the result of using the side effect the same way that it is done with return_value.
posixpath.expanduser()
now returns the input
path
unchanged if the
HOME
environment variable is not set and the current user has no home directory (if the current user identifier doesn’t exist in the password database). This change fix the
site
module if the current user doesn’t exist in the password database (if the user has no home directory).
select.select()
where, in some cases, the file descriptor sequences were returned unmodified after a signal interruption, even though the file descriptors might not be ready yet.
select.select()
will now always return empty lists if a timeout has occurred. Patch by Oran Avraham.
os.utime()
on Windows when pass incorrect arguments.
ResourceWarning
in
platform.dist()
on SuSE and Caldera OpenLinux. Patch by Ville Skyttä.
locale.localeconv()
now sets temporarily the
LC_CTYPE
区域设置到
LC_MONETARY
locale if the two locales are different and monetary strings are non-ASCII. This temporary change affects other threads.
unittest.mock.call
objects and add note that tracking of parameters used to create ancestors of mocks in
mock_calls
is not possible.
_io.IncrementalNewlineDecoder
’s
translate
自变量。
socketserver.BaseServer.serve_forever()
now exits immediately if it’s
shutdown()
method is called while it is polling for new events.
ntpath.abspath
regression where it didn’t remove a trailing separator on Windows. Patch by Tim Graham.
__setstate__()
方法为
xml.etree.ElementTree.Element
in the C implementation for already initialized element.
execfile
fixer now opens the file with mode
'rb'
. Patch by Zackery Spytz.
pydoc
now supports aliases not only to methods defined in the end class, but also to inherited methods. The docstring is not duplicated for aliases.
find()
,
findtext()
and
findall()
的
Element
类在
xml.etree.ElementTree
module are now able to find children which are instances of
Element
子类。
TclError
in
tkinter.Spinbox.selection_element()
. Patch by Juliette Monsel.
unittest.TestCase.debug()
when used to call test methods with subtests. Patch by Bruno Oliveira.
max_num_fields
to
cgi.FieldStorage
to make DOS attacks harder by limiting the number of
MiniFieldStorage
objects created by
FieldStorage
.
distutils
will now include entries for directories.
reset_mock
on mock instances with deleted attributes
pwd.getpwnam
and
grp.getgrnam
using string representation because of invisible characters or trailing whitespaces. Patch by William Grzybowski.
sqlite3.Connection.create_aggregate()
,
sqlite3.Connection.create_function()
,
sqlite3.Connection.set_authorizer()
,
sqlite3.Connection.set_progress_handler()
methods raises TypeError when unhashable objects are passed as callable. These methods now don’t pass such objects to SQLite API. Previous behavior could lead to segfaults. Patch by Sergey Fedoseev.
datetime
,
date
and
time
pickled by Python 2.
encoding='latin1'
should be used for successful decoding.
typing.io
and
typing.re
. Their types should be imported from
typing
直接。
f_restricted
attribute in the frame object. Patch by Stéphane Wirtel
email.utils
to
email.utils.rst
.
getargspec
,
from_function
and
from_builtin
as deprecated in their respective docstring, and include version since deprecation in DeprecationWarning message.
mktime()
overflow error in
test_email
: run
test_localtime_daylight_true_dst_true()
and
test_localtime_daylight_false_dst_true()
with a specific timezone.
pyexpat
in
Modules/Setup
.
PyThread_start_new_thread()
: add a function wrapper to always return
NULL
.
make
profile-opt
.
CLOCK_GETTIME
et al. macros in
timemodule
在 macOS。
Release date: 2018-10-20
There were no new changes in version 3.6.7.
Release date: 2018-10-13
dict(od)
didn’t copy iteration order of OrderedDict.
digest()
and
hexdigest()
methods for the SHAKE algorithm in the
hashlib
模块。
sys.modules
when parsing
__text_signature__
of callable.
Executor.map()
and
as_completed()
, in order to prevent timeouts from deviating when the system clock is adjusted.
socket.CMSG_SPACE()
to calculate ancillary data size instead of
socket.CMSG_LEN()
in
multiprocessing.reduction.recvfds()
as
RFC 3542
requires the use of the former for portable applications.
hashlib
.
PyObject_Print()
始终返回
-1
on error. Patch by Zackery Spytz.
Release date: 2018-09-26
os.sendfile()
on macOS. Using the
trailers
argument could cause sending more bytes from the input file than was specified.
_PyObject_Free
/
_PyObject_Realloc
而不是
PyObject_Free
/
PyObject_Realloc
.
io.IOBase.close()
, ensure that the
closed
attribute is not set with a live exception. Patch by Zackery Spytz and Serhiy Storchaka.
open()
and entering a
with
block in
with open()
.
PyRun_SimpleFileExFlags()
before calling
PyErr_Print()
. Patch by Zackery Spytz.
PyEval_EvalCode()
.
type_getattro()
if a descriptor deletes itself from the class. Patch by Jeroen Demeyer.
tell()
方法为
io.TextIOWrapper
. Patch by Zackery Spytz.
os.lchmod()
is never defined on Linux.
multiprocessing.managers.DictProxy
.
pwd.getpwnam
and
grp.getgrnam
. Patch by William Grzybowski.
distutils.spawn.find_executable()
now falls back on
os.defpath
若
PATH
environment variable is not set.
zipfile
. Previously an optional signature was not being written and certain ZIP applications were not supported. Patch by Silas Sewell.
imaplib.IMAP4
and
imaplib.IMAP4_SSL
classes now resolve to the local host IP correctly when the default value of
host
parameter (
''
) is used.
smtplib.SMTP.send_message()
no longer modifies the content of the
mail_options
argument. Patch by Pablo S. Blum de Aguiar.
ntpath.abspath
for invalid paths on windows. Patch by Franz Woellert.
sqlite3
when a DML statement appeared in a different line than the rest of the SQL query.
Helper.showtopic()
method now prints the cross references of a topic correctly.
base64.b32decode()
could raise UnboundLocalError or OverflowError for incorrect padding. Now it always raises
base64.Error
in these cases.
time.monotonic()
instead of the system clock
time.time()
to implement timeout.
webbrowser
module. Patch by Bumsik Kim.
"
,
\
,
{
,
}
and
\n
as options to
ttk
widgets.
os.readv()
and
os.writev()
和在
os.sendfile()
with
headers
or
trailers
arguments (on BSD-based OSes and macOS).
platform.libc_ver()
. It almost always returned version ‘2.9’ for glibc.
http.client
. Patch by Marco Strigl.
imaplib
now allows
MOVE
command in
IMAP4.uid()
(RFC 6851: IMAP MOVE Extension) and potentially as a name of supported method of
IMAP4
对象。
TypeError
instead of crashing if a
collections.deque
subclass returns a non-deque from
__new__
. Patch by Oren Milman.
AF_PACKET
在
socket
模块。
errno
values in the tests.
regrtest
that caused an extra test to run if –huntrleaks/-R was used. Exit with error in case that invalid parameters are specified to –huntrleaks/-R (at least one warmup run and one repetition must be used).
SMTPUTF8SimTests
class of tests gets run in test_smtplib.py.
datetime.fromtimestamp()
erronously throws an
OSError
on Windows for values between 0 and 86400. Patch by Ammar Askar.
_scproxy
, drop the GIL when calling into
SystemConfiguration
to avoid deadlocks.
UnicodeDecodeError
exceptions when calling
string()
.
SystemError
in
PyArg_ParseTupleAndKeywords()
当
w*
format unit is used for optional parameter.
Release date: 2018-06-27
There were no new changes in version 3.6.6.
Release date: 2018-06-11
__del__
method or referenced by it into the
gc.garbage
列表。
PyGC_Collect()
can now be called when an exception is set and preserves it.
normalizestring()
.
__aenter__()
or
__aexit__()
return non-awaitable object.
ma_version_tag
in dict implementation is uninitialized when copying from key-sharing dict.
async for
循环。
ctypes.cast()
in case the type argument is a ctypes structured data type. Patch by Eryk Sun and Oren Milman.
+
) and repetition (
*
) sequence operations now raise
TypeError
而不是
SystemError
when performed on
mmap.mmap
objects. Patch by Zackery Spytz.
uuid.get_node
from using a DUID instead of a MAC on Windows. Patch by Zvi Effron
ReadTransport.resume_reading
in Windows proactor event loop.
NamedTuple.__new__
, pass
*args
and
**kwds
in
Generic.__new__
. Original PRs by Paulius Šarka and Chad Dombrova.
dbm.ndbm
database object when it is called with a single argument.
Comment
attribute of
http.cookies.SimpleCookie
.
parser
module when converting an ST object to a tree of tuples or lists with
line_info=False
and
col_info=True
.
_SelectorSocketTransport
Patch by Vlad Starostin.
<module>
call in the html produced by
cgitb.html()
. Patch by Stéphane Blondon.
random.Random.choice()
现在引发
IndexError
for empty sequences consistently even when called from subclasses without a
getrandbits()
实现。
pickle.Pickler.dump()
.
__str__
representation now includes wildcard entries and the “Crawl-delay” and “Request-rate” fields. Patch by Michael Lazar.
ipaddress
that result of
hosts()
is empty when the network is constructed by a tuple containing an integer mask and only 1 bit left for addresses.
trace
module command-line tool. Previously emitted cover files only when
--missing
option was used. Patch by Michael Selik.
process()
methods are no longer omitted.
ctypes
. Patch by Segev Finer.
typing.AsyncContextManager
.
__path__
attribute on modules cannot be just any value.
Py_UNICODE
usage in
c-api/arg
文档。
Py_UNICODE
related APIs are deprecated since Python 3.3, but it is missed in the document.
islice()
recipe to consume initial values up to the start index.
zipapp
documentation to describe how to make standalone applications.
WindowsRegistryFinder
实现
MetaPathFinder
. (Patch by Himanshu Lakhara)
-Wstrict-prototypes
选项到
CFLAGS_NODIST
from
OPT
. This option emitted annoying warnings when building extension modules written in C++.
-Wno-cast-function-type
for gcc 8 for silencing warnings about function casts like casting to PyCFunction in method definition lists.
pygettext
script. Based on patch by Oleg Krasnikov.
-n
标志为
Tools/scripts/pathfix.py
to disable automatic backup creation (files with
~
后缀)。
Release date: 2018-03-28
Release date: 2018-03-13
Py_ADDRESS_IN_RANG
to
address_in_range
.
__debug__
constant is now optimized out at compile time. This fixes also
bpo-22091
.
sys.flags.hash_randomization
is now properly set to 0 when hash randomization is turned off by
PYTHONHASHSEED=0
.
repr()
on a dict containing its own
values()
or
items()
no longer raises
RecursionError
; OrderedDict similarly. Instead, use
...
, as for other recursive structures. Patch by Ben North.
bpo-33064
: lib2to3 now properly supports trailing commas after
*args
and
**kwargs
in function signatures.
bpo-31804 : Avoid failing in multiprocessing.Process if the standard streams are closed or None at exit.
bpo-33037 : Skip sending/receiving data after SSL transport closing.
bpo-30353 : Fix ctypes pass-by-value for structs on 64-bit Cygwin/MinGW.
bpo-33009 : Fix inspect.signature() for single-parameter partialmethods.
bpo-32969 : Expose several missing constants in zlib and fix corresponding documentation.
bpo-32713 : Fixed tarfile.itn handling of out-of-bounds float values. Patch by Joffrey Fuhrer.
bpo-30622 : The ssl module now detects missing NPN support in LibreSSL.
bpo-32922 : dbm.open() now encodes filename with the filesystem encoding rather than default encoding.
bpo-32859
: In
os.dup2
, don’t check every call whether the
dup3
syscall exists or not.
bpo-21060 : Rewrite confusing message from setup.py upload from “No dist file created in earlier command” to the more helpful “Must create and upload files in one command”.
bpo-32857
: In
tkinter
,
after_cancel(None)
now raises a
ValueError
instead of canceling the first scheduled function. Patch by Cheryl Sabella.
bpo-32852 : Make sure sys.argv remains as a list when running trace.
bpo-32841
: Fixed
asyncio.Condition
issue which silently ignored cancellation after notifying and cancelling a conditional lock. Patch by Bar Harel.
bpo-31787
: Fixed refleaks of
__init__()
methods in various modules. (Contributed by Oren Milman)
bpo-30157 : Fixed guessing quote and delimiter in csv.Sniffer.sniff() when only the last field is quoted. Patch by Jake Davis.
bpo-32394 : socket: Remove TCP_FASTOPEN, TCP_KEEPCNT flags on older version Windows during run-time.
bpo-32777 : Fix a rare but potential pre-exec child process deadlock in subprocess on POSIX systems when marking file descriptors inheritable on exec in the child process. This bug appears to have been introduced in 3.4.
bpo-32647 : The ctypes module used to depend on indirect linking for dlopen. The shared extension is now explicitly linked against libdl on platforms with dl.
bpo-32734
: Fixed
asyncio.Lock()
safety issue which allowed acquiring and locking the same lock multiple times, without it being free. Patch by Bar Harel.
bpo-32727 : Do not include name field in SMTP envelope from address. Patch by Stéphane Wirtel
bpo-27931 : Fix email address header parsing error when the username is an empty quoted string. Patch by Xiang Zhang.
bpo-32304 : distutils’ upload command no longer corrupts tar files ending with a CR byte, and no longer tries to convert CR to CRLF in any of the upload text fields.
bpo-32502 : uuid.uuid1 no longer raises an exception if a 64-bit hardware address is encountered.
bpo-31848 : Fix the error handling in Aifc_read.initfp() when the SSND chunk is not found. Patch by Zackery Spytz.
bpo-32555 : On FreeBSD and Solaris, os.strerror() now always decode the byte string from the current locale encoding, rather than using ASCII/surrogateescape in some cases.
bpo-32521 : The nis module is now compatible with new libnsl and headers location.
bpo-32473 : Improve ABCMeta._dump_registry() output readability
bpo-32521 : glibc has removed Sun RPC. Use replacement libtirpc headers and library in nis module.
bpo-32228
: Ensure that
truncate()
preserves the file position (as reported by
tell()
) after writes longer than the buffer size.
bpo-26133 : Don’t unsubscribe signals in asyncio UNIX event loop on interpreter shutdown.
bpo-32185 : The SSL module no longer sends IP addresses in SNI TLS extension on platforms with OpenSSL 1.0.2+ or inet_pton.
bpo-32323
:
urllib.parse.urlsplit()
does not convert zone-id (scope) to lower case for scoped IPv6 addresses in hostnames now.
bpo-32302 : Fix bdist_wininst of distutils for CRT v142: it binary compatible with CRT v140.
bpo-32255 : A single empty field is now always quoted when written into a CSV file. This allows to distinguish an empty row from a row consisting of a single empty field. Patch by Licht Takeuchi.
bpo-32277
: Raise
NotImplementedError
而不是
SystemError
on platforms where
chmod(..., follow_symlinks=False)
is not supported. Patch by Anthony Sottile.
bpo-32199 : The getnode() ip getter now uses ‘ip link’ instead of ‘ip link list’.
bpo-27456 : Ensure TCP_NODELAY is set on Linux. Tests by Victor Stinner.
bpo-31900
:
locale.localeconv()
function now sets temporarily the
LC_CTYPE
区域设置到
LC_NUMERIC
区域设置以解码
decimal_point
and
thousands_sep
byte strings if they are non-ASCII or longer than 1 byte, and the
LC_NUMERIC
locale is different than the
LC_CTYPE
locale. This temporary change affects other threads.
Same change for the
str.format()
method when formatting a number (
int
,
float
,
float
及子类) 采用
n
类型 (范例:
'{:n}'.format(1234)
).
bpo-31802
: Importing native path module (
posixpath
,
ntpath
) now works even if the
os
module still is not imported.
__getattr__()
behavior when property
get()
方法引发
AttributeError
.
DeprecationWarning
and add text to REGEX HOWTO to highlight the deprecation.
pathlib.PurePath
子类。
test_asyncio
on macOS 10.12.2+ due to transport of
KqueueSelector
loop was not being closed.
os.readlink()
on Windows, which was mistakenly treating the
PrintNameOffset
field of the reparse data buffer as a number of characters instead of bytes. Patch by Craig Holmquist and SSE4.
__file__
while running a startup file. Like Python, IDLE optionally runs one startup file in the Shell window before presenting the first interactive input prompt. For IDLE,
-s
runs a file named in environmental variable
IDLESTARTUP
or
PYTHONSTARTUP
;
-r file
runs
file
. Python sets
__file__
to the startup file name before running the file and unsets it before the first prompt. IDLE now does the same when run normally, without the
-n
选项。
str
to
code
in pyparse.
Release date: 2017-12-18
There were no new code changes in version 3.6.4 since v3.6.4rc1.
Release date: 2017-12-05
__import__()
或
__all__
attribute of the module contain bytes instances.
unicodedata.normalize()
. Patch by Oren Milman.
TypeError
with a helpful error message when class creation fails due to a metaclass with a bad
__prepare__()
method. Patch by Oren Milman.
_warnings.warn()
in case of a bad
__name__
global. Patch by Oren Milman.
json
, in case
_json.make_encoder()
received a bad
encoder()
argument. Patch by Oren Milman.
__name__
attribute, and in case of failing to access an attribute of such a module. Patch by Oren Milman.
ctypes
class definition, in case the class has an attribute whose name is specified in
_anonymous_
but not in
_fields_
. Patch by Oren Milman.
_random.Random.seed()
in case the argument has a bad
__abs__()
method. Patch by Oren Milman.
__setstate__()
方法为
ctypes._CData
, in case of a bad
__dict__
. Patch by Oren Milman.
warnings.warn_explicit
, when the return value of the received loader’s get_source() has a bad splitlines() method. Patch by Oren Milman.
PyErr_PrintEx()
clears now the ignored exception that may be raised by
_PySys_SetObjectId()
, for example when no memory.
bpo-28556
: Two minor fixes for
typing
module: allow shallow copying instances of generic classes, improve interaction of
__init_subclass__
with generics. Original PRs by Ivan Levkivskyi.
bpo-27240 : The header folding algorithm for the new email policies has been rewritten, which also fixes bpo-30788 , bpo-31831 ,和 bpo-32182 . In particular, RFC2231 folding is now done correctly.
bpo-32186 : io.FileIO.readall() and io.FileIO.read() now release the GIL when getting the file size. Fixed hang of all threads with inaccessible NFS server. Patch by Nir Soffer.
bpo-12239
: Make
msilib.SummaryInformation.GetProperty()
return
None
when the value of property is
VT_EMPTY
. Initial patch by Mark Mc Mahon.
bpo-31325
: Fix wrong usage of
collections.namedtuple()
在
RobotFileParser.parse()
方法。
Initial patch by Robin Wellner.
bpo-12382
:
msilib.OpenDatabase()
now raises a better exception message when it couldn’t open or create an MSI file. Initial patch by William Tisäter.
bpo-32110
:
codecs.StreamReader.read(n)
now returns not more than
n
characters/bytes for non-negative
n
. This makes it compatible with
read()
methods of other file-like objects.
bpo-32072 : Fixed issues with binary plists:
bpo-32034 : Make asyncio.IncompleteReadError and LimitOverrunError pickleable.
bpo-32015 : Fixed the looping of asyncio in the case of reconnection the socket during waiting async read/write from/to the socket.
bpo-32011 : Restored support of loading marshal files with the TYPE_INT64 code. These files can be produced in Python 2.7.
bpo-31970 : Reduce performance overhead of asyncio debug mode.
bpo-9678 : Fixed determining the MAC address in the uuid module:
Based on patch by Takayuki Shimizukawa.
bpo-30057 : Fix potential missed signal in signal.signal().
bpo-31933 : Fix Blake2 params leaf_size and node_offset on big endian platforms. Patch by Jack O’Connor.
bpo-31927 : Fixed compilation of the socket module on NetBSD 8. Fixed assertion failure or reading arbitrary data when parse a AF_BLUETOOTH address on NetBSD and DragonFly BSD.
bpo-27666 : Fixed stack corruption in curses.box() and curses.ungetmouse() when the size of types chtype or mmask_t is less than the size of C long. curses.box() now accepts characters as arguments. Based on patch by Steve Fink.
bpo-31897 : plistlib now catches more errors when read binary plists and raises InvalidFileException instead of unexpected exceptions.
bpo-25720 : Fix the method for checking pad state of curses WINDOW. Patch by Masayuki Yamamoto.
bpo-31893 : Fixed the layout of the kqueue_event structure on OpenBSD and NetBSD. Fixed the comparison of the kqueue_event objects.
bpo-31891 : Fixed building the curses module on NetBSD.
bpo-28416 : Instances of pickle.Pickler subclass with the persistent_id() method and pickle.Unpickler subclass with the persistent_load() method no longer create reference cycles.
bpo-28326 : Fix multiprocessing.Process when stdout and/or stderr is closed or None.
bpo-31457
: If nested log adapters are used, the inner
process()
methods are no longer omitted.
bpo-31457
:
manager
property on LoggerAdapter objects is now properly settable.
bpo-31806 : Fix timeout rounding in time.sleep(), threading.Lock.acquire() and socket.socket.settimeout() to round correctly negative timeouts between -1.0 and 0.0. The functions now block waiting for events as expected. Previously, the call was incorrectly non-blocking. Patch by Pablo Galindo.
bpo-28603 : traceback: Fix a TypeError that occurred during printing of exception tracebacks when either the current exception or an exception in its context/cause chain is unhashable. Patch by Zane Bitter.
bpo-30058 : Fixed buffer overflow in select.kqueue.control().
bpo-31770
: Prevent a crash when calling the
__init__()
方法对于
sqlite3.Cursor
object more than once. Patch by Oren Milman.
bpo-31672
:
idpattern
in
string.Template
matched some non-ASCII characters. Now it uses
-i
regular expression local flag to avoid non-ASCII characters.
bpo-31764
: Prevent a crash in
sqlite3.Cursor.close()
in case the
Cursor
object is uninitialized. Patch by Oren Milman.
bpo-31752 : Fix possible crash in timedelta constructor called with custom integers.
bpo-31701 : On Windows, faulthandler.enable() now ignores MSC and COM exceptions.
bpo-31728
: Prevent crashes in
_elementtree
due to unsafe cleanup of
Element.text
and
Element.tail
. Patch by Oren Milman.
bpo-31620 : an empty asyncio.Queue now doesn’t leak memory when queue.get pollers timeout
bpo-31632 : Fix method set_protocol() of class _SSLProtocolTransport in asyncio module. This method was previously modifying a wrong reference to the protocol.
bpo-31675 : Fixed memory leaks in Tkinter’s methods splitlist() and split() when pass a string larger than 2 GiB.
bpo-31673 : Fixed typo in the name of Tkinter’s method adderrorinfo().
bpo-30806 : Fix the string representation of a netrc object.
bpo-15037 : Added a workaround for getkey() in curses for ncurses 5.7 and earlier.
bpo-25351 : Avoid venv activate failures with undefined variables
bpo-25532 : inspect.unwrap() will now only try to unwrap an object sys.getrecursionlimit() times, to protect against objects which create a new object on every attribute access.
bpo-30347 : Stop crashes when concurrently iterate over itertools.groupby() iterators.
bpo-31516
:
threading.current_thread()
should not return a dummy thread at shutdown.
bpo-31351 : python -m ensurepip now exits with non-zero exit code if pip bootstrapping has failed.
bpo-31482
:
random.seed()
now works with bytes in version=1
bpo-31334
:修复
poll.poll([timeout])
在
select
module for arbitrary negative timeouts on all OSes where it can only be a non-negative integer or -1. Patch by Riccardo Coccioli.
bpo-31310 : multiprocessing’s semaphore tracker should be launched again if crashed.
bpo-31308 : Make multiprocessing’s forkserver process immune to Ctrl-C and other user interruptions. If it crashes, restart it when necessary.
get_history_length
in readline documentation example code. Patch by Brad Smith.
set_nomemory(start, stop)
and
remove_mem_hooks()
functions to the _testcapi module.
detect_modules()
in
setup.py
now also searches the sysroot paths when cross-compiling.
make regen-all
if nothing changed.
bpo-1102
: Return
None
当
View.Fetch()
返回
ERROR_NO_MORE_ITEMS
而不是引发
MSIError
.
Initial patch by Anthony Tuininga.
bpo-31944 : Fixes Modify button in Apps and Features dialog.
bpo-32207 : Improve tk event exception tracebacks in IDLE. When tk event handling is driven by IDLE’s run loop, a confusing and distracting queue.EMPTY traceback context is no longer added to tk event exception tracebacks. The traceback is now the same as when event handling is driven by user code. Patch based on a suggestion by Serhiy Storchaka.
bpo-32164 : Delete unused file idlelib/tabbedpages.py. Use of TabbedPageSet in configdialog was replaced by ttk.Notebook.
bpo-32100 : IDLE: Fix old and new bugs in pathbrowser; improve tests. Patch mostly by Cheryl Sabella.
bpo-31858 : IDLE – Restrict shell prompt manipulation to the shell. Editor and output windows only see an empty last prompt line. This simplifies the code and fixes a minor bug when newline is inserted. Sys.ps1, if present, is read on Shell start-up, but is not set or changed.
bpo-31860 : The font sample in the IDLE configuration dialog is now editable. Changes persist while IDLE remains open
bpo-31836 : Test_code_module now passes if run after test_idle, which sets ps1.
The code module uses sys.ps1 if present or sets it to ‘>>> ‘ if not. Test_code_module now properly tests both behaviors. Ditto for ps2.
bpo-28603 : Fix a TypeError that caused a shell restart when printing a traceback that includes an exception that is unhashable. Patch by Zane Bitter.
bpo-13802 : Use non-Latin characters in the IDLE’s Font settings sample. Even if one selects a font that defines a limited subset of the unicode Basic Multilingual Plane, tcl/tk will use other fonts that define a character. The expanded example give users of non-Latin characters a better idea of what they might see in IDLE’s shell and editors. To make room for the expanded sample, frames on the Font tab are re-arranged. The Font/Tabs help explains a bit about the additions.
bpo-31460 : Simplify the API of IDLE’s Module Browser.
Passing a widget instead of an flist with a root widget opens the option of creating a browser frame that is only part of a window. Passing a full file name instead of pieces assumed to come from a .py file opens the possibility of browsing python files that do not end in .py.
bpo-31649 : IDLE - Make _htest, _utest parameters keyword only.
bpo-31559 : Remove test order dependence in idle_test.test_browser.
bpo-31459 : Rename IDLE’s module browser from Class Browser to Module Browser. The original module-level class and method browser became a module browser, with the addition of module-level functions, years ago. Nested classes and functions were added yesterday. For back-compatibility, the virtual event <<open-class-browser>>, which appears on the Keys tab of the Settings dialog, is not changed. Patch by Cheryl Sabella.
bpo-31500 : Default fonts now are scaled on HiDPI displays.
bpo-1612262 : IDLE module browser now shows nested classes and functions. Original patches for code and tests by Guilherme Polo and Cheryl Sabella, respectively.
bpo-30722 : Make redemo work with Python 3.6 and newer versions.
Also, remove the
LOCALE
option since it doesn’t work with string patterns in Python 3.
Patch by Christoph Sarnowski.
PyExc_RecursionErrorInst
singleton is removed and
PyErr_NormalizeException()
does not use it anymore. This singleton is persistent and its members being never cleared may cause a segfault during finalization of the interpreter. See also
bpo-22898
.
Release date: 2017-10-03
concurrent.futures.as_completed()
. Fixes regression in 3.6.3rc1.
uploadrelease.bat
script. Fix Windows Doc build issues in
Doc/make.bat
.
Release date: 2017-09-18
bpo-31471
: Fix an assertion failure in
subprocess.Popen()
on Windows, in case the env argument has a bad keys() method. Patch by Oren Milman.
bpo-31418
: Fix an assertion failure in
PyErr_WriteUnraisable()
in case of an exception with a bad
__module__
attribute. Patch by Oren Milman.
bpo-31416 : Fix assertion failures in case of a bad warnings.filters or warnings.defaultaction. Patch by Oren Milman.
bpo-31411 : Raise a TypeError instead of SystemError in case warnings.onceregistry is not a dictionary. Patch by Oren Milman.
bpo-31373 : Fix several possible instances of undefined behavior due to floating-point demotions.
bpo-30465
: Location information (
lineno
and
col_offset
) in f-strings is now (mostly) correct. This fixes tools like flake8 from showing warnings on the wrong line (typically the first line of the file).
bpo-31343 : Include sys/sysmacros.h for major(), minor(), and makedev(). GNU C libray plans to remove the functions from sys/types.h.
bpo-31291
: Fix an assertion failure in
zipimport.zipimporter.get_data
on Windows, when the return value of
pathname.replace('/','\\')
isn’t a string. Patch by Oren Milman.
bpo-31271
: Fix an assertion failure in the write() method of
io.TextIOWrapper
, when the encoder doesn’t return a bytes object. Patch by Oren Milman.
bpo-31243
: Fix a crash in some methods of
io.TextIOWrapper
, when the decoder’s state is invalid. Patch by Oren Milman.
bpo-30721
:
print
now shows correct usage hint for using Python 2 redirection syntax. Patch by Sanyam Khurana.
bpo-31070 : Fix a race condition in importlib _get_module_lock().
bpo-31095
: Fix potential crash during GC caused by
tp_dealloc
which doesn’t call
PyObject_GC_UnTrack()
.
bpo-31071 : Avoid masking original TypeError in call with * unpacking when other arguments are passed.
bpo-30978 : str.format_map() now passes key lookup exceptions through. Previously any exception was replaced with a KeyError exception.
bpo-30808 : Use _Py_atomic API for concurrency-sensitive signal state.
bpo-30876 : Relative import from unloaded package now reimports the package instead of failing with SystemError. Relative import from non-package now fails with ImportError rather than SystemError.
bpo-30703 : Improve signal delivery.
Avoid using Py_AddPendingCall from signal handler, to avoid calling signal-unsafe functions. The tests I’m adding here fail without the rest of the patch, on Linux and OS X. This means our signal delivery logic had defects (some signals could be lost).
bpo-30765 : Avoid blocking in pthread_mutex_lock() when PyThread_acquire_lock() is asked not to block.
bpo-31161 : Make sure the ‘Missing parentheses’ syntax error message is only applied to SyntaxError, not to subclasses. Patch by Martijn Pieters.
bpo-30814 : Fixed a race condition when import a submodule from a package.
bpo-30597
:
print
now shows expected input in custom error message when used as a Python 2 statement. Patch by Sanyam Khurana.
bpo-31499 : xml.etree: Fix a crash when a parser is part of a reference cycle.
bpo-28556
: typing.get_type_hints now finds the right globalns for classes and modules by default (when no
globalns
was specified by the caller).
bpo-28556
: Speed improvements to the
typing
module. Original PRs by Ivan Levkivskyi and Mitar.
bpo-31544 : The C accelerator module of ElementTree ignored exceptions raised when looking up TreeBuilder target methods in XMLParser().
bpo-31234 : socket.create_connection() now fixes manually a reference cycle: clear the variable storing the last exception on success.
bpo-31457 : LoggerAdapter objects can now be nested.
bpo-31400 : Improves SSL error handling to avoid losing error numbers.
bpo-28958 : ssl.SSLContext() now uses OpenSSL error information when a context cannot be instantiated.
bpo-27340 : SSLSocket.sendall() now uses memoryview to create slices of data. This fixes support for all bytes-like object. It is also more efficient and avoids costly copies.
bpo-31178 : Fix string concatenation bug in rare error path in the subprocess module
bpo-31350
: Micro-optimize
asyncio._get_running_loop()
to become up to 10% faster.
bpo-31170 : expat: Update libexpat from 2.2.3 to 2.2.4. Fix copying of partial characters for UTF-8 input (libexpat bug 115): https://github.com/libexpat/libexpat/issues/115
bpo-29136 : Add TLS 1.3 cipher suites and OP_NO_TLSv1_3.
bpo-29212 : Fix concurrent.futures.thread.ThreadPoolExecutor threads to have a non repr() based thread name by default when no thread_name_prefix is supplied. They will now identify themselves as “ThreadPoolExecutor-y_n”.
bpo-9146 : Fix a segmentation fault in _hashopenssl when standard hash functions such as md5 are not available in the linked OpenSSL library. As in some special FIPS-140 build environments.
bpo-27144
:
map()
and
as_completed()
iterators in
concurrent.futures
now avoid keeping a reference to yielded objects.
bpo-10746 : Fix ctypes producing wrong PEP 3118 type codes for integer types.
bpo-22536 : The subprocess module now sets the filename when FileNotFoundError is raised on POSIX systems due to the executable or cwd not being found.
bpo-31249 : concurrent.futures: WorkItem.run() used by ThreadPoolExecutor now breaks a reference cycle between an exception object and the WorkItem object.
bpo-31247 : xmlrpc.server now explicitly breaks reference cycles when using sys.exc_info() in code handling exceptions.
bpo-30102 : The ssl and hashlib modules now call OPENSSL_add_all_algorithms_noconf() on OpenSSL < 1.1.0. The function detects CPU features and enables optimizations on some CPU architectures such as POWER8. Patch is based on research from Gustavo Serra Scalet.
bpo-31185 : Fixed miscellaneous errors in asyncio speedup module.
bpo-31135 : ttk: fix the destroy() method of LabeledScale and OptionMenu classes. Call the parent destroy() method even if the used attribute doesn’t exist. The LabeledScale.destroy() method now also explicitly clears label and scale attributes to help the garbage collector to destroy all widgets.
bpo-31107
:修复
copyreg._slotnames()
mangled attribute calculation for classes whose name begins with an underscore. Patch by Shane Harvey.
bpo-31061 : Fixed a crash when using asyncio and threads.
bpo-30502 : Fix handling of long oids in ssl. Based on patch by Christian Heimes.
bpo-30119 : ftplib.FTP.putline() now throws ValueError on commands that contains CR or LF. Patch by Dong-hee Na.
bpo-30595 : multiprocessing.Queue.get() with a timeout now polls its reader in non-blocking mode if it succeeded to acquire the lock but the acquire took longer than the timeout.
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-25684
: Change
ttk.OptionMenu
radiobuttons to be unique across instances of
OptionMenu
.
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-30319 : socket.close() now ignores ECONNRESET error.
bpo-30828
: Fix out of bounds write in
asyncio.CFuture.remove_done_callback()
.
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-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-31493 : IDLE code context – fix code update and font update timers.
Canceling timers prevents a warning message when test_idle completes.
bpo-31488 : IDLE - Update non-key options in former extension classes. When applying configdialog changes, call .reload for each feature class. Change ParenMatch so updated options affect existing instances attached to existing editor windows.
bpo-31477 : IDLE - Improve rstrip entry in doc. Strip trailing whitespace strips more than blank spaces. Multiline string literals are not skipped.
bpo-31480 : IDLE - make tests pass with zzdummy extension disabled by default.
bpo-31421 : Document how IDLE runs tkinter programs. IDLE calls tcl/tk update in the background in order to make live
interaction and experimentation with tkinter applications much easier.
bpo-31414 : IDLE – fix tk entry box tests by deleting first. Adding to an int entry is not the same as deleting and inserting because int(‘’) will fail.
bpo-31051 : Rearrange IDLE configdialog GenPage into Window, Editor, and Help sections.
bpo-30617 : IDLE - Add docstrings and tests for outwin subclass of editor.
Move some data and functions from the class to module level. Patch by Cheryl Sabella.
bpo-31287 : IDLE - Do not modify tkinter.message in test_configdialog.
bpo-27099 : Convert IDLE’s built-in ‘extensions’ to regular features.
About 10 IDLE features were implemented as supposedly optional extensions. Their different behavior could be confusing or worse for users and not good for maintenance. Hence the conversion.
The main difference for users is that user configurable key bindings for builtin features are now handled uniformly. Now, editing a binding in a keyset only affects its value in the keyset. All bindings are defined together in the system-specific default keysets in config-extensions.def. All custom keysets are saved as a whole in config-extension.cfg. All take effect as soon as one clicks Apply or Ok.
The affected events are ‘<<force-open-completions>>’, ‘<<expand-word>>’, ‘<<force-open-calltip>>’, ‘<<flash-paren>>’, ‘<<format-paragraph>>’, ‘<<run-module>>’, ‘<<check-module>>’, and ‘<<zoom-height>>’. Any (global) customizations made before 3.6.3 will not affect their keyset-specific customization after 3.6.3. and vice versa.
Inital patch by Charles Wohlganger.
bpo-31206 : IDLE: Factor HighPage(Frame) class from ConfigDialog. Patch by Cheryl Sabella.
bpo-31001 : Add tests for configdialog highlight tab. Patch by Cheryl Sabella.
bpo-31205 : IDLE: Factor KeysPage(Frame) class from ConfigDialog. The slightly modified tests continue to pass. Patch by Cheryl Sabella.
bpo-31130 : IDLE – stop leaks in test_configdialog. Initial patch by Victor Stinner.
bpo-31002 : Add tests for configdialog keys tab. Patch by Cheryl Sabella.
bpo-19903
: IDLE: Calltips use
inspect.signature
而不是
inspect.getfullargspec
. This improves calltips for builtins converted to use Argument Clinic. Patch by Louie Lu.
bpo-31083 : IDLE - Add an outline of a TabPage class in configdialog. Update existing classes to match outline. Initial patch by Cheryl Sabella.
bpo-31050 : Factor GenPage(Frame) class from ConfigDialog. The slightly modified tests continue to pass. Patch by Cheryl Sabella.
bpo-31004 : IDLE - Factor FontPage(Frame) class from ConfigDialog.
Slightly modified tests continue to pass. Fix General tests. Patch mostly by Cheryl Sabella.
bpo-30781 : IDLE - Use ttk widgets in ConfigDialog. Patches by Terry Jan Reedy and Cheryl Sabella.
bpo-31060 : IDLE - Finish rearranging methods of ConfigDialog Grouping methods pertaining to each tab and the buttons will aid writing tests and improving the tabs and will enable splitting the groups into classes.
bpo-30853 : IDLE – Factor a VarTrace class out of ConfigDialog.
Instance tracers manages pairs consisting of a tk variable and a callback function. When tracing is turned on, setting the variable calls the function. Test coverage for the new class is 100%.
bpo-31003 : IDLE: Add more tests for General tab.
bpo-30993 : IDLE - Improve configdialog font page and tests.
In configdialog: Document causal pathways in create_font_tab docstring. Simplify some attribute names. Move set_samples calls to var_changed_font (idea from Cheryl Sabella). Move related functions to positions after the create widgets function.
In test_configdialog: Fix test_font_set so not order dependent. Fix renamed test_indent_scale so it tests the widget. Adjust tests for movement of set_samples call. Add tests for load functions. Put all font tests in one class and tab indent tests in another. Except for two lines, these tests completely cover the related functions.
bpo-30981 : IDLE – Add more configdialog font page tests.
bpo-28523 : IDLE: replace ‘colour’ with ‘color’ in configdialog.
bpo-30917 : Add tests for idlelib.config.IdleConf. Increase coverage from 46% to 96%. Patch by Louie Lu.
bpo-30934 : Document coverage details for idlelib tests.
bpo-30913 : IDLE: Document ConfigDialog tk Vars, methods, and widgets in docstrings This will facilitate improving the dialog and splitting up the class. Original patch by Cheryl Sabella.
bpo-30899 : IDLE: Add tests for ConfigParser subclasses in config. Patch by Louie Lu.
bpo-30881 : IDLE: Add docstrings to browser.py. Patch by Cheryl Sabella.
bpo-30851 : IDLE: Remove unused variables in configdialog. One is a duplicate, one is set but cannot be altered by users. Patch by Cheryl Sabella.
bpo-30870 : IDLE: In Settings dialog, select font with Up, Down keys as well as mouse. Initial patch by Louie Lu.
bpo-8231 : IDLE: call config.IdleConf.GetUserCfgDir only once.
bpo-30779 : IDLE: Factor ConfigChanges class from configdialog, put in config; test. * In config, put dump test code in a function; run it and unittest in ‘if __name__ == ‘__main__’. * Add class config.ConfigChanges based on changes_class_v4.py on bpo issue. * Add class test_config.ChangesTest, partly using configdialog_tests_v1.py. * Revise configdialog to use ConfigChanges; see tracker msg297804. * Revise test_configdialog to match configdialog changes. * Remove configdialog functions unused or moved to ConfigChanges. Cheryl Sabella contributed parts of the patch.
bpo-30777 : IDLE: configdialog - Add docstrings and fix comments. Patch by Cheryl Sabella.
bpo-30495 : IDLE: Improve textview with docstrings, PEP8 names, and more tests. Patch by Cheryl Sabella.
bpo-30723 : IDLE: Make several improvements to parenmatch. Add ‘parens’ style to highlight both opener and closer. Make ‘default’ style, which is not default, a synonym for ‘opener’. Make time-delay work the same with all styles. Add help for config dialog extensions tab, including help for parenmatch. Add new tests. Original patch by Charles Wohlganger.
bpo-30674 : IDLE: add docstrings to grep module. Patch by Cheryl Sabella
bpo-21519 : IDLE’s basic custom key entry dialog now detects duplicates properly. Original patch by Saimadhav Heblikar.
bpo-29910
: IDLE no longer deletes a character after commenting out a region by a key shortcut. Add
return 'break'
for this and other potential conflicts between IDLE and default key bindings.
bpo-30728
: Review and change idlelib.configdialog names. Lowercase method and attribute names. Replace ‘colour’ with ‘color’, expand overly cryptic names, delete unneeded underscores. Replace
import *
with specific imports. Patches by Cheryl Sabella.
bpo-6739 : IDLE: Verify user-entered key sequences by trying to bind them with tk. Add tests for all 3 validation functions. Original patch by G Polo. Tests added by Cheryl Sabella.
Release date: 2017-07-17
No changes since release candidate 2
Release date: 2017-07-07
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 authentication (
login@host
).
Release date: 2017-06-17
bool(range)
works even if
len(range)
引发
OverflowError
.
rb'...'
and
f'...'
strings.
**kwargs
, allowing abstract base classes to use keyword parameters in __init_subclass__. Patch by Nate Soares.
Task.cancel()
can be ignored when the task is running coroutine and the coroutine returned without any more
await
.
'(?i)(?s)...'
). In verbose mode whitespaces and comments now are allowed before and between inline modifiers (e.g.
'(?x)
(?i) (?s)...'
).
--with-assertions
configure flag to explicitly enable C
assert()
checks. Defaults to off.
--with-pydebug
隐含
--with-assertions
.
--with--dtrace
.
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.
bpo-30176 : Add missing attribute related constants in curses documentation.
bpo-30052
: the link targets for
bytes()
and
bytearray()
are now their respective type definitions, rather than the corresponding builtin function entries. Use
bytes
and
bytearray
to reference the latter.
In order to ensure this and future cross-reference updates are applied automatically, the daily documentation builds now disable the default output caching features in Sphinx.
bpo-26985 : Add missing info of code object in inspect documentation.
method-wrapper
(
wrapperobject
) 对象。
py -3.6
), NuGet is used to download a copy of 32-bit Python.
Release date: 2017-03-21
sys.path[0]
initialization change for
bpo-29139
caused a regression by revealing an inconsistency in how sys.path is initialized when executing
__main__
from a zipfile, directory, or other import location. The interpreter now consistently avoids ever adding the import location’s parent directory to
sys.path
, and ensures no other
sys.path
entries are inadvertently modified when inserting the import location named on the command line.
Release date: 2017-03-04
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)
Release date: 2016-12-23
No changes since release candidate 2
Release date: 2016-12-16
Release date: 2016-12-06
super()
in methods, failing to pass the new
__classcell__
namespace entry up to
type.__new__
now results in a
DeprecationWarning
and a class that supports zero-argument
super()
.
yield from
when checking if the next instruction is YIELD_FROM. Regression introduced by WORDCODE (
bpo-26647
).
inspect.getfullargspec()
has been reversed. This decision may be revisited again after the Python 2.7 branch is no longer officially supported.
socket.TCP_CONGESTION
(Linux 2.6.13) and
socket.TCP_USER_TIMEOUT
(Linux 2.6.37) constants. Patch written by Omar Sandoval.
__classcell__
handling needed for custom metaclasses to fully support PEP 487 and zero-argument
super()
.
Release date: 2016-11-21
Release date: 2016-10-31
Release date: 2016-10-10
bpo-27998 : Fixed bytes path support in os.scandir() on Windows. Patch by Eryk Sun.
bpo-28317 : The disassembler now decodes FORMAT_VALUE argument.
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-28380 : unittest.mock Mock autospec functions now properly support assert_called, assert_not_called, and assert_called_once.
bpo-27181 : remove statistics.geometric_mean and defer until 3.7.
bpo-28229 : lzma module now supports pathlib.
bpo-28321 : Fixed writing non-BMP characters with binary format in plistlib.
bpo-28225 : bz2 module now supports pathlib. Initial patch by Ethan Furman.
bpo-28227 : gzip now supports pathlib. Patch by Ethan Furman.
bpo-27358 : Optimized merging var-keyword arguments and improved error message when passing a non-mapping as a var-keyword argument.
bpo-28257 : Improved error message when passing a non-iterable as a var-positional argument. Added opcode BUILD_TUPLE_UNPACK_WITH_CALL.
bpo-28322 : Fixed possible crashes when unpickle itertools objects from incorrect pickle data. Based on patch by John Leitch.
bpo-28228 : imghdr now supports pathlib.
bpo-28226 : compileall now supports pathlib.
bpo-28314 : Fix function declaration (C flags) for the getiterator() method of xml.etree.ElementTree.Element.
bpo-28148 : Stop using localtime() and gmtime() in the time module.
Introduced platform independent _PyTime_localtime API that is similar to POSIX localtime_r, but available on all platforms. Patch by Ed Schouten.
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-18844 : random.choices() now has k as a keyword-only argument to improve the readability of common cases and come into line with the signature used in other languages.
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. Added the master parameter in the DisplayStyle constructor.
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-27778 : Fix a memory leak in os.getrandom() when the getrandom() is interrupted by a signal and a signal handler raises a Python exception.
bpo-28200 : Fix memory leak on Windows in the os module (fix path_converter() function).
bpo-25400 : RobotFileParser now correctly returns default values for crawl_delay and request_rate. Initial patch by Peter Wirtz.
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-22493 : Warning message emitted by using inline flags in the middle of regular expression now contains a (truncated) regex pattern. Patch by Tim Graham.
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-28114 : Fix a crash in parse_envlist() when env contains byte strings. Patch by Eryk Sun.
bpo-27599 : Fixed buffer overrun in binascii.b2a_qp() and binascii.a2b_qp().
bpo-27906 : Fix socket accept exhaustion during high TCP traffic. Patch by Kevin Conway.
bpo-28174 : Handle when SO_REUSEPORT isn’t properly supported. Patch by Seth Michael Larson.
bpo-26654 : Inspect functools.partial in asyncio.Handle.__repr__. Patch by iceboy.
bpo-26909 : Fix slow pipes IO in asyncio. Patch by INADA Naoki.
bpo-28176 : Fix callbacks race in asyncio.SelectorLoop.sock_connect.
bpo-27759 : Fix selectors incorrectly retain invalid file descriptors. Patch by Mark Williams.
bpo-28368 : Refuse monitoring processes if the child watcher has no loop attached. Patch by Vincent Michel.
bpo-28369 : Raise RuntimeError when transport’s FD is used with add_reader, add_writer, etc.
bpo-28370 : Speedup asyncio.StreamReader.readexactly. Patch by Коренберг Марк.
bpo-28371 : Deprecate passing asyncio.Handles to run_in_executor.
bpo-28372 : Fix asyncio to support formatting of non-python coroutines.
bpo-28399 : Remove UNIX socket from FS before binding. Patch by Коренберг Марк.
bpo-27972 : Prohibit Tasks to await on themselves.
Release date: 2016-09-12
f'\x7b"hi"\x7d'
.
dict
implementation is changed like PyPy. It is more compact and preserves insertion order. (Concept developed by Raymond Hettinger and patch by Inada Naoki.)
exec_builtin_or_dynamic()
.
long long
. Python hasn’t compiled without
long long
for years, so this is basically a formality.
bool
and other
int
subclasses now always returns an
int
. Previously the return type depended on the input values. Patch by Xiang Zhang.
List_New
: the original code was checking against
Py_SIZE_MAX
instead of the correct upper bound of
Py_SSIZE_T_MAX
. Patch by Xiang Zhang.
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.
json.load
and
json.loads
now support binary input encoded as UTF-8, UTF-16 or UTF-32. Patch by Serhiy Storchaka.
functools.partial
now matches the behaviour of its accelerated C counterpart for subclassing, pickling and text representation purposes. Patch by Emanuel Barry and Serhiy Storchaka.
Lib/plat-*
: IN, CDROM, DLFCN, TYPES, CDIO, and STROPTS.
Accept: */*
header among the default headers. This makes the results of REST API requests more consistent and predictable especially when proxy servers are involved.
os.urandom()
function does now block on Linux 3.17 and newer until the system urandom entropy pool is initialized to increase the security. This change is part of the
PEP 524
.
getrandom()
syscall as a new
os.getrandom()
function. This change is part of the
PEP 524
.
extra_path
distribution option in distutils packaging.
cmath
constants:
cmath.inf
and
cmath.nan
to match
math.inf
and
math.nan
, and also
cmath.infj
and
cmath.nanj
to match the format used by complex repr.
_normalize
参数用于
Fraction
constuctor keyword-only, so that
Fraction(2, 3, 4)
现在引发
TypeError
.
Fraction.__pow__
result in the case of negative exponent and negative base.
--with-optimizations
is enabled. Also improve our ability to find the llvm-profdata tool on MacOS and some Linuxes.
Release date: 2016-08-15
__name__ == __main__
. Patch by SilentGhost.
Release date: 2016-07-11
pyvenv
and normalize on the term “virtual environment”. Patch by Steve Piercy.
Release date: 2016-06-13
'\'
and an ASCII letter in regular expressions now are errors. The re.LOCALE flag now can be used only with bytes patterns.
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.
inspect
now reports the implicit
.0
parameters generated by the compiler for comprehension and generator expression scopes as if they were positional-only parameters called
implicit0
. Patch by Jelle Zijlstra.
__all__
to
string
. Patch by Emanuel Barry.
idlelib/*.py
and
idle_test/test_*.py
files. Edit files to replace old names with new names when the old name referred to the module rather than the class it contained. See the issue and IDLE section in What’s New in 3.6 for more.
py.exe
no longer prefers an installed Python 2 version over Python 3 by default when used interactively.
Release date: 2016-05-16
PyMem_Malloc()
domain (
PYMEM_DOMAIN_MEM
) now use the
pymalloc 分配器
rather than system
malloc()
. Applications calling
PyMem_Malloc()
without holding the GIL can now crash: use
PYTHONMALLOC=debug
environment variable to validate the usage of memory allocators in your application.
func(*tuple)
(no other positional argument, no keyword): avoid copying the tuple. Patch written by Joe Jevnik.
bytes.replace(b'', b'.')
and
bytearray.replace(b'', b'.')
. Patch written by Josh Snider.
PyMem_Malloc()
family are called without holding the GIL.
tracemalloc
module to get the traceback where a memory block was allocated.
PyObject_Malloc()
now detect when functions are called without holding the GIL.
PYTHONMALLOC
environment variable to set the Python memory allocators and/or install debug hooks.
PyMem_SetupDebugHooks()
function can now also be used on Python compiled in release mode.
PYTHONMALLOCSTATS
environment variable can now also be used on Python compiled in release mode. It now has no effect if set to an empty string.
1.0
is now ignored in
def f(): 1.0
.
*
) unpacking in function calls. Based on patch by Hagen Fürstenau and Daniel Urban.
ast.Constant
. It can be used by external AST optimizers, but the compiler does not emit directly such node.
f1, f2 = lambda: 1, lambda:
1.0
is now correctly compiled to two different functions:
f1()
返回
1
(
int
) 和
f2()
返回
1.0
(
float
), even if
1
and
1.0
相等。
co_lnotab
attribute of code objects changes to support negative line number delta.
ignore
,
replace
and
surrogateescape
.
ignore
,
replace
,
surrogateescape
,
surrogatepass
. Patch co-written with Serhiy Storchaka.
surrogateescape
error handler: the encoders are now up to 3 times as fast. Initial patch written by Serhiy Storchaka.
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-27031 : Removed dummy methods in Tkinter widget classes: tk_menuBar() and tk_bindForTraversal().
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-27033 : The default value of the decode_data parameter for smtpd.SMTPChannel and smtpd.SMTPServer constructors is changed to False.
bpo-27034 : Removed deprecated class asynchat.fifo.
bpo-26870 : Added readline.set_auto_history(), which can stop entries being automatically added to the history list. Based on patch by Tyler Crompton.
bpo-26039 : zipfile.ZipFile.open() can now be used to write data into a ZIP file, as well as for extracting data. Patch by Thomas Kluyver.
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-26002 : Use bisect in statistics.median instead of a linear search. Patch by Upendra Kuma.
bpo-25974 : Make use of new Decimal.as_integer_ratio() method in statistics module. Patch by Stefan Krah.
bpo-26996 : Add secrets module as described in PEP 506.
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-26915 : The __contains__ methods in the collections ABCs now check for identity before checking equality. This better matches the behavior of the concrete classes, allows sensible handling of NaNs, and makes it easier to reason about container invariants.
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-24902 : Print server URL on http.server startup. Initial patch by Felix Kaiser.
bpo-25788 : fileinput.hook_encoded() now supports an “errors” argument for passing to open. Original patch by Joseph Hackman.
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.
importlib
module now emits an
ImportError
rather than a
TypeError
if
__import__()
is tried during the Python shutdown process but
sys.path
is already cleared (set to
None
).
warnings.formatwarning()
now catches exceptions when calling
linecache.getline()
and
tracemalloc.get_object_traceback()
to be able to log
ResourceWarning
emitted late during the Python shutdown process.
_PyTraceMalloc_Track()
and
_PyTraceMalloc_Untrack()
to track memory blocks using the
tracemalloc
module. Add
_PyTraceMalloc_GetTraceback()
to get the traceback of an object.
PyErr_ResourceWarning()
function to pass the destroyed object. Add a
source
属性为
warnings.WarningMessage
. Add warnings._showwarnmsg() which uses tracemalloc to get the traceback where source object was allocated.
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).
**
.
__new__
with keyword arguments, can now be pickled using pickle protocols older than protocol version 4.
python -m test --list-tests
command to list tests.
python -m test --huntrleaks ...
now also checks for leak of file descriptors. Patch written by Richard Oudkerk.
python -m test --coverage
on Windows. Remove the list of ignored directories.
PCbuild\rt.bat
now accepts an unlimited number of arguments to pass along to regrtest.py. Previously there was a limit of 9.
--pgo
and
--pgo-job
arguments to
PCbuild\build.bat
for building with Profile-Guided Optimization. The old
PCbuild\build_pgo.bat
script is removed.
configure
, including a new
--with-icc
标志。
python3 -m
venv
.
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 cipher 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.
--with-optimizations
is enabled. Also improve our ability to find the llvm-profdata tool on MacOS and some Linuxes.
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 timedelta 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
in the 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.
-Werror=declaration-after-statement
. ======= -Werror=declaration-after-statement. >>>>>>> 3f819ca138…
bpo-35110
: Fix unintentional spaces around hyphens and dashes. (GH-10231)
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 truncated to INT_MAX. As any call to os.read(), the OS may read less bytes than the number of requested bytes.
None
is passed as a
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
now raise a 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
错误处理程序。
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.
--generate-posix-vars
in pybuilddir.txt build target. ======= –generate-posix-vars in pybuilddir.txt build target. >>>>>>> 3f819ca138…
bpo-35110
: Fix unintentional spaces around hyphens and dashes. (GH-10231)
_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\..\..
.
(For information about older versions, consult the HISTORY file.)