Skip to content

test_shelve.py crashes on WSL? #137829

@JasonMendoza2008

Description

@JasonMendoza2008

To reproduce, clone the repo, and run ./configure --with-pydebug && make -j $(nproc).

I'm on WSL (Ubuntu 24.04.1 LTS).

I get:

0:04:10 load avg: 1.81 [362/493/1] test_shelve failed (1 error)
test test_shelve failed -- Traceback (most recent call last):
  File "/home/lhott/cpython/Lib/test/test_shelve.py", line 205, in test_custom_serializer_and_deserializer
    s["bytearray_data"] = bytearray_data
    ~^^^^^^^^^^^^^^^^^^
  File "/home/lhott/cpython/Lib/shelve.py", line 138, in __setitem__
    self.dict[key.encode(self.keyencoding)] = serialized_value
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: gdbm mappings have bytes or string indices only

I had a few optional modules that were not found when I compiled Python, but if that was a problem, shouldn't test_shelve be skipped?

Image

I assume _dbm is the problem but I'm not familiar with dbm modules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtestsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions