Release date: 2015/12/20
Release date: 2015/12/06
-w
command line option,
a test run is no longer marked as a failure if all tests succeed when
re-run.
Release date: 2015-02-23
email.feedparser.FeedParser
now handles (malformed)
headers with no key rather than assuming the body has started.
ssl.get_server_certificate()
function now
使用
PROTOCOL_SSLv23
protocol by default, not
PROTOCOL_SSLv3
, for maximum compatibility and support platforms
where
PROTOCOL_SSLv3
support is disabled.
PCbuild\..\externals
而不是
PCbuild\..\..
.
Release date: 2014-10-06
bufsize=1
in subprocess.Popen() selects
line buffering, rather than block buffering. Patch by Akira Li.
Release date: 2014-09-22
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
).
else
keyword (e.g.
True if 42else
False
) to be valid syntax.
None
is passed
作为
REG_BINARY
value to SetValueEx. Patch by John Ehresman.
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.
Release date: 2014-05-18
Release date: 2014-05-05
\x00
to be used as a fill character when using str, int,
float, and complex __format__ methods.
numpy.str_
).
Host:
header and reconnection when using
http.client.HTTPConnection.set_tunnel(). Patch by Nikolaus Rath.
assertRaisesRegex
and
assertWarnsRegex
现在引发
TypeError if the second argument is not a string or compiled regex.
tempfile.NamedTemporaryFile()
, close the file descriptor if
io.open()
fails
email.message.Message.attach
now returns a more
useful error message if
attach
is called on a message for which
is_multipart
为 False。
Doc/make.bat
script to make
it much more comparable to
Doc/Makefile
.
yield from
to 2to3.
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
上下文管理器
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()
.
Issue #19130 : Correct PCbuild/readme.txt, Python 3.3 and 3.4 require VS 2010.
Issue #15663 : Update OS X 10.6+ installer to use Tcl/Tk 8.5.15.
Issue #19019 : Change the OS X installer build script to use CFLAGS instead of OPT for special build options. By setting OPT, some compiler-specific options like -fwrapv were overridden and thus not used, which could result in broken interpreters when building with clang.
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
对象。
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 to pass custom options.
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.
Connection: close
header in its responses.
lzma.LZMAFile
(see also
issue #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.
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.
Release date: 29-Sep-2012
__trunc__()
returns an object whose
__int__()
gives a non-integer. Patch by Serhiy Storchaka.
UseForeignDTD()
method doesn’t require an argument again.
Release date: 23-Sep-2012
PyUnicode_TranslateCharmap()
.
PyRun_SimpleFileExFlags()
when filename points to a pyc/pyo file, closeit is
false an and set_main_loader() fails.
_decimal
to accept any coefficient tuple when
constructing infinities. This is done for backwards compatibility with
decimal.py: Infinity coefficients are undefined in _decimal (in accordance
with the specification).
email.util
在哪里
parsedate()
and
parsedate_tz()
functions did not return None anymore when the argument could
not be parsed.
faulthandler
module: rename dump_tracebacks_later() to
dump_traceback_later() and cancel_dump_tracebacks_later() to
cancel_dump_traceback_later().
Release date: 09-Sep-2012
OSError
.__str__() to better distinguish between errno
error numbers and Windows error numbers.
imp.load_module()
.
/dev/urandom
cannot be
opened. This was a regression caused by the hash randomization patch.
Decimal.quantize()
方法。
window.get_wch()
API of the curses module: return a
character for most keys, and an integer for special keys, instead of always
returning an integer. So it is now possible to distinguish special keys like
keypad keys.
window.addch()
of the curses module for special characters
like curses.ACS_HLINE: the Python function addch(int) and addch(bytes) is now
calling the C function waddch()/mvwaddch() (as it was done in Python 3.2),
instead of wadd_wch()/mvwadd_wch(). The Python function addch(str) is still
calling the C function wadd_wch()/mvwadd_wch() if the Python curses is linked
to libncursesw.
Release date: 25-Aug-2012
__import__()
doesn’t exist,
don’t raise an error, but if an exception is raised as part of an import do
let that propagate.
str(ImportError(msg))
returns a str even when
msg isn’t a str.
PYTHONEXECUTABLE
is set on Mac OS X.
PyObject_IsTrue()
to check for and handle
errors correctly. Patch by Serhiy Storchaka.
importlib.FileFinder
now handles the case where the directory
being searched is removed after a previous import attempt.
email.utils.localtime
to use datetime.astimezone and
correctly handle historic changes in UTC offsets.
code.InteractiveConsole
now respects
sys.excepthook
当
displaying exceptions. Patch by Aaron Iles.
string.Formatter
now understands the ‘a’ conversion specifier.
subprocess.Popen(universal_newlines=True)
for certain
locales (utf-16 and utf-32 family). Patch by Chris Jerdonek.
importlib.__import__()
will silence an ImportError when the
use of fromlist leads to a failed import.
multiprocessing
on Windows without the
if __name__ == '__main__'
idiom.
json
module’s standard compliance.
Patch by Chris Rebert.
:platform:
tag, it doesn’t make sense as part of the Table of Contents.
importlib.abc.Finder
as deprecated.
urllib
tests. Patch by
Jeff Knupp.
json
module’s handling of invalid input
data. Patch by Kushal Das.
PC\python_nt.h
as it’s not used. Add input dependency on custom
build step.
Release date: 12-Aug-2012
yield from
when StopIteration is
raised by a custom iterator.
sys.stdout
and
sys.stderr
are now using “rn” newline on
Windows, as Python 2.
__import__()
to have the proper default
value of 0 for ‘level’ and to not mention negative levels since they are not
supported.
BaseException.__new__()
to help pickling of naive subclasses.
PyBuffer_ToContiguous()
for non-contiguous arrays.
__sizeof__()
after #12399 change. Patch by Serhiy
Storchaka.
PyModule_Create()
that caused references to be
leaked on some error paths has been fixed. Patch by Julia Lawall.
__main__.__loader__
is now set correctly during interpreter
startup.
OSError
subclass whose __init__ doesn’t call back
OSError.__init__ could produce incomplete instances, leading to crashes when
calling str() on them.
__sizeof__()
implementation for array objects. Patch by
Ludwig Hähne.
importlib.invalidate_caches()
work on
sys.meta_path
而不是
sys.path_importer_cache
.
importlib.__import__()
.
__index__()
(they still implement
__int__()
as appropriate).
os.sched_getaffinity()
and
os.sched_setaffinity()
now use regular sets of integers to represent the
CPUs a process is restricted to.
socket.getnameinfo()
/
socket.getaddrinfo()
emulation code. Patch by Philipp Hagemeister.
multiprocessing
use setblocking(True) on the sockets it
uses. Original patch by J Derek Wilson.
os.times()
had disappeared under Windows.
sys.getsizeof()
to
return incorrect results for struct.Struct instances has been fixed. Initial
patch by Serhiy Storchaka.
email.Generator
now correctly
mangles lines that start with ‘From ‘ that occur in a MIME preamble or
epilogue.
argparse
no longer incorrectly strips ‘–’s that appear after
the first one.
argparse
now correctly handles null argument values.
inspect.getmodulename()
is now based directly on importlib via
a new
importlib.machinery.all_suffixes()
API。
telnetlib
will use poll() rather than select() when possible to
avoid failing due to the select() file descriptor limit.
shutil.copystat()
now copies Linux “extended attributes”.
imp.cache_from_source()
and
imp.source_from_cache()
raise
NotImplementedError when
sys.implementation.cache_tag
is set to None.
imp.find_module()
.
wsgiref
environ variable SERVER_SOFTWARE will specify an
implementation specific term like CPython, Jython instead of generic “Python”.
argparse.ArgumentParser
.
ipaddress
network objects correctly return NotImplemented when
compared to arbitrary objects instead of raising TypeError.
ipaddress
now provides more informative error messages when
constructing instances directly (changes permitted during beta due to
provisional API status).
io.FileIO
now raises an error when given a file descriptor
pointing to a directory.
imp.get_tag()
使用
sys.implementation.cache_tag
.
importlib.__init__()
can’t find
_frozen_importlib in sys.modules, not ImportError.
importlib.abc.PyPycLoader
now supports the new source size
header field in .pyc files.
crypt.mksalt()
to use a RNG that is suitable for
cryptographic purpose.
PyImport_ImportModuleEx()
now uses a ‘level’ of 0 instead of -1.
imp.source_from_cache()
used by PyImport_ExecCodeModuleWithPathnames() and
used the Python code instead. Leads to PyImport_ExecCodeModuleObject() to not
try to infer the source path from the bytecode path as
PyImport_ExecCodeModuleWithPathnames() does.
ctypes.c_uint32
and width 32 to incorrectly be set has been fixed.
\
. Patch by Roger Serwy.
exec()
or
execfile()
.
filecmp.dircmp()
compares files shallowly. Patch
contributed by Chris Jerdonek.
filecmp.dircmp()
as a module attribute, and expand the list to more modern
值。
__sizeof__()
tests into test_support. Patch
by Serhiy Storchaka.
importlib.test
to
test.test_importlib
.
importlib.invalidate_caches()
调用。
Release date: 27-Jun-2012
library
and
reason
属性
describing precisely what happened and in which OpenSSL submodule. The
str() of a SSLError is also enhanced accordingly.
Issue #14225 : Fix Unicode support for curses (#12567) on OS X
Issue #14928 : Fix importlib bootstrap issues by using a custom executable (Modules/_freeze_importlib) to build Python/importlib.h.
Release date: 31-May-2012
cadefault
argument
to use the default certificate store. Initial patch by James Oakley.
Release date: 01-May-2012
__
.
test_main
方法。
Release date: 01-Apr-2012
x.__dict__ is x
).
gi_running
flag set to True.
concurrent.futures.wait(
return_when=ALL_COMPLETED)
. Patch by Matt Joiner.
Release date: 05-Mar-2012
Issue #14172 : Fix reference leak when marshalling a buffer-like object (other than a bytes object).
Issue #13521 : dict.setdefault() now does only one lookup for the given key, making it “atomic” for many purposes. Patch by Filip Gruszczyński.
PEP 409, Issue #6210 : “raise X from None” is now supported as a means of suppressing the display of the chained exception context. The chained context still remains available as the __context__ attribute.
Issue #10181 : New memoryview implementation fixes multiple ownership and lifetime issues of dynamically allocated Py_buffer members (#9990) as well as crashes (#8305, #7433). Many new features have been added (See whatsnew/3.3), and the documentation has been updated extensively. The ndarray test object from _testbuffer.c implements all aspects of PEP-3118, so further development towards the complete implementation of the PEP can proceed in a test-driven manner.
Thanks to Nick Coghlan, Antoine Pitrou and Pauli Virtanen for review and many ideas.
Issue #12834 : Fix incorrect results of memoryview.tobytes() for non-contiguous arrays.
Issue #5231 : Introduce memoryview.cast() method that allows changing format and shape without making a copy of the underlying memory.
Issue #14084 : Fix a file descriptor leak when importing a module with a bad encoding.
Upgrade Unicode data to Unicode 6.1.
Issue #14040 : Remove rarely used file name suffixes for C extensions (under POSIX mainly).
Issue #14051 : Allow arbitrary attributes to be set of classmethod and staticmethod.
Issue #13703 : oCERT-2011-003: Randomize hashes of str and bytes to protect against denial of service attacks due to hash collisions within the dict and set types. Patch by David Malcolm, based on work by Victor Stinner.
Issue #13020 : Fix a reference leak when allocating a structsequence object fails. Patch by Suman Saha.
Issue #13908 : Ready types returned from PyType_FromSpec.
Issue #11235 : Fix OverflowError when trying to import a source file whose modification time doesn’t fit in a 32-bit timestamp.
Issue #12705 : A SyntaxError exception is now raised when attempting to compile multiple statements as a single interactive statement.
Fix the builtin module initialization code to store the init function for future reinitialization.
Issue #8052 : The posix subprocess module would take a long time closing all possible file descriptors in the child process rather than just open file descriptors. It now closes only the open fds if possible for the default close_fds=True behavior.
Issue #13629 : Renumber the tokens in token.h so that they match the indexes into _PyParser_TokenNames.
Issue #13752 : Add a casefold() method to str.
Issue #13761 : Add a “flush” keyword argument to the print() function, used to ensure flushing the output stream.
Issue #13645 : pyc files now contain the size of the corresponding source code, to avoid timestamp collisions (especially on filesystems with a low timestamp resolution) when checking for freshness of the bytecode.
PEP 380, Issue #11682 : Add “yield from <x>” to support easy delegation to subgenerators (initial patch by Greg Ewing, integration into 3.3 by Renaud Blanch, Ryan Kelly, Zbigniew Jędrzejewski-Szmek and Nick Coghlan)
Issue #13748
: Raw bytes literals can now be written with the
rb
prefix as well as
br
.
Issue #12736 : Use full unicode case mappings for upper, lower, and title case.
Issue #12760 : Add a create mode to open(). Patch by David Townshend.
Issue #13738 : Simplify implementation of bytes.lower() and bytes.upper().
Issue #13577 : Built-in methods and functions now have a __qualname__. Patch by sbt.
Issue #6695 : Full garbage collection runs now clear the freelist of set objects. Initial patch by Matthias Troffaes.
Fix OSError.__init__ and OSError.__new__ so that each of them can be overriden and take additional arguments (followup to issue #12555 ).
Fix the fix for issue #12149 : it was incorrect, although it had the side effect of appearing to resolve the issue. Thanks to Mark Shannon for noticing.
Issue #13505 : Pickle bytes objects in a way that is compatible with Python 2 when using protocols <= 2.
Issue #11147 : Fix an unused argument in _Py_ANNOTATE_MEMORY_ORDER. (Fix given by Campbell Barton).
Issue #13503 : Use a more efficient reduction format for bytearrays with pickle protocol >= 3. The old reduction format is kept with older protocols in order to allow unpickling under Python 2. Patch by Irmen de Jong.
Issue #7111 : Python can now be run without a stdin, stdout or stderr stream. It was already the case with Python 2. However, the corresponding sys module entries are now set to None (instead of an unusable file object).
Issue #11849 : Ensure that free()d memory arenas are really released on POSIX systems supporting anonymous memory mappings. Patch by Charles-François Natali.
PEP 3155 / issue #13448 : Qualified name for classes and functions.
Issue #13436 : Fix a bogus error message when an AST object was passed an invalid integer value.
Issue #13411 : memoryview objects are now hashable when the underlying object is hashable.
Issue #13338 : Handle all enumerations in _Py_ANNOTATE_MEMORY_ORDER to allow compiling extension modules with -Wswitch-enum on gcc. Initial patch by Floris Bruynooghe.
Issue #10227 : Add an allocation cache for a single slice object. Patch by Stefan Behnel.
Issue #13393 : BufferedReader.read1() now asks the full requested size to the raw stream instead of limiting itself to the buffer size.
Issue #13392 : Writing a pyc file should now be atomic under Windows as well.
Issue #13333 : The UTF-7 decoder now accepts lone surrogates (the encoder already accepts them).
Issue #13389 : Full garbage collection passes now clear the freelists for list and dict objects. They already cleared other freelists in the interpreter.
Issue #13327 : Remove the need for an explicit None as the second argument to os.utime, os.lutimes, os.futimes, os.futimens, os.futimesat, in order to update to the current time. Also added keyword argument handling to os.utimensat in order to remove the need for explicit None.
Issue #13350 : Simplify some C code by replacing most usages of PyUnicode_Format by PyUnicode_FromFormat.
Issue #13342 : input() used to ignore sys.stdin’s and sys.stdout’s unicode error handler in interactive mode (when calling into PyOS_Readline()).
Issue #9896 : Add start, stop, and step attributes to range objects.
Issue #13343
: Fix a SystemError when a lambda expression uses a global variable in the default value of a keyword-only argument:
lambda *,
arg=GLOBAL_NAME: None
Issue #12797 : Added custom opener parameter to builtin open() and FileIO.open().
Issue #10519 : Avoid unnecessary recursive function calls in setobject.c.
Issue #10363 : Deallocate global locks in Py_Finalize().
Issue #13018 : Fix reference leaks in error paths in dictobject.c. Patch by Suman Saha.
Issue #13201 : Define ‘==’ and ‘!=’ to compare range objects based on the sequence of values they define (instead of comparing based on object identity).
Issue #1294232 : In a few cases involving metaclass inheritance, the interpreter would sometimes invoke the wrong metaclass when building a new class object. These cases now behave correctly. Patch by Daniel Urban.
Issue #12753
: Add support for Unicode name aliases and named sequences. Both
unicodedata.lookup()
and ‘N{...}’ now resolve aliases, and
unicodedata.lookup()
resolves named sequences too.
Issue #12170 : The count(), find(), rfind(), index() and rindex() methods of bytes and bytearray objects now accept an integer between 0 and 255 as their first argument. Patch by Petri Lehtinen.
Issue #12604 : VTRACE macro expanded to no-op in _sre.c to avoid compiler warnings. Patch by Josh Triplett and Petri Lehtinen.
Issue #12281 : Rewrite the MBCS codec to handle correctly replace and ignore error handlers on all Windows versions. The MBCS codec is now supporting all error handlers, instead of only replace to encode and ignore to decode.
Issue #13188
: When called without an explicit traceback argument, generator.throw() now gets the traceback from the passed exception’s
__traceback__
attribute. Patch by Petri Lehtinen.
Issue #13146 : Writing a pyc file is now atomic under POSIX.
Issue #7833 : Extension modules built using distutils on Windows will no longer include a “manifest” to prevent them failing at import time in some embedded situations.
PEP 3151 / issue #12555 : reworking the OS and IO exception hierarchy.
Add internal API for static strings (_Py_identifier et al.).
Issue #13063 : the Windows error ERROR_NO_DATA (numbered 232 and described as “The pipe is being closed”) is now mapped to POSIX errno EPIPE (previously EINVAL).
Issue #12911 : Fix memory consumption when calculating the repr() of huge tuples or lists.
PEP 393: flexible string representation. Thanks to Torsten Becker for the initial implementation, and Victor Stinner for various bug fixes.
Issue #14081 : The ‘sep’ and ‘maxsplit’ parameter to str.split, bytes.split, and bytearray.split may now be passed as keyword arguments.
Issue #13012 : The ‘keepends’ parameter to str.splitlines may now be passed as a keyword argument: “my_string.splitlines(keepends=True)”. The same change also applies to bytes.splitlines and bytearray.splitlines.
Issue #7732 : Don’t open a directory as a file anymore while importing a module. Ignore the direcotry if its name matchs the module name (e.g. “__init__.py”) and raise a ImportError instead.
Issue #13021 : Missing decref on an error path. Thanks to Suman Saha for finding the bug and providing a patch.
Issue #12973 : Fix overflow checks that relied on undefined behaviour in list_repeat (listobject.c) and islice_next (itertoolsmodule.c). These bugs caused test failures with recent versions of Clang.
Issue #12904 : os.utime, os.futimes, os.lutimes, and os.futimesat now write atime and mtime with nanosecond precision on modern POSIX platforms.
Issue #12802 : the Windows error ERROR_DIRECTORY (numbered 267) is now mapped to POSIX errno ENOTDIR (previously EINVAL).
Issue #9200 : The str.is* methods now work with strings that contain non-BMP characters even in narrow Unicode builds.
Issue #12791 : Break reference cycles early when a generator exits with an exception.
Issue #12773 : Make __doc__ mutable on user-defined classes.
Issue #12766 : Raise a ValueError when creating a class with a class variable that conflicts with a name in __slots__.
Issue #12266 : Fix str.capitalize() to correctly uppercase/lowercase titlecased and cased non-letter characters.
Issue #12732 : In narrow unicode builds, allow Unicode identifiers which fall outside the BMP.
Issue #12575 : Validate user-generated AST before it is compiled.
Make type(None), type(Ellipsis), and type(NotImplemented) callable. They return the respective singleton instances.
Forbid summing bytes with sum().
Verify the types of AST strings and identifiers provided by the user before compiling them.
Issue #12647 : The None object now has a __bool__() method that returns False. Formerly, bool(None) returned False only because of special case logic in PyObject_IsTrue().
Issue #12579 : str.format_map() now raises a ValueError if used on a format string that contains positional fields. Initial patch by Julian Berman.
Issue #10271 : Allow warnings.showwarning() be any callable.
Issue #11627 : Fix segfault when __new__ on a exception returns a non-exception class.
Issue #12149 : Update the method cache after a type’s dictionary gets cleared by the garbage collector. This fixes a segfault when an instance and its type get caught in a reference cycle, and the instance’s deallocator calls one of the methods on the type (e.g. when subclassing IOBase). Diagnosis and patch by Davide Rizzo.
Issue #9611 , Issue #9015 : FileIO.read() clamps the length to INT_MAX on Windows.
Issue #9642 : Uniformize the tests on the availability of the mbcs codec, add a new HAVE_MBCS define.
Issue #9642 : Fix filesystem encoding initialization: use the ANSI code page on Windows if the mbcs codec is not available, and fail with a fatal error if we cannot get the locale encoding (if nl_langinfo(CODESET) is not available) instead of using UTF-8.
When a generator yields, do not retain the caller’s exception state on the generator.
Issue #12475 : Prevent generators from leaking their exception state into the caller’s frame as they return for the last time.
Issue #12291 : You can now load multiple marshalled objects from a stream, with other data interleaved between marshalled objects.
Issue #12356 : When required positional or keyword-only arguments are not given, produce a informative error message which includes the name(s) of the missing arguments.
Issue #12370 : Fix super with no arguments when __class__ is overriden in the class body.
Issue #12084 : os.stat on Windows now works properly with relative symbolic links when called from any directory.
Loosen type restrictions on the __dir__ method. __dir__ can now return any sequence, which will be converted to a list and sorted by dir().
Issue #12265 : Make error messages produced by passing an invalid set of arguments to a function more informative.
Issue #12225 : Still allow Python to build if Python is not in its hg repo or mercurial is not installed.
Issue #1195 : my_fgets() now always clears errors before calling fgets(). Fix the following case: sys.stdin.read() stopped with CTRL+d (end of file), raw_input() interrupted by CTRL+c.
Issue #12216 : Allow unexpected EOF errors to happen on any line of the file.
Issue #12199 : The TryExcept and TryFinally and AST nodes have been unified into a Try node.
Issue #9670 : Increase the default stack size for secondary threads on Mac OS X and FreeBSD to reduce the chances of a crash instead of a “maximum recursion depth” RuntimeError exception. (patch by Ronald Oussoren)
Issue #12106 : The use of the multiple-with shorthand syntax is now reflected in the AST.
Issue #12190 : Try to use the same filename object when compiling unmarshalling a code objects in the same file.
Issue #12166 : Move implementations of dir() specialized for various types into the __dir__() methods of those types.
Issue #5715 : In socketserver, close the server socket in the child process.
Correct lookup of __dir__ on objects. Among other things, this causes errors besides AttributeError found on lookup to be propagated.
Issue #12060 : Use sig_atomic_t type and volatile keyword in the signal module. Patch written by Charles-François Natali.
Issue #1746656 : Added the if_nameindex, if_indextoname, if_nametoindex methods to the socket module.
Issue #12044 : Fixed subprocess.Popen when used as a context manager to wait for the process to end when exiting the context to avoid unintentionally leaving zombie processes around.
Issue #1195 : Fix input() if it is interrupted by CTRL+d and then CTRL+c, clear the end-of-file indicator after CTRL+d.
Issue #1856 : Avoid crashes and lockups when daemon threads run while the interpreter is shutting down; instead, these threads are now killed when they try to take the GIL.
Issue #9756 : When calling a method descriptor or a slot wrapper descriptor, the check of the object type doesn’t read the __class__ attribute anymore. Fix a crash if a class override its __class__ attribute (e.g. a proxy of the str type). Patch written by Andreas Stührk.
Issue #10517 : After fork(), reinitialize the TLS used by the PyGILState_* APIs, to avoid a crash with the pthread implementation in RHEL 5. Patch by Charles-François Natali.
Issue #10914 : Initialize correctly the filesystem codec when creating a new subinterpreter to fix a bootstrap issue with codecs implemented in Python, as the ISO-8859-15 codec.
Issue #11918 : OS/2 and VMS are no more supported because of the lack of maintainer.
Issue #6780 : fix starts/endswith error message to mention that tuples are accepted too.
Issue #5057 : fix a bug in the peepholer that led to non-portable pyc files between narrow and wide builds while optimizing BINARY_SUBSCR on non-BMP chars (e.g. “U00012345”[0]).
Issue #11845 : Fix typo in rangeobject.c that caused a crash in compute_slice_indices. Patch by Daniel Urban.
Issue #5673
: Added a
timeout
keyword argument to subprocess.Popen.wait, subprocess.Popen.communicated, subprocess.call, subprocess.check_call, and subprocess.check_output. If the blocking operation takes more than
timeout
seconds, the
subprocess.TimeoutExpired
异常被引发。
Issue #11650 : PyOS_StdioReadline() retries fgets() if it was interrupted (EINTR), for example if the program is stopped with CTRL+z on Mac OS X. Patch written by Charles-Francois Natali.
Issue #9319 : Include the filename in “Non-UTF8 code ...” syntax error.
Issue #10785 : Store the filename as Unicode in the Python parser.
Issue #11619 : _PyImport_LoadDynamicModule() doesn’t encode the path to bytes on Windows.
Issue #10998 : Remove mentions of -Q, sys.flags.division_warning and Py_DivisionWarningFlag left over from Python 2.
Issue #11244 : Remove an unnecessary peepholer check that was preventing negative zeros from being constant-folded properly.
Issue #11395 : io.FileIO().write() clamps the data length to 32,767 bytes on Windows if the file is a TTY to workaround a Windows bug. The Windows console returns an error (12: not enough space error) on writing into stdout if stdout mode is binary and the length is greater than 66,000 bytes (or less, depending on heap usage).
Issue #11320 : fix bogus memory management in Modules/getpath.c, leading to a possible crash when calling Py_SetPath().
Issue #11432 : A bug was introduced in subprocess.Popen on posix systems with 3.2.0 where the stdout or stderr file descriptor being the same as the stdin file descriptor would raise an exception. webbrowser.open would fail. fixed.
Issue #9856 : Change object.__format__ with a non-empty format string to be a DeprecationWarning. In 3.2 it was a PendingDeprecationWarning. In 3.4 it will be a TypeError.
Issue #11244 : The peephole optimizer is now able to constant-fold arbitrarily complex expressions. This also fixes a 3.2 regression where operations involving negative numbers were not constant-folded.
Issue #11450 : Don’t truncate hg version info in Py_GetBuildInfo() when there are many tags (e.g. when using mq). Patch by Nadeem Vawda.
Issue #11335 : Fixed a memory leak in list.sort when the key function throws an exception.
Issue #8923 : When a string is encoded to UTF-8 in strict mode, the result is cached into the object. Examples: str.encode(), str.encode(‘utf-8’), PyUnicode_AsUTF8String() and PyUnicode_AsEncodedString(unicode, “utf-8”, NULL).
Issue #10829 : Refactor PyUnicode_FromFormat(), use the same function to parse the format string in the 3 steps, fix crashs on invalid format strings.
Issue #13007 : whichdb should recognize gdbm 1.9 magic numbers.
Issue #11286 : Raise a ValueError from calling PyMemoryView_FromBuffer with a buffer struct having a NULL data pointer.
Issue #11272 : On Windows, input() strips ‘r’ (and not only ‘n’), and sys.stdin uses universal newline (replace ‘rn’ by ‘n’).
Issue #11828 : startswith and endswith now accept None as slice index. Patch by Torsten Becker.
Issue #11168 : Remove filename debug variable from PyEval_EvalFrameEx(). It encoded the Unicode filename to UTF-8, but the encoding fails on undecodable filename (on surrogate characters) which raises an unexpected UnicodeEncodeError on recursion limit.
Issue #11187 : Remove bootstrap code (use ASCII) of PyUnicode_AsEncodedString(), it was replaced by a better fallback (use the locale encoding) in PyUnicode_EncodeFSDefault().
Check for NULL result in PyType_FromSpec.
Issue #10516 : New copy() and clear() methods for lists and bytearrays.
Issue #11386 : bytearray.pop() now throws IndexError when the bytearray is empty, instead of OverflowError.
Issue #12380 : The rjust, ljust and center methods of bytes and bytearray now accept a bytearray argument.
dispatch_table
attribute which allows to set custom per-pickler reduction functions.
Patch by sbt.
<script>...</script>
and
<style>...</style>
.
python -m smtplib
in order to display the prompt correctly.
ssize_t
and
size_t
,分别。
tarfile.TarFile.gzopen()
当
the file cannot be opened.
Connection: close
头。
sentinel
on instances of
multiprocessing.Process
. Also, fix Process.join() to not use polling
anymore, when given a timeout.
SSLFakeFile
在
smtplib module. Patch by Catalin Iacob.
context
argument pointing to an ssl.SSLContext instance.
Patch by Kasun Herath.
fileobj
constructor argument. Patch by
Nadeem Vawda.
Connection: close
header is sent by requests using URLOpener
class which helps in closing of sockets after connection is over. Patch
contributions by Jeff McNeil and Nadeem Vawda.
bufsize
value of 0 in subprocess.Popen() really creates
unbuffered pipes, such that select() works properly on them.
subprocess.DEVNULL
常量。
smtp.SMTP
class is now a context manager so it can be used
在
with
statement. Contributed by Giampaolo Rodola.
TestCase.run
returns the result object used or created.
Contributed by Janathan Hartley.
mmap.PROT_READ|mmap.PROT_EXEC
would segfault instead of raising a
TypeError. Patch by Charles-François Natali.
*at()
family of functions (openat(), etc.) to the
posix module. Patch by Ross Lagerwall.
daemon
keyword argument to the threading.Thread
and multiprocessing.Process constructors in order to override the
default behaviour of inheriting the daemonic property from the current
thread/process.
-m
(或
--match
) option. This works with all test cases
using the unittest module. This is useful with long test suites
such as test_io or test_subprocess.
-v
or
-W
), by using the
--failfast
(或
-G
) option to regrtest. This is useful with long test suites
such as test_io or test_subprocess.
test.support.IPV6_ENABLED
. Patch by
Charles-François Natali.
__dict__
descriptor of C
类型。
const
char *
而不是
char *
.
(For information about older versions, consult the HISTORY file.)