Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit 0ae6c0f

Browse files
author
Anselm Kruis
committed
Merge branch master into master-slp
2 parents a571371 + f0fccb5 commit 0ae6c0f

Some content is hidden

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

99 files changed

+3070
-2267
lines changed

.hgtags

+3
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,6 @@ b4cbecbc0781e89a309d03b60a1f75f8499250e6 v3.4.3
175175
c0d64105463581f85d0e368e8d6e59b7fd8f12b1 v3.5.0b4
176176
1a58b1227501e046eee13d90f113417b60843301 v3.5.0rc1
177177
cc15d736d860303b9da90d43cd32db39bab048df v3.5.0rc2
178+
66ed52375df802f9d0a34480daaa8ce79fc41313 v3.5.0rc3
179+
2d033fedfa7f1e325fd14ccdaa9cb42155da206f v3.5.0rc4
180+
374f501f4567b7595f2ad7798aa09afa2456bb28 v3.5.0

Doc/distutils/apiref.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ This module provides the following functions.
521521

522522
.. method:: CCompiler.library_option(lib)
523523

524-
Return the compiler option to add *dir* to the list of libraries linked into the
524+
Return the compiler option to add *lib* to the list of libraries linked into the
525525
shared library or executable.
526526

527527

Doc/extending/windows.rst

+3-143
Original file line numberDiff line numberDiff line change
@@ -37,149 +37,9 @@ There are two approaches to building extension modules on Windows, just as there
3737
are on Unix: use the :mod:`distutils` package to control the build process, or
3838
do things manually. The distutils approach works well for most extensions;
3939
documentation on using :mod:`distutils` to build and package extension modules
40-
is available in :ref:`distutils-index`. This section describes the manual
41-
approach to building Python extensions written in C or C++.
42-
43-
To build extensions using these instructions, you need to have a copy of the
44-
Python sources of the same version as your installed Python. You will need
45-
Microsoft Visual C++ "Developer Studio"; project files are supplied for VC++
46-
version 7.1, but you can use older versions of VC++. Notice that you should use
47-
the same version of VC++that was used to build Python itself. The example files
48-
described here are distributed with the Python sources in the
49-
:file:`PC\\example_nt\\` directory.
50-
51-
#. **Copy the example files** --- The :file:`example_nt` directory is a
52-
subdirectory of the :file:`PC` directory, in order to keep all the PC-specific
53-
files under the same directory in the source distribution. However, the
54-
:file:`example_nt` directory can't actually be used from this location. You
55-
first need to copy or move it up one level, so that :file:`example_nt` is a
56-
sibling of the :file:`PC` and :file:`Include` directories. Do all your work
57-
from within this new location.
58-
59-
#. **Open the project** --- From VC++, use the :menuselection:`File --> Open
60-
Solution` dialog (not :menuselection:`File --> Open`!). Navigate to and select
61-
the file :file:`example.sln`, in the *copy* of the :file:`example_nt` directory
62-
you made above. Click Open.
63-
64-
#. **Build the example DLL** --- In order to check that everything is set up
65-
right, try building:
66-
67-
#. Select a configuration. This step is optional. Choose
68-
:menuselection:`Build --> Configuration Manager --> Active Solution Configuration`
69-
and select either :guilabel:`Release` or :guilabel:`Debug`. If you skip this
70-
step, VC++ will use the Debug configuration by default.
71-
72-
#. Build the DLL. Choose :menuselection:`Build --> Build Solution`. This
73-
creates all intermediate and result files in a subdirectory called either
74-
:file:`Debug` or :file:`Release`, depending on which configuration you selected
75-
in the preceding step.
76-
77-
#. **Testing the debug-mode DLL** --- Once the Debug build has succeeded, bring
78-
up a DOS box, and change to the :file:`example_nt\\Debug` directory. You should
79-
now be able to repeat the following session (``C>`` is the DOS prompt, ``>>>``
80-
is the Python prompt; note that build information and various debug output from
81-
Python may not match this screen dump exactly)::
82-
83-
C>..\..\PCbuild\python_d
84-
Adding parser accelerators ...
85-
Done.
86-
Python 2.2 (#28, Dec 19 2001, 23:26:37) [MSC 32 bit (Intel)] on win32
87-
Type "copyright", "credits" or "license" for more information.
88-
>>> import example
89-
[4897 refs]
90-
>>> example.foo()
91-
Hello, world
92-
[4903 refs]
93-
>>>
94-
95-
Congratulations! You've successfully built your first Python extension module.
96-
97-
#. **Creating your own project** --- Choose a name and create a directory for
98-
it. Copy your C sources into it. Note that the module source file name does
99-
not necessarily have to match the module name, but the name of the
100-
initialization function should match the module name --- you can only import a
101-
module :mod:`spam` if its initialization function is called :c:func:`PyInit_spam`,
102-
(see :ref:`building`, or use the minimal :file:`Modules/xxmodule.c` as a guide).
103-
By convention, it lives in a file called :file:`spam.c` or :file:`spammodule.c`.
104-
The output file should be called :file:`spam.pyd` (in Release mode) or
105-
:file:`spam_d.pyd` (in Debug mode). The extension :file:`.pyd` was chosen
106-
to avoid confusion with a system library :file:`spam.dll` to which your module
107-
could be a Python interface.
108-
109-
Now your options are:
110-
111-
#. Copy :file:`example.sln` and :file:`example.vcproj`, rename them to
112-
:file:`spam.\*`, and edit them by hand, or
113-
114-
#. Create a brand new project; instructions are below.
115-
116-
In either case, copy :file:`example_nt\\example.def` to :file:`spam\\spam.def`,
117-
and edit the new :file:`spam.def` so its second line contains the string
118-
'``initspam``'. If you created a new project yourself, add the file
119-
:file:`spam.def` to the project now. (This is an annoying little file with only
120-
two lines. An alternative approach is to forget about the :file:`.def` file,
121-
and add the option :option:`/export:initspam` somewhere to the Link settings, by
122-
manually editing the setting in Project Properties dialog).
123-
124-
#. **Creating a brand new project** --- Use the :menuselection:`File --> New
125-
--> Project` dialog to create a new Project Workspace. Select :guilabel:`Visual
126-
C++ Projects/Win32/ Win32 Project`, enter the name (``spam``), and make sure the
127-
Location is set to parent of the :file:`spam` directory you have created (which
128-
should be a direct subdirectory of the Python build tree, a sibling of
129-
:file:`Include` and :file:`PC`). Select Win32 as the platform (in my version,
130-
this is the only choice). Make sure the Create new workspace radio button is
131-
selected. Click OK.
132-
133-
You should now create the file :file:`spam.def` as instructed in the previous
134-
section. Add the source files to the project, using :menuselection:`Project -->
135-
Add Existing Item`. Set the pattern to ``*.*`` and select both :file:`spam.c`
136-
and :file:`spam.def` and click OK. (Inserting them one by one is fine too.)
137-
138-
Now open the :menuselection:`Project --> spam properties` dialog. You only need
139-
to change a few settings. Make sure :guilabel:`All Configurations` is selected
140-
from the :guilabel:`Settings for:` dropdown list. Select the C/C++ tab. Choose
141-
the General category in the popup menu at the top. Type the following text in
142-
the entry box labeled :guilabel:`Additional Include Directories`::
143-
144-
..\Include,..\PC
145-
146-
Then, choose the General category in the Linker tab, and enter ::
147-
148-
..\PCbuild
149-
150-
in the text box labelled :guilabel:`Additional library Directories`.
151-
152-
Now you need to add some mode-specific settings:
153-
154-
Select :guilabel:`Release` in the :guilabel:`Configuration` dropdown list.
155-
Choose the :guilabel:`Link` tab, choose the :guilabel:`Input` category, and
156-
append ``pythonXY.lib`` to the list in the :guilabel:`Additional Dependencies`
157-
box.
158-
159-
Select :guilabel:`Debug` in the :guilabel:`Configuration` dropdown list, and
160-
append ``pythonXY_d.lib`` to the list in the :guilabel:`Additional Dependencies`
161-
box. Then click the C/C++ tab, select :guilabel:`Code Generation`, and select
162-
:guilabel:`Multi-threaded Debug DLL` from the :guilabel:`Runtime library`
163-
dropdown list.
164-
165-
Select :guilabel:`Release` again from the :guilabel:`Configuration` dropdown
166-
list. Select :guilabel:`Multi-threaded DLL` from the :guilabel:`Runtime
167-
library` dropdown list.
168-
169-
If your module creates a new type, you may have trouble with this line::
170-
171-
PyVarObject_HEAD_INIT(&PyType_Type, 0)
172-
173-
Static type object initializers in extension modules may cause
174-
compiles to fail with an error message like "initializer not a
175-
constant". This shows up when building DLL under MSVC. Change it to::
176-
177-
PyVarObject_HEAD_INIT(NULL, 0)
178-
179-
and add the following to the module initialization function::
180-
181-
if (PyType_Ready(&MyObject_Type) < 0)
182-
return NULL;
40+
is available in :ref:`distutils-index`. If you find you really need to do
41+
things manually, it may be instructive to study the project file for the
42+
:source:`winsound <PCbuild/winsound.vcxproj>` standard library module.
18343

18444

18545
.. _dynamic-linking:

Doc/faq/extending.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ complete example using the GNU readline library (you may want to ignore
348348
{
349349
line = readline (prompt);
350350

351-
if (NULL == line) /* CTRL-D pressed */
351+
if (NULL == line) /* Ctrl-D pressed */
352352
{
353353
done = 1;
354354
}

Doc/faq/windows.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ by entering a few expressions of your choice and seeing the results::
8181
'HelloHelloHello'
8282

8383
Many people use the interactive mode as a convenient yet highly programmable
84-
calculator. When you want to end your interactive Python session, hold the Ctrl
85-
key down while you enter a Z, then hit the "Enter" key to get back to your
84+
calculator. When you want to end your interactive Python session, hold the :kbd:`Ctrl`
85+
key down while you enter a :kbd:`Z`, then hit the ":kbd:`Enter`" key to get back to your
8686
Windows command prompt.
8787

8888
You may also find that you have a Start-menu entry such as :menuselection:`Start
8989
--> Programs --> Python 3.3 --> Python (command line)` that results in you
9090
seeing the ``>>>`` prompt in a new window. If so, the window will disappear
91-
after you enter the Ctrl-Z character; Windows is running a single "python"
91+
after you enter the :kbd:`Ctrl-Z` character; Windows is running a single "python"
9292
command in the window, and closes it when you terminate the interpreter.
9393

9494
If the ``python`` command, instead of displaying the interpreter prompt ``>>>``,
@@ -131,8 +131,8 @@ you should make sure that entering the command ::
131131

132132
c:\Python33\python
133133

134-
starts up the interpreter as above (and don't forget you'll need a "CTRL-Z" and
135-
an "Enter" to get out of it). Once you have verified the directory, you can
134+
starts up the interpreter as above (and don't forget you'll need a ":kbd:`Ctrl-Z`" and
135+
an ":kbd:`Enter`" to get out of it). Once you have verified the directory, you can
136136
add it to the system path to make it easier to start Python by just running
137137
the ``python`` command. This is currently an option in the installer as of
138138
CPython 3.3.
@@ -327,7 +327,7 @@ Prior to Python 2.7 and 3.2, to terminate a process, you can use :mod:`ctypes`::
327327
return (0 != kernel32.TerminateProcess(handle, 0))
328328

329329
In 2.7 and 3.2, :func:`os.kill` is implemented similar to the above function,
330-
with the additional feature of being able to send CTRL+C and CTRL+BREAK
330+
with the additional feature of being able to send :kbd:`Ctrl+C` and :kbd:`Ctrl+Break`
331331
to console subprocesses which are designed to handle those signals. See
332332
:func:`os.kill` for further details.
333333

Doc/library/asyncio-eventloop.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ the :meth:`BaseEventLoop.add_signal_handler` method::
853853
loop.add_signal_handler(getattr(signal, signame),
854854
functools.partial(ask_exit, signame))
855855

856-
print("Event loop running forever, press CTRL+c to interrupt.")
856+
print("Event loop running forever, press Ctrl+C to interrupt.")
857857
print("pid %s: send SIGINT or SIGTERM to exit." % os.getpid())
858858
try:
859859
loop.run_forever()

Doc/library/asyncio-protocol.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ received data and close the connection::
539539
coro = loop.create_server(EchoServerClientProtocol, '127.0.0.1', 8888)
540540
server = loop.run_until_complete(coro)
541541

542-
# Serve requests until CTRL+c is pressed
542+
# Serve requests until Ctrl+C is pressed
543543
print('Serving on {}'.format(server.sockets[0].getsockname()))
544544
try:
545545
loop.run_forever()

Doc/library/asyncio-stream.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ TCP echo server using the :func:`asyncio.start_server` function::
312312
coro = asyncio.start_server(handle_echo, '127.0.0.1', 8888, loop=loop)
313313
server = loop.run_until_complete(coro)
314314

315-
# Serve requests until CTRL+c is pressed
315+
# Serve requests until Ctrl+C is pressed
316316
print('Serving on {}'.format(server.sockets[0].getsockname()))
317317
try:
318318
loop.run_forever()

Doc/library/binascii.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ The :mod:`binascii` module defines the following functions:
5959
should be at most 57 to adhere to the base64 standard.
6060

6161

62-
.. function:: a2b_qp(string, header=False)
62+
.. function:: a2b_qp(data, header=False)
6363

6464
Convert a block of quoted-printable data back to binary and return the binary
6565
data. More than one line may be passed at a time. If the optional argument

Doc/library/codecs.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -1310,9 +1310,9 @@ to :class:`bytes` mappings. They are not supported by :meth:`bytes.decode`
13101310
+----------------------+------------------+------------------------------+------------------------------+
13111311
| Codec | Aliases | Purpose | Encoder / decoder |
13121312
+======================+==================+==============================+==============================+
1313-
| base64_codec [#b64]_ | base64, base_64 | Convert operand to MIME | :meth:`base64.b64encode` / |
1314-
| | | base64 (the result always | :meth:`base64.b64decode` |
1315-
| | | includes a trailing | |
1313+
| base64_codec [#b64]_ | base64, base_64 | Convert operand to multiline | :meth:`base64.encodebytes` / |
1314+
| | | MIME base64 (the result | :meth:`base64.decodebytes` |
1315+
| | | always includes a trailing | |
13161316
| | | ``'\n'``) | |
13171317
| | | | |
13181318
| | | .. versionchanged:: 3.4 | |
@@ -1324,14 +1324,14 @@ to :class:`bytes` mappings. They are not supported by :meth:`bytes.decode`
13241324
| bz2_codec | bz2 | Compress the operand | :meth:`bz2.compress` / |
13251325
| | | using bz2 | :meth:`bz2.decompress` |
13261326
+----------------------+------------------+------------------------------+------------------------------+
1327-
| hex_codec | hex | Convert operand to | :meth:`base64.b16encode` / |
1328-
| | | hexadecimal | :meth:`base64.b16decode` |
1327+
| hex_codec | hex | Convert operand to | :meth:`binascii.b2a_hex` / |
1328+
| | | hexadecimal | :meth:`binascii.a2b_hex` |
13291329
| | | representation, with two | |
13301330
| | | digits per byte | |
13311331
+----------------------+------------------+------------------------------+------------------------------+
1332-
| quopri_codec | quopri, | Convert operand to MIME | :meth:`quopri.encodestring` /|
1333-
| | quotedprintable, | quoted printable | :meth:`quopri.decodestring` |
1334-
| | quoted_printable | | |
1332+
| quopri_codec | quopri, | Convert operand to MIME | :meth:`quopri.encode` with |
1333+
| | quotedprintable, | quoted printable | ``quotetabs=True`` / |
1334+
| | quoted_printable | | :meth:`quopri.decode` |
13351335
+----------------------+------------------+------------------------------+------------------------------+
13361336
| uu_codec | uu | Convert the operand using | :meth:`uu.encode` / |
13371337
| | | uuencode | :meth:`uu.decode` |

Doc/library/collections.rst

+4
Original file line numberDiff line numberDiff line change
@@ -1160,3 +1160,7 @@ attribute.
11601160
be an instance of :class:`bytes`, :class:`str`, :class:`UserString` (or a
11611161
subclass) or an arbitrary sequence which can be converted into a string using
11621162
the built-in :func:`str` function.
1163+
1164+
.. versionchanged:: 3.5
1165+
New methods ``__getnewargs__``, ``__rmod__``, ``casefold``,
1166+
``format_map``, ``isprintable``, and ``maketrans``.

Doc/library/compileall.rst

+3-8
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,9 @@ compile Python sources.
8888
Added the ``-i``, ``-b`` and ``-h`` options.
8989

9090
.. versionchanged:: 3.5
91-
Added the ``-j`` and ``-r`` options.
92-
93-
.. versionchanged:: 3.5
94-
``-q`` option was changed to a multilevel value.
95-
96-
.. versionchanged:: 3.5
97-
``-b`` will always produce a byte-code file ending in ``.pyc``, never
98-
``.pyo``.
91+
Added the ``-j``, ``-r``, and ``-qq`` options. ``-q`` option
92+
was changed to a multilevel value. ``b`` will always produce a
93+
byte-code file ending in ``.pyc``, never ``.pyo``.
9994

10095

10196
There is no command-line option to control the optimization level used by the

Doc/library/csv.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ Dialects support the following attributes:
325325

326326
.. attribute:: Dialect.doublequote
327327

328-
Controls how instances of *quotechar* appearing inside a field should be
328+
Controls how instances of *quotechar* appearing inside a field should
329329
themselves be quoted. When :const:`True`, the character is doubled. When
330330
:const:`False`, the *escapechar* is used as a prefix to the *quotechar*. It
331331
defaults to :const:`True`.

Doc/library/datetime.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1756,8 +1756,8 @@ made to civil time.
17561756
``offset.minutes`` respectively.
17571757

17581758
.. versionchanged:: 3.6
1759-
Name generated from ``offset=timedelta(0)`` is now plain 'UTC', not
1760-
'UTC+00:00'.
1759+
Name generated from ``offset=timedelta(0)`` is now plain 'UTC', not
1760+
'UTC+00:00'.
17611761

17621762

17631763
.. method:: timezone.dst(dt)

Doc/library/enum.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ The complete signature is::
466466

467467
:type: type to mix in to new Enum class.
468468

469-
:start: number to start counting at if only names are passed in
469+
:start: number to start counting at if only names are passed in.
470470

471471
.. versionchanged:: 3.5
472472
The *start* parameter was added.

Doc/library/idle.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ Go to file/line
330330
Editing and navigation
331331
----------------------
332332

333-
In this section, 'C' refers to the Control key on Windows and Unix and
334-
the Command key on Mac OSX.
333+
In this section, 'C' refers to the :kbd:`Control` key on Windows and Unix and
334+
the :kbd:`Command` key on Mac OSX.
335335

336336
* :kbd:`Backspace` deletes to the left; :kbd:`Del` deletes to the right
337337

Doc/library/imghdr.rst

+1-3
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,8 @@ from :func:`what`:
5454
+------------+-----------------------------------+
5555

5656
.. versionadded:: 3.5
57-
The *exr* format was added.
57+
The *exr* and *webp* formats were added.
5858

59-
.. versionchanged:: 3.5
60-
The *webp* type was added.
6159

6260
You can extend the list of file types :mod:`imghdr` can recognize by appending
6361
to this variable:

0 commit comments

Comments
 (0)