Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Doc/deprecations/c-api-pending-removal-in-3.18.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ Pending removal in Python 3.18
replace ``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` with
:c:func:`PyUnicodeWriter_WriteSubstring(writer, str, start, end) <PyUnicodeWriter_WriteSubstring>`.
* :c:func:`!_PyUnicodeWriter_WriteASCIIString`:
replace ``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` with
:c:func:`PyUnicodeWriter_WriteASCII(writer, str) <PyUnicodeWriter_WriteASCII>`.
replace ``_PyUnicodeWriter_WriteASCIIString(&writer, str, size)`` with
:c:func:`PyUnicodeWriter_WriteASCII(writer, str, size) <PyUnicodeWriter_WriteASCII>`.
* :c:func:`!_PyUnicodeWriter_WriteLatin1String`:
replace ``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` with
:c:func:`PyUnicodeWriter_WriteUTF8(writer, str) <PyUnicodeWriter_WriteUTF8>`.
replace ``_PyUnicodeWriter_WriteLatin1String(&writer, str, size)`` by
decoding the string with :c:func:`PyUnicode_DecodeLatin1`, writing the
result with :c:func:`PyUnicodeWriter_WriteStr`, and releasing the result
with :c:func:`Py_DECREF`.
* :c:func:`!_PyUnicodeWriter_Prepare`: (no replacement).
* :c:func:`!_PyUnicodeWriter_PrepareKind`: (no replacement).
* :c:func:`!_Py_HashPointer`: use :c:func:`Py_HashPointer`.
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/decimal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2266,7 +2266,7 @@ applied to the *result* of the computation::
Decimal('3.1416')
>>> pi - Decimal('0.00005') # Subtract unrounded numbers, then round
Decimal('3.1415')
>>> pi + 0 - Decimal('0.00005'). # Intermediate values are rounded
>>> pi + 0 - Decimal('0.00005') # Intermediate values are rounded
Decimal('3.1416')

Q: Some decimal values always print with exponential notation. Is there a way
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/ftplib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Here's a sample session using the :mod:`!ftplib` module::
drwxr-xr-x 3 1176 1176 4096 Oct 10 2012 tools
'226 Directory send OK.'
>>> with open('README', 'wb') as fp:
>>> ftp.retrbinary('RETR README', fp.write)
... ftp.retrbinary('RETR README', fp.write)
'226 Transfer complete.'
>>> ftp.quit()
'221 Goodbye.'
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/zipapp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ fits in memory::
>>> temp = io.BytesIO()
>>> zipapp.create_archive('myapp.pyz', temp, '/usr/bin/python2')
>>> with open('myapp.pyz', 'wb') as f:
>>> f.write(temp.getvalue())
... f.write(temp.getvalue())


.. _zipapp-specifying-the-interpreter:
Expand Down
2 changes: 1 addition & 1 deletion Doc/tutorial/errors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ be ones that have already been raised and caught by the program, along
the following pattern::

>>> excs = []
... for test in tests:
>>> for test in tests:
... try:
... test.run()
... except Exception as e:
Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/2.6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2600,7 +2600,7 @@ changes, or look through the Subversion logs for all the details.
measured in seconds. For example::

>>> u = urllib2.urlopen("http://slow.example.com",
timeout=3)
... timeout=3)
Traceback (most recent call last):
...
urllib2.URLError: <urlopen error timed out>
Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.10.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1964,7 +1964,7 @@ Changes in the C API
:c:func:`PyBytes_AsString` and :c:func:`Py_CompileString`,
as sketched below. (Declarations and error handling are omitted.) ::
io_module = Import_ImportModule("io");
io_module = PyImport_ImportModule("io");
fileobject = PyObject_CallMethod(io_module, "open", "ss", filename, "rb");
source_bytes_object = PyObject_CallMethod(fileobject, "read", "");
result = PyObject_CallMethod(fileobject, "close", "");
Expand Down
4 changes: 2 additions & 2 deletions Doc/whatsnew/3.11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ providing protection against injection attacks.

For example, a SQL query function could be annotated as follows::

def run_query(sql: LiteralString) -> ...
def run_query(sql: LiteralString) -> ...:
...

def caller(
Expand Down Expand Up @@ -2335,7 +2335,7 @@ Porting to Python 3.11
PyObject_GC_UnTrack(p);
Py_TRASHCAN_SAFE_BEGIN(p);
...
Py_TRASHCAN_SAFE_END
Py_TRASHCAN_SAFE_END(p)
}

should migrate to the new macros as follows::
Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2733,7 +2733,7 @@ Changes in the C API
PyObject_GC_UnTrack(p);
Py_TRASHCAN_SAFE_BEGIN(p);
...
Py_TRASHCAN_SAFE_END
Py_TRASHCAN_SAFE_END(p)
}

should migrate to the new macros as follows::
Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ function. For example:

.. code-block:: python

import sys
import os, sys
from tempfile import NamedTemporaryFile

with NamedTemporaryFile(mode='w', suffix='.py', delete=False) as f:
Expand Down
6 changes: 3 additions & 3 deletions Doc/whatsnew/3.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1351,9 +1351,9 @@ connection when done::

>>> from ftplib import FTP
>>> with FTP("ftp1.at.proftpd.org") as ftp:
ftp.login()
ftp.dir()

... ftp.login()
... ftp.dir()
...
'230 Anonymous login ok, restrictions apply.'
dr-xr-xr-x 9 ftp ftp 154 May 6 10:43 .
dr-xr-xr-x 9 ftp ftp 154 May 6 10:43 ..
Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.8.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ breaking client code. For example, in the :mod:`statistics` module, the
parameter name *dist* may be changed in the future. This was made
possible with the following function specification::

def quantiles(dist, /, *, n=4, method='exclusive')
def quantiles(dist, /, *, n=4, method='exclusive'):
...

Since the parameters to the left of ``/`` are not exposed as possible
Expand Down
10 changes: 6 additions & 4 deletions Misc/NEWS.d/3.14.0a6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1398,11 +1398,13 @@ Python 3.18:
replace ``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` with
:c:func:`PyUnicodeWriter_WriteSubstring(writer, str, start, end) <PyUnicodeWriter_WriteSubstring>`.
* :c:func:`!_PyUnicodeWriter_WriteASCIIString`:
replace ``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` with
:c:func:`PyUnicodeWriter_WriteUTF8(writer, str) <PyUnicodeWriter_WriteUTF8>`.
replace ``_PyUnicodeWriter_WriteASCIIString(&writer, str, size)`` with
:c:func:`PyUnicodeWriter_WriteUTF8(writer, str, size) <PyUnicodeWriter_WriteUTF8>`.
* :c:func:`!_PyUnicodeWriter_WriteLatin1String`:
replace ``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` with
:c:func:`PyUnicodeWriter_WriteUTF8(writer, str) <PyUnicodeWriter_WriteUTF8>`.
replace ``_PyUnicodeWriter_WriteLatin1String(&writer, str, size)`` by
decoding the string with :c:func:`PyUnicode_DecodeLatin1`, writing the
result with :c:func:`PyUnicodeWriter_WriteStr`, and releasing the result
with :c:func:`Py_DECREF`.
* :c:func:`!_PyUnicodeWriter_Prepare`: (no replacement).
* :c:func:`!_PyUnicodeWriter_PrepareKind`: (no replacement).

Expand Down
Loading