Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/upstream' into ubuntu/bionic
Browse files Browse the repository at this point in the history
  • Loading branch information
deadsnakes-issues-bot committed Nov 29, 2020
2 parents 79a3c26 + cfb2f79 commit 98af7da
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 14 deletions.
12 changes: 6 additions & 6 deletions Doc/library/dis.rst
Expand Up @@ -861,7 +861,7 @@ All of the following opcodes use their arguments.

.. opcode:: LIST_TO_TUPLE

Pops a list from the stack and pushes a tuple containing the same values.
Pops a list from the stack and pushes a tuple containing the same values.

.. versionadded:: 3.9

Expand Down Expand Up @@ -889,7 +889,7 @@ All of the following opcodes use their arguments.

.. opcode:: DICT_MERGE

Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys.
Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys.

.. versionadded:: 3.9

Expand All @@ -907,14 +907,14 @@ All of the following opcodes use their arguments.

.. opcode:: IS_OP (invert)

Performs ``is`` comparison, or ``is not`` if ``invert`` is 1.
Performs ``is`` comparison, or ``is not`` if ``invert`` is 1.

.. versionadded:: 3.9


.. opcode:: CONTAINS_OP (invert)

Performs ``in`` comparison, or ``not in`` if ``invert`` is 1.
Performs ``in`` comparison, or ``not in`` if ``invert`` is 1.

.. versionadded:: 3.9

Expand Down Expand Up @@ -955,8 +955,8 @@ All of the following opcodes use their arguments.

.. opcode:: JUMP_IF_NOT_EXC_MATCH (target)

Tests whether the second value on the stack is an exception matching TOS,
and jumps if it is not. Pops two values from the stack.
Tests whether the second value on the stack is an exception matching TOS,
and jumps if it is not. Pops two values from the stack.

.. versionadded:: 3.9

Expand Down
6 changes: 3 additions & 3 deletions Doc/library/multiprocessing.rst
Expand Up @@ -2569,9 +2569,9 @@ Address Formats
filesystem.

* An ``'AF_PIPE'`` address is a string of the form
:samp:`r'\\\\.\\pipe\\{PipeName}'`. To use :func:`Client` to connect to a named
pipe on a remote computer called *ServerName* one should use an address of the
form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'` instead.
:samp:`r'\\\\.\\pipe\\{PipeName}'`. To use :func:`Client` to connect to a named
pipe on a remote computer called *ServerName* one should use an address of the
form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'` instead.

Note that any string beginning with two backslashes is assumed by default to be
an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address.
Expand Down
2 changes: 1 addition & 1 deletion Doc/tutorial/datastructures.rst
Expand Up @@ -78,7 +78,7 @@ objects:
Return the number of times *x* appears in the list.


.. method:: list.sort(key=None, reverse=False)
.. method:: list.sort(*, key=None, reverse=False)
:noindex:

Sort the items of the list in place (the arguments can be used for sort
Expand Down
3 changes: 2 additions & 1 deletion Lib/asyncio/exceptions.py
Expand Up @@ -34,8 +34,9 @@ class IncompleteReadError(EOFError):
- expected: total number of expected bytes (or None if unknown)
"""
def __init__(self, partial, expected):
r_expected = 'undefined' if expected is None else repr(expected)
super().__init__(f'{len(partial)} bytes read on a total of '
f'{expected!r} expected bytes')
f'{r_expected} expected bytes')
self.partial = partial
self.expected = expected

Expand Down
8 changes: 5 additions & 3 deletions Lib/test/test_asyncio/test_streams.py
Expand Up @@ -452,12 +452,14 @@ def test_readuntil_multi_chunks_1(self):

def test_readuntil_eof(self):
stream = asyncio.StreamReader(loop=self.loop)
stream.feed_data(b'some dataAA')
data = b'some dataAA'
stream.feed_data(data)
stream.feed_eof()

with self.assertRaises(asyncio.IncompleteReadError) as cm:
with self.assertRaisesRegex(asyncio.IncompleteReadError,
'undefined expected bytes') as cm:
self.loop.run_until_complete(stream.readuntil(b'AAA'))
self.assertEqual(cm.exception.partial, b'some dataAA')
self.assertEqual(cm.exception.partial, data)
self.assertIsNone(cm.exception.expected)
self.assertEqual(b'', stream._buffer)

Expand Down
@@ -0,0 +1,2 @@
Clarify the error message for :exc:`asyncio.IncompleteReadError` when
``expected`` is ``None``.

0 comments on commit 98af7da

Please sign in to comment.