Skip to content

test_binascii: test_b2a_roundtrip() failure with Hypothesis #109421

Closed as not planned
@vstinner

Description

@vstinner

It seems like Hypothesis found an issue. Can someone have a look? How can it be reproduced locally?

ERROR: test_b2a_roundtrip (test.test_binascii.MemoryviewBinASCIITest.test_b2a_roundtrip)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_binascii.py", line 233, in test_b2a_roundtrip
    binary=hypothesis.strategies.binary(),
           ^^^^^^^
  File "/home/runner/work/cpython/cpython-builddir/hypovenv/lib/python3.13/site-packages/hypothesis/core.py", line 1386, in wrapped_test
    raise the_error_hypothesis_found
  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_binascii.py", line 237, in test_b2a_roundtrip
    converted = binascii.b2a_uu(self.type2test(binary), backtick=backtick)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
binascii.Error: At most 45 bytes at once
Falsifying example: test_b2a_roundtrip(
    self=<test.test_binascii.MemoryviewBinASCIITest testMethod=test_b2a_roundtrip>,
    binary=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
    backtick=False,
)

You can reproduce this example by temporarily adding @reproduce_failure('6.84.0', b'AXicY2RgYBwciIEBAA2TAC8=') as a decorator on your test case

----------------------------------------------------------------------
Ran 85 tests in 127.421s

FAILED (errors=1, skipped=1)
test test_binascii failed

build: https://github.com/python/cpython/actions/runs/6189519251/job/16803785370

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests 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