☠ Buildbot (Python): python/cpython - failed test (failure) (main)
The Buildbot has detected a new failure on builder AMD64 Debian root 3.x while building python/cpython. Full details are available at: https://buildbot.python.org/#/builders/345/builds/12771
Buildbot URL: https://buildbot.python.org/
Worker for this Build: angelico-debian-amd64
Build Reason: <unknown> Blamelist: Guo Ci <zguoci@gmail.com>, Itamar Oren <itamarost@gmail.com>, Peter Bierma <zintensitydev@gmail.com>, Petr Viktorin <encukou@gmail.com>, Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
BUILD FAILED: failed test (failure)
Summary of the results of the build (if available):
==
Captured traceback
Traceback (most recent call last): File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/pickletester.py", line 3633, in test_framing_many_objects self.check_frame_opcodes(pickled) ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/pickletester.py", line 3584, in check_frame_opcodes self.assertLessEqual(pos, frame_end) ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^ AssertionError: 257162 not less than or equal to 262184
Traceback (most recent call last): File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_repl.py", line 346, in test_asyncio_repl_is_ok self.assertEqual(exit_code, 0, "".join(output)) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: -6 != 0 : await asyncio.sleep(0) xit() python: Python/generated_cases.c.h:12040: _PyEval_EvalFrameDefault: Assertion `oparg == 2' failed.
Traceback (most recent call last): File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/process.py", line 320, in _bootstrap self.run() ~~~~~~~~^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/concurrent/futures/process.py", line 242, in _process_worker call_item = call_queue.get(block=True) File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/multiprocessing/queues.py", line 120, in get return _ForkingPickler.loads(res) ~~~~~~~~~~~~~~~~~~~~~^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_concurrent_futures/test_deadlock.py", line 7, in <module> import unittest.mock File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/mock.py", line 27, in <module> import asyncio File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/asyncio/__init__.py", line 8, in <module> from .base_events import * File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/asyncio/base_events.py", line 44, in <module> from . import sslproto File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/asyncio/sslproto.py", line 16, in <module> from . import transports File "<frozen importlib._bootstrap>", line 1379, in _find_and_load File "<frozen importlib._bootstrap>", line 1341, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 1267, in _find_spec File "<frozen importlib._bootstrap_external>", line 1314, in find_spec File "<frozen importlib._bootstrap_external>", line 1288, in _get_spec File "<frozen importlib._bootstrap_external>", line 1415, in find_spec File "<frozen importlib._bootstrap_external>", line 133, in _path_join AttributeError: 'tuple' object has no attribute 'rstrip' ERROR
Traceback (most recent call last): File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/pickletester.py", line 3633, in test_framing_many_objects self.check_frame_opcodes(pickled) ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/pickletester.py", line 3582, in check_frame_opcodes for op, arg, pos in pickletools.genops(pickled): ~~~~~~~~~~~~~~~~~~^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/pickletools.py", line 2297, in _genops assert opcode.name == 'STOP' ^^^^^^^^^^^^^^^^^^^^^ AssertionError
Traceback (most recent call last): File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_unparse.py", line 139, in check_ast_roundtrip self.assertASTEqual(ast1, ast2) ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/ast_helper.py", line 46, in assertASTEqual traverse_compare(ast1, ast2) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/ast_helper.py", line 27, in traverse_compare traverse_compare(value1, value2) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/ast_helper.py", line 31, in traverse_compare traverse_compare(node1, node2) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/ast_helper.py", line 27, in traverse_compare traverse_compare(value1, value2) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/ast_helper.py", line 31, in traverse_compare traverse_compare(node1, node2) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/ast_helper.py", line 27, in traverse_compare traverse_compare(value1, value2) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/ast_helper.py", line 31, in traverse_compare traverse_compare(node1, node2) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/ast_helper.py", line 27, in traverse_compare traverse_compare(value1, value2) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/ast_helper.py", line 31, in traverse_compare traverse_compare(node1, node2) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/ast_helper.py", line 27, in traverse_compare traverse_compare(value1, value2) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/ast_helper.py", line 31, in traverse_compare traverse_compare(node1, node2) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/ast_helper.py", line 27, in traverse_compare traverse_compare(value1, value2) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/ast_helper.py", line 31, in traverse_compare traverse_compare(node1, node2) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/ast_helper.py", line 27, in traverse_compare traverse_compare(value1, value2) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/ast_helper.py", line 27, in traverse_compare traverse_compare(value1, value2) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/support/ast_helper.py", line 16, in traverse_compare self.fail(f"{type(a)!r} is not {type(b)!r}") ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: <class 'object'> is not <class 'str'>
Traceback (most recent call last): File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/threading.py", line 1075, in _bootstrap_inner self._context.run(self.run) ~~~~~~~~~~~~~~~~~^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/threading.py", line 1017, in run self._target(*self._args, **self._kwargs) ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_asyncio/test_free_threading.py", line 83, in <lambda> runner = threading.Thread(target=lambda: asyncio.run(main())) ~~~~~~~~~~~^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/asyncio/runners.py", line 204, in run return runner.run(main) ~~~~~~~~~~^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/asyncio/runners.py", line 127, in run return self._loop.run_until_complete(task) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/asyncio/base_events.py", line 719, in run_until_complete return future.result() ~~~~~~~~~~~~~^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/asyncio/futures.py", line 208, in result raise self._exception.with_traceback(self._exception_tb) File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/asyncio/tasks.py", line 289, in __step_run_and_handle_result result = coro.send(None) File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_asyncio/test_free_threading.py", line 80, in main tasks = asyncio.all_tasks(loop) File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/asyncio/tasks.py", line 53, in all_tasks if futures._get_loop(t) is loop and not t.done()} ~~~~~~~~~~~~~~~~~^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/asyncio/futures.py", line 315, in _get_loop return get_loop() File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/asyncio/futures.py", line 132, in get_loop raise RuntimeError("Future object is not initialized.") RuntimeError: Future object is not initialized. k
Traceback (most recent call last): File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/pickletester.py", line 3336, in test_dict_chunking y = self.loads(s) File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_pickle.py", line 96, in loads return u.load() ~~~~~~^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/pickle.py", line 1325, in load dispatchkey[0] ~~~~~~~~~~~~~~~~^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/pickle.py", line 1388, in load_int val = int(data) TypeError: int() argument must be a string, a bytes-like object or a real number, not '_Unpickler'
Traceback (most recent call last): File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_configparser.py", line 466, in test_case_sensitivity cf = self.fromstring( "[MySection]\nOption{} first line \n\tsecond line \n".format( self.delimiters[0])) File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_configparser.py", line 63, in fromstring cf = self.newconfig(defaults) File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_configparser.py", line 59, in newconfig instance = self.config_class(**arguments) File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/configparser.py", line 658, in __init__ self._converters = ConverterMapping(self) ~~~~~~~~~~~~~~~~^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/configparser.py", line 1372, in __init__ m = self.GETTERCRE.match(getter) TypeError: expected string or bytes-like object, got 'ConverterMapping'
Traceback (most recent call last): File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/pickletester.py", line 4858, in test_multiple_unpicklings_minimal self._check_multiple_unpicklings(MinimalIO, seekable=False) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/pickletester.py", line 4831, in _check_multiple_unpicklings with self.subTest(proto=proto): ~~~~~~~~~~~~^^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/contextlib.py", line 162, in __exit__ self.gen.throw(value) ~~~~~~~~~~~~~~^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/case.py", line 562, in subTest with self._outcome.testPartExecutor(self._subtest, subTest=True): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/contextlib.py", line 162, in __exit__ self.gen.throw(value) ~~~~~~~~~~~~~~^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/case.py", line 73, in testPartExecutor self.result.addSubTest(test_case.test_case, test_case, exc_info) ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/runner.py", line 94, in addSubTest super(TextTestResult, self).addSubTest(test, subtest, err) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/result.py", line 140, in addSubTest errors.append((subtest, self._exc_info_to_string(err, test))) ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/unittest/result.py", line 189, in _exc_info_to_string tb_e = traceback.TracebackException( exctype, value, tb, capture_locals=self.tb_locals, compact=True) File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/traceback.py", line 1121, in __init__ suggestion = _compute_suggestion_error(exc_value, exc_traceback, wrong_name) File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/traceback.py", line 1721, in _compute_suggestion_error current_distance = _levenshtein_distance(wrong_name, possible_name, max_distance) File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/traceback.py", line 1786, in _levenshtein_distance insert_delete = min(result, distance) + _MOVE_COST ~~~^^^^^^^^^^^^^^^^^^ TypeError: 'int' object is not callable
Traceback (most recent call last): File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_math.py", line 1490, in test_sumprod_stress self.assertEqual( ~~~~~~~~~~~~~~~~^ run(baseline_sumprod, *args), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ run(sumprod, *args), ^^^^^^^^^^^^^^^^^^^^ args, ^^^^^ ) ^ AssertionError: Tuples differ: (None, <class 'float'>, 'nan') != (None, <class 'builtin_function_or_method'>, 'nan')
Traceback (most recent call last):\n ...\n ValueError: expected ... bytes in a bytearray8, but only 6 remain\n """\n\n n = read_uint8(f)\n assert n >= 0\n if n > sys.maxsize:\n raise ValueError("bytearray8 byte count > sys.maxsize: %d" % n)\n data = f.read(n)\n if len(data) == n:\n return bytearray(data)\n raise ValueError("expected %d bytes in a bytearray8, but only %d remain" %\n (n, len(data)))\n\nbytearray8 = ArgumentDescriptor(\n name="bytearray8",\n n=TAKEN_FROM_ARGUMENT8U,\n reader=read_bytearray8,\n doc="""A counted bytearray.\n\n The first argument is an 8-byte little-endian unsigned int giving\n the number of bytes, and the second argument is that many bytes.\n """)\n\ndef read_unicodestringnl(f):\n r"""\n >>> import io\n >>> read_unicodestringnl(io.BytesIO(b"abc\\\\uabcd\\njunk")) == \'abc\\uabcd\'\n True\n "
""\n\n data = f.readline()\n if not data.endswith(b\'\\n\'):\n raise ValueError("no newline found when trying to read "\n "unicodestringnl")\n data = data[:-1] # lose the newline\n return str(data, \'raw-unicode-escape\')\n\nunicodestringnl = ArgumentDescriptor(\n name=\'unicodestringnl\',\n n=UP_TO_NEWLINE,\n reader=read_unicodestringnl,\n doc="""A newline-terminated Unicode string.\n\n This is raw-unicode-escape encoded, so consists of\n printable ASCII characters, and may contain embedded\n escape sequences.\n """)\n\n\ndef read_unicodestring1(f):\n r"""\n >>> import io\n >>> s = \'abcd\\uabcd\'\n >>> enc = s.encode(\'utf-8\')\n >>> enc\n b\'abcd\\xea\\xaf\\x8d\'\n >>> n = bytes([len(enc)]) # little-endian 1-byte length\n >>> t = read_unicodestr
ing1(io.BytesIO(n + enc + b\'junk\'))\n >>> s == t\n True\n\n >>> read_unicodestring1(io.BytesIO(n + enc[:-1]))\n Traceback (most recent call last):\n ...\n ValueError: expected 7 bytes in a unicodestring1, but only 6 remain\n """\n\n n = read_uint1(f)\n assert n >= 0\n data = f.read(n)\n if len(data) == n:\n return str(data, \'utf-8\', \'surrogatepass\')\n raise ValueError("expected %d bytes in a unicodestring1, but only %d "\n "remain" % (n, len(data)))\n\nunicodestring1 = ArgumentDescriptor(\n name="unicodestring1",\n n=TAKEN_FROM_ARGUMENT1,\n reader=read_unicodestring1,\n doc="""A counted Unicode string.\n\n The first argument is a 1-byte little-endian signed int\n giving the number of bytes in the string, and the second\n argument-- the UTF-8 encoding of the Unicode string --\n
contains that many bytes.\n """)\n\n\ndef read_unicodestring4(f):\n r"""\n >>> import io\n >>> s = \'abcd\\uabcd\'\n >>> enc = s.encode(\'utf-8\')\n >>> enc\n b\'abcd\\xea\\xaf\\x8d\'\n >>> n = bytes([len(enc), 0, 0, 0]) # little-endian 4-byte length\n >
Traceback (most recent call last): File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_unicodedata.py", line 48, in test_method_checksum "01"[(char + 'abc').isalpha()], ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'int' object is not subscriptable
Traceback (most recent call last): File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_concurrent_futures/test_deadlock.py", line 167, in test_exit_during_func_exec_on_worker self._check_error(SystemExit, _exit) ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/contextlib.py", line 85, in inner return func(*args, **kwds) File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_concurrent_futures/test_deadlock.py", line 132, in _check_error res.result(timeout=self.TIMEOUT) ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/concurrent/futures/_base.py", line 450, in result return self.__get_result() ~~~~~~~~~~~~~~~~~^^ File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/concurrent/futures/_base.py", line 395, in __get_result raise self._exception concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.
Traceback (most recent call last): File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/pickletester.py", line 4834, in _check_multiple_unpicklings pickler = self.pickler_class(f, protocol=proto) ^^^^^^^^^^^^^^^^^^ AttributeError: 'int' object has no attribute 'pickler_class'
Traceback (most recent call last):\n ...\n ValueError: no string quotes around b\'\'\n\n >>> read_stringnl(io.BytesIO(b"\\n"), stripquotes=False)\n \'\'\n\n >>> read_stringnl(io.BytesIO(b"\'\'\\n"))\n \'\'\n\n >>> read_stringnl(io.BytesIO(b\'"abcd"\'))\n Traceback (most recent call last):\n ...\n ValueError: no newline found when trying to read stringnl\n\n Embedded escapes are undone in the result.\n >>> read_stringnl(io.BytesIO(br"\'a\\n\\\\b\\x00c\\td\'" + b"\\n\'e\'"))\n \'a\\n\\\\b\\x00c\\td\'\n """\n\n data = f.readline()\n if not data.endswith(b\'\\n\'):\n raise ValueError("no newline found when trying to read stringnl")\n data = data[:-1] # lose the newline\n\n if stripquotes:\n for q in (b\'"\', b"\'"):\n if data.startswith(q):\n if not data.endswith(q):\n raise ValueError("string quote %r not found at both "\n "ends of %r" % (q, data))\n data = data[1:-1]\n break\n else:\n raise ValueError("no string quotes around %r" % data)\n\n if decode:\n data = codecs.escape_decode(data)[0].decode(encoding)\n return data\n\nstringnl = ArgumentDescriptor(\n name=\'stringnl\',\n n=UP_TO_NEWLINE,\n reader=read_stringnl,\n doc="""A newline-terminated string.\n\n This is a repr-style string, with embedded escapes, and\n bracketing quotes.\n """)\n\ndef read_stringnl_noescape(f):\n return read_stringnl(f, stripquotes=False, encoding=\'utf-8\')\n\nstringnl_noescape = ArgumentDescriptor(\n name=\'stringnl_noescape\',\n n=UP_TO_NEWLINE,\n reader=read_stringnl_noescape,\n doc="""A newline-terminated string.\n\n This is a str-style string, w ithout embedded escapes,\n or bracketing quotes. It should consist solely of\n printable ASCII characters.\n """)\n\ndef read_stringnl_noescape_pair(f):\n r"""\n >>> import io\n >>> read_stringnl_noescape_pair(io.BytesIO(b"Queue\\nEmpty\\njunk"))\n \'Queue Empty\'\n """\n\n return "%s %s" % (read_stringnl_noescape(f), read_stringnl_noescape(f))\n\nstringnl_noescape_pair = ArgumentDescriptor(\n name=\'stringnl_noescape_pair\',\n n=UP_TO_NEWLINE,\n reader=read_stringnl_noescape_pair,\n doc="""A pair of newline-terminated strings.\n\n These are str-style strings, without embedded\n escapes, or bracketing quotes. They should\n consist solely of printable ASCII characters.\n The p air is returned as a single string, with\n a single blank separating the two strings.\n """)\n\n\ndef read_string1(f):\n r"""\n >>> import io\n >>> read_string1(io.BytesIO(b"\\x00"))\n \'\'\n >>> read_string1(io.BytesIO(b"\\x03abcdef"))\n \'abc\'\n """\n\n n = read_uint1(f)\n assert n >= 0\n data = f.read(n)\n if len(data) == n:\n return data.decode("latin-1")\n raise ValueError("expected %d bytes in a string1, but only %d remain" %\n (n, len(data)))\n\nstring1 = ArgumentDescriptor(\n
Traceback (most recent call last):\n ...\n ValueError: no string quotes around b\'\'\n\n >>> read_stringnl(io.BytesIO(b"\\n"), stripquotes=False)\n \'\'\n\n >>> read_stringnl(io.BytesIO(b"\'\'\\n"))\n \'\'\n\n >>> read_stringnl(io.BytesIO(b\'"abcd"\'))\n Traceback (most recent call last):\n ...\n ValueError: no newline found when trying to read stringnl\n\n Embedded escapes are undone in the result.\n >>> read_stringnl(io.BytesIO(br"\'a\\n\\\\b\\x00c\\td\'" + b"\\n\'e\'"))\n \'a\\n\\\\b\\x00c\\td\'\n """\n\n data = f.readline()\n if not data.endswith(b\'\\n\'):\n raise ValueError("no newline found when trying to read stringnl")\n data = data[:-1] # lose the newline\n\n if stripquotes:\n for q in (b\'"\', b"\'"):\n if data.startswith(q):\n if not data.endswith(q):\n raise ValueError("string quote %r not found at both "\n "ends of %r" % (q, data))\n data = data[1:-1]\n break\n else:\n raise ValueError("no string quotes around %r" % data)\n\n if decode:\n data = codecs.escape_decode(data)[0].decode(encoding)\n return data\n\nstringnl = ArgumentDescriptor(\n name=\'stringnl\',\n n=UP_TO_NEWLINE,\n reader=read_stringnl,\n doc="""A newline-terminated string.\n\n This is a repr-style string, with embedded escapes, and\n bracketing quotes.\n """)\n\ndef read_stringnl_noescape(f):\n return read_stringnl(f, stripquotes=False, encoding=\'utf-8\')\n\nstringnl_noescape = ArgumentDescriptor(\n name=\'stringnl_noescape\',\n n=UP_TO_NEWLINE,\n reader=read_stringnl_noescape,\n doc="""A newline-terminated string.\n\n This is a str-style string, w ithout embedded escapes,\n or bracketing quotes. It should consist solely of\n printable ASCII characters.\n """)\n\ndef read_stringnl_noescape_pair(f):\n r"""\n >>> import io\n >>> read_stringnl_noescape_pair(io.BytesIO(b"Queue\\nEmpty\\njunk"))\n \'Queue Empty\'\n """\n\n return "%s %s" % (read_stringnl_noescape(f), read_stringnl_noescape(f))\n\nstringnl_noescape_pair = ArgumentDescriptor(\n name=\'stringnl_noescape_pair\',\n n=UP_TO_NEWLINE,\n reader=read_stringnl_noescape_pair,\n doc="""A pair of newline-terminated strings.\n\n These are str-style strings, without embedded\n escapes, or bracketing quotes. They should\n consist solely of printable ASCII characters.\n The p air is returned as a single string, with\n a single blank separating the two strings.\n """)\n\n\ndef read_string1(f):\n r"""\n >>> import io\n >>> read_string1(io.BytesIO(b"\\x00"))\n \'\'\n >>> read_string1(io.BytesIO(b"\\x03abcdef"))\n \'abc\'\n """\n\n n = read_uint1(f)\n assert n >= 0\n data = f.read(n)\n if len(data) == n:\n return data.decode("latin-1")\n raise ValueError("expected %d bytes in a string1, but only %d remain" %\n (n, len(data)))\n\nstring1 = ArgumentDescriptor(\n
Traceback (most recent call last):\n ...\n ValueError: expected ... bytes in a bytearray8, but only 6 remain\n """\n\n n = read_uint8(f)\n assert n >= 0\n if n > sys.maxsize:\n raise ValueError("bytearray8 byte count > sys.maxsize: %d" % n)\n data = f.read(n)\n if len(data) == n:\n return bytearray(data)\n raise ValueError("expected %d bytes in a bytearray8, but only %d remain" %\n (n, len(data)))\n\nbytearray8 = ArgumentDescriptor(\n name="bytearray8",\n n=TAKEN_FROM_ARGUMENT8U,\n reader=read_bytearray8,\n doc="""A counted bytearray.\n\n The first argument is an 8-byte little-endian unsigned int giving\n the number of bytes, and the second argument is that many bytes.\n """)\n\ndef read_unicodestringnl(f):\n r"""\n >>> import io\n >>> read_unicodestringnl(io.BytesIO(b"abc\\\\uabcd\\njunk")) == \'abc\\uabcd\'\n True\n "
""\n\n data = f.readline()\n if not data.endswith(b\'\\n\'):\n raise ValueError("no newline found when trying to read "\n "unicodestringnl")\n data = data[:-1] # lose the newline\n return str(data, \'raw-unicode-escape\')\n\nunicodestringnl = ArgumentDescriptor(\n name=\'unicodestringnl\',\n n=UP_TO_NEWLINE,\n reader=read_unicodestringnl,\n doc="""A newline-terminated Unicode string.\n\n This is raw-unicode-escape encoded, so consists of\n printable ASCII characters, and may contain embedded\n escape sequences.\n """)\n\n\ndef read_unicodestring1(f):\n r"""\n >>> import io\n >>> s = \'abcd\\uabcd\'\n >>> enc = s.encode(\'utf-8\')\n >>> enc\n b\'abcd\\xea\\xaf\\x8d\'\n >>> n = bytes([len(enc)]) # little-endian 1-byte length\n >>> t = read_unicodestr
ing1(io.BytesIO(n + enc + b\'junk\'))\n >>> s == t\n True\n\n >>> read_unicodestring1(io.BytesIO(n + enc[:-1]))\n Traceback (most recent call last):\n ...\n ValueError: expected 7 bytes in a unicodestring1, but only 6 remain\n """\n\n n = read_uint1(f)\n assert n >= 0\n data = f.read(n)\n if len(data) == n:\n return str(data, \'utf-8\', \'surrogatepass\')\n raise ValueError("expected %d bytes in a unicodestring1, but only %d "\n "remain" % (n, len(data)))\n\nunicodestring1 = ArgumentDescriptor(\n name="unicodestring1",\n n=TAKEN_FROM_ARGUMENT1,\n reader=read_unicodestring1,\n doc="""A counted Unicode string.\n\n The first argument is a 1-byte little-endian signed int\n giving the number of bytes in the string, and the second\n argument-- the UTF-8 encoding of the Unicode string --\n
contains that many bytes.\n """)\n\n\ndef read_unicodestring4(f):\n r"""\n >>> import io\n >>> s = \'abcd\\uabcd\'\n >>> enc = s.encode(\'utf-8\')\n >>> enc\n b\'abcd\\xea\\xaf\\x8d\'\n >>> n = bytes([len(enc), 0, 0, 0]) # little-endian 4-byte length\n
Test report
Failed tests:
- test.test_asyncio.test_free_threading
- test_configparser
- test.test_concurrent_futures.test_deadlock
- test_unparse
- test_math
- test_repl
- test_pickle
- test_codecs
- test_unicodedata
- test_pow
- test_tokenize
Failed subtests:
- test_method_checksum - test.test_unicodedata.UnicodeMethodsTest.test_method_checksum
- test_multiple_unpicklings_minimal - test.test_pickle.CPicklerUnpicklerObjectTests.test_multiple_unpicklings_minimal
- test_case_sensitivity - test.test_configparser.ConfigParserTestCaseNonStandardDefaultSection.test_case_sensitivity
- test_asyncio_repl_is_ok - test.test_repl.TestInteractiveInterpreter.test_asyncio_repl_is_ok
- test_framing_many_objects - test.test_pickle.CDumpPickle_LoadPickle.test_framing_many_objects
- test_sumprod_stress - test.test_math.MathTests.test_sumprod_stress
- test_exit_during_func_exec_on_worker - test.test_concurrent_futures.test_deadlock.ProcessPoolSpawnExecutorDeadlockTest.test_exit_during_func_exec_on_worker
- test_dict_chunking - test.test_pickle.CDumpPickle_LoadPickle.test_dict_chunking
- test_framing_many_objects - test.test_pickle.CPicklerTests.test_framing_many_objects
- test_files - test.test_unparse.DirectoryTestCase.test_files
Sincerely, -The Buildbot
participants (1)
-
buildbot@python.org