You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test_pyrepl and test_shelve fail on FreeBSD16 #144423
ERROR: test_custom_serializer_and_deserializer (test.test_shelve.TestCase.test_custom_serializer_and_deserializer) (proto=5)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/var/db/buildbot/buildarea/3.x.opsec-fbsd16/build/Lib/test/test_shelve.py", line 205, in test_custom_serializer_and_deserializer
s["bytearray_data"] = bytearray_data
~^^^^^^^^^^^^^^^^^^
File "/var/db/buildbot/buildarea/3.x.opsec-fbsd16/build/Lib/shelve.py", line 137, in __setitem__
self.dict[key.encode(self.keyencoding)] = serialized_value
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: dbm mappings have bytes or string elements only
test_pyrepl failure:
FAIL: test_no_newline (test.test_pyrepl.test_pyrepl.TestMain.test_no_newline)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/var/db/buildbot/buildarea/3.x.opsec-fbsd16/build/Lib/test/support/__init__.py", line 3048, in wrapper
return func(*args, **kwargs)
File "/var/db/buildbot/buildarea/3.x.opsec-fbsd16/build/Lib/test/test_pyrepl/test_pyrepl.py", line 1952, in test_no_newline
self.assertIn(expected_output_sequence, basic_output)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'Something pretty long>>> exit()' not found in 'print(\'Something pretty long\', end=\'\')\r\nexit()\r\nPython 3.15.0a5+ (heads/main:bb917d83b16, Feb 3 2026, 13:51:15) [Clang 19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd7080 on freebsd\r\nType "help", "copyright", "credits" or "license" for more information.\r\n>>> Something pretty long>>> '
ERROR: test_custom_serializer_and_deserializer (test.test_shelve.TestCase.test_custom_serializer_and_deserializer) (proto=5)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/var/db/buildbot/buildarea/3.x.opsec-fbsd16/build/Lib/test/test_shelve.py", line 205, in test_custom_serializer_and_deserializer
s["bytearray_data"] = bytearray_data
~^^^^^^^^^^^^^^^^^^
File "/var/db/buildbot/buildarea/3.x.opsec-fbsd16/build/Lib/shelve.py", line 137, in __setitem__
self.dict[key.encode(self.keyencoding)] = serialized_value
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: dbm mappings have bytes or string elements only
The test's custom serializer returns a bytearray directly when protocol == 5, but DBM backends (ndbm, gdbm, etc.) only accept bytes or str, not bytearray. This fails on FreeBSD (ndbm), WSL/Linux (gdbm), and potentially other platforms depending on which DBM backend is available.
I've created a fix that addresses this by converting bytearray to bytes in the test serializer before returning.
CC: @picnixz
FAIL: test_no_newline (test.test_pyrepl.test_pyrepl.TestMain.test_no_newline)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/var/db/buildbot/buildarea/3.x.opsec-fbsd16/build/Lib/test/support/__init__.py", line 3048, in wrapper
return func(*args, **kwargs)
File "/var/db/buildbot/buildarea/3.x.opsec-fbsd16/build/Lib/test/test_pyrepl/test_pyrepl.py", line 1952, in test_no_newline
self.assertIn(expected_output_sequence, basic_output)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'Something pretty long>>> exit()' not found in 'print(\'Something pretty long\', end=\'\')\r\nexit()\r\nPython 3.15.0a5+ (heads/main:bb917d83b16, Feb 3 2026, 13:51:15) [Clang 19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd7080 on freebsd\r\nType "help", "copyright", "credits" or "license" for more information.\r\n>>> Something pretty long>>> '
The failure looks like a timing/race condition that fails on slow platforms like buildbots. It also occurred for a while on the RISC-V buildbot, but now doesn't show up consistently. It looks like a flaky test.
The test sends two commands (print(...) and exit()) together via pty. I think the commands are echoed by the pty before the REPL has fully processed the first command, causing the output to appear in a different order.
The potential fix for the test could wait for the initial >>> prompt before sending commands, and send commands one at a time waiting for each prompt. I'm working on a fix for this.
CC: @ambv
I would prefer to check that all tests now pass on FreeBSD 16, but the FreeBSD 16 buildbot worker is offline for 1 month. I wrote to the worker owner to ask if he can check what's going on.
Activity
vstinner commentedon Feb 3, 2026
cc @opsec
furkanonder commentedon Feb 3, 2026
The test's custom serializer returns a
bytearraydirectly whenprotocol == 5, but DBM backends (ndbm, gdbm, etc.) only acceptbytesorstr, notbytearray. This fails on FreeBSD (ndbm), WSL/Linux (gdbm), and potentially other platforms depending on which DBM backend is available.I've created a fix that addresses this by converting
bytearraytobytesin the test serializer before returning.CC: @picnixz
furkanonder commentedon Feb 3, 2026
The failure looks like a timing/race condition that fails on slow platforms like buildbots. It also occurred for a while on the RISC-V buildbot, but now doesn't show up consistently. It looks like a flaky test.
The test sends two commands (
print(...)andexit()) together via pty. I think the commands are echoed by the pty before the REPL has fully processed the first command, causing the output to appear in a different order.Reproducer
Output on x86:
Output on RISC-V:
The potential fix for the test could wait for the initial
>>>prompt before sending commands, and send commands one at a time waiting for each prompt. I'm working on a fix for this.CC: @ambv
chris-eibl commentedon Feb 3, 2026
Thanks for the pyrepl failure analysis! It is also tracked in #143394.
vstinner commentedon Mar 26, 2026
test_shelve has been fixed in the meanwhile by #137879.
furkanonder commentedon Mar 31, 2026
@vstinner The test is only passing when the GNU readline is enabled in the CPython build. (see:#143394 (comment))
chris-eibl commentedon Apr 3, 2026
@vstinner has fixed
test_no_newline(#147973), so I think we can close here, too?vstinner commentedon Apr 3, 2026
I would prefer to check that all tests now pass on FreeBSD 16, but the FreeBSD 16 buildbot worker is offline for 1 month. I wrote to the worker owner to ask if he can check what's going on.
In the meanwhile, I'm ok to close this issue.
opsec commentedon Aug 6, 2026
The FreeBSD 16 buildbot is back with a much newer version of FreeBSD 16. Let's see if it works out.
vstinner commentedon Aug 6, 2026
@opsec: Oh that's great!