Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcc9ef11

Browse files
committed
Merge remote-tracking branch 'origin/2.7' into intl-2.7
2 parents2c8e9a1 +c498cd8 commitcc9ef11

File tree

56 files changed

+576
-113
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+576
-113
lines changed

‎Doc/c-api/sequence.rst‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ Sequence Protocol
1717
1818
..index::builtin: len
1919
20-
Returns the number of objects in sequence *o* on success, and ``-1`` on failure.
21-
For objects that do not provide sequence protocol, this is equivalent to the
22-
Python expression ``len(o)``.
20+
Returns the number of objects in sequence *o* on success, and ``-1`` on
21+
failure. This is equivalent to the Python expression ``len(o)``.
2322
2423
..versionchanged::2.5
2524
These functions returned an:c:type:`int` type. This might require

‎Doc/library/ssl.rst‎

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,7 +1330,7 @@ to speed up repeated connections from the same clients.
13301330

13311331
import socket, ssl
13321332

1333-
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
1333+
context = ssl.SSLContext(ssl.PROTOCOL_TLS)
13341334
context.verify_mode = ssl.CERT_REQUIRED
13351335
context.check_hostname = True
13361336
context.load_default_certs()
@@ -1536,7 +1536,7 @@ If you prefer to tune security settings yourself, you might create
15361536
a context from scratch (but beware that you might not get the settings
15371537
right)::
15381538

1539-
>>> context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
1539+
>>> context = ssl.SSLContext(ssl.PROTOCOL_TLS)
15401540
>>> context.verify_mode = ssl.CERT_REQUIRED
15411541
>>> context.check_hostname = True
15421542
>>> context.load_verify_locations("/etc/ssl/certs/ca-bundle.crt")
@@ -1808,6 +1808,23 @@ successful call of :func:`~ssl.RAND_add`, :func:`~ssl.RAND_bytes` or
18081808
:func:`~ssl.RAND_pseudo_bytes` is sufficient.
18091809

18101810

1811+
.. ssl-libressl:
1812+
1813+
LibreSSL support
1814+
----------------
1815+
1816+
LibreSSL is a fork of OpenSSL 1.0.1. The ssl module has limited support for
1817+
LibreSSL. Some features are not available when the ssl module is compiled
1818+
with LibreSSL.
1819+
1820+
* LibreSSL >= 2.6.1 no longer supports NPN. The methods
1821+
:meth:`SSLContext.set_npn_protocols` and
1822+
:meth:`SSLSocket.selected_npn_protocol` are not available.
1823+
*:meth:`SSLContext.set_default_verify_paths` ignores the env vars
1824+
:envvar:`SSL_CERT_FILE` and:envvar:`SSL_CERT_PATH` although
1825+
:func:`get_default_verify_paths` still reports them.
1826+
1827+
18111828
..seealso::
18121829

18131830
Class:class:`socket.socket`

‎Doc/library/unittest.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2038,7 +2038,7 @@ handling functionality within test frameworks.
20382038

20392039
When called without arguments this function removes the control-c handler
20402040
if it has been installed. This function can also be used as a test decorator
2041-
to temporarily remove the handlerwhilst the test is being executed::
2041+
to temporarily remove the handlerwhile the test is being executed::
20422042

20432043
@unittest.removeHandler
20442044
def test_signal_handling(self):

‎Doc/tutorial/inputoutput.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Here are two ways to write a table of squares and cubes::
101101
10 100 1000
102102

103103
(Note that in the first example, one space between each column was added by the
104-
way:keyword:`print` works:it always adds spaces between its arguments.)
104+
way:keyword:`print` works:by default it adds spaces between its arguments.)
105105

106106
This example demonstrates the:meth:`str.rjust` method of string
107107
objects, which right-justifies a string in a field of a given width by padding

‎Doc/tutorial/interpreter.rst‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,7 @@ The Interpreter and Its Environment
126126
Source Code Encoding
127127
--------------------
128128

129-
By default, Python source files are treated as encoded in UTF-8. In that
130-
encoding, characters of most languages in the world can be used simultaneously
131-
in string literals, identifiers and comments --- although the standard library
132-
only uses ASCII characters for identifiers, a convention that any portable code
133-
should follow. To display all these characters properly, your editor must
134-
recognize that the file is UTF-8, and it must use a font that supports all the
135-
characters in the file.
136-
129+
By default, Python source files are treated as encoded in ASCII.
137130
To declare an encoding other than the default one, a special comment line
138131
should be added as the *first* line of the file. The syntax is as follows::
139132

‎Doc/tutorial/modules.rst‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,25 @@ Note that in general the practice of importing ``*`` from a module or package is
108108
frowned upon, since it often causes poorly readable code. However, it is okay to
109109
use it to save typing in interactive sessions.
110110

111+
If the module name is followed by:keyword:`as`, then the name
112+
following:keyword:`as` is bound directly to the imported module.
113+
114+
::
115+
116+
>>> import fibo as fib
117+
>>> fib.fib(500)
118+
0 1 1 2 3 5 8 13 21 34 55 89 144 233 377
119+
120+
This is effectively importing the module in the same way that ``import fibo``
121+
will do, with the only difference of it being available as ``fib``.
122+
123+
It can also be used when utilising:keyword:`from` with similar effects::
124+
125+
>>> from fibo import fib as fibonacci
126+
>>> fibonacci(500)
127+
0 1 1 2 3 5 8 13 21 34 55 89 144 233 377
128+
129+
111130
..note::
112131

113132
For efficiency reasons, each module is only imported once per interpreter

‎Doc/whatsnew/2.6.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2607,7 +2607,7 @@ changes, or look through the Subversion logs for all the details.
26072607

26082608
* The XML-RPC:class:`~SimpleXMLRPCServer.SimpleXMLRPCServer` and:class:`~DocXMLRPCServer.DocXMLRPCServer`
26092609
classes can now be prevented from immediately opening and binding to
2610-
their socket by passingTrue as the``bind_and_activate``
2610+
their socket by passing``False`` as the*bind_and_activate*
26112611
constructor parameter. This can be used to modify the instance's
26122612
:attr:`allow_reuse_address` attribute before calling the
26132613
:meth:`server_bind` and:meth:`server_activate` methods to

‎Lib/_threading_local.py‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,7 @@
5757
5858
>>> class MyLocal(local):
5959
... number = 2
60-
... initialized = False
6160
... def __init__(self, **kw):
62-
... if self.initialized:
63-
... raise SystemError('__init__ called too many times')
64-
... self.initialized = True
6561
... self.__dict__.update(kw)
6662
... def squared(self):
6763
... return self.number ** 2
@@ -98,7 +94,7 @@
9894
>>> thread.start()
9995
>>> thread.join()
10096
>>> log
101-
[[('color', 'red'), ('initialized', True)], 11]
97+
[[('color', 'red')], 11]
10298
10399
without affecting this thread's data:
104100

‎Lib/aifc.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ def initfp(self, file):
308308
else:
309309
raiseError,'not an AIFF or AIFF-C file'
310310
self._comm_chunk_read=0
311+
self._ssnd_chunk=None
311312
while1:
312313
self._ssnd_seek_needed=1
313314
try:

‎Lib/difflib.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ def _qformat(self, aline, bline, atags, btags):
11031103

11041104
importre
11051105

1106-
defIS_LINE_JUNK(line,pat=re.compile(r"\s*#?\s*$").match):
1106+
defIS_LINE_JUNK(line,pat=re.compile(r"\s*(?:#\s*)?$").match):
11071107
r"""
11081108
Return 1 for ignorable line: iff `line` is blank or contains a single '#'.
11091109

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp