GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test_b2a_roundtrip failure in test_binascii.py · Issue #109418 · python/cpython

test_b2a_roundtrip failure in test_binascii.py #109418

New issue
Copy link
New issue
Copy link
Closed
Closed
test_b2a_roundtrip failure in test_binascii.py#109418
Copy link
Labels
3.13only security fixesonly security fixestestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@colesbury
colesbury
opened on Sep 14, 2023
Issue body actions

Bug report

Bug description:

Seen in GitHub CI:

======================================================================
ERROR: test_b2a_roundtrip (test.test_binascii.BytearrayBinASCIITest.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.BytearrayBinASCIITest 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

(https://github.com/python/cpython/actions/runs/6189137441/job/16802618181?pr=109344)

I think we need a max_size=45 in:

cpython/Lib/test/test_binascii.py

Lines 232 to 239 in 3b9d10b

@hypothesis.given(
binary=hypothesis.strategies.binary(),
backtick=hypothesis.strategies.booleans(),
)
def test_b2a_roundtrip(self, binary, backtick):
converted = binascii.b2a_uu(self.type2test(binary), backtick=backtick)
restored = binascii.a2b_uu(self.type2test(converted))
self.assertConversion(binary, converted, restored, backtick=backtick)

cc @sobolevn

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

  • gh-109418: Fix hypothesis strategy for b2a_roundtrip test #109419

Activity

  1. colesbury
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    testsTests in the Lib/test dirTests in the Lib/test dir
    3.13only security fixesonly security fixes
    on Sep 14, 2023
  2. hugovk commented on Sep 14, 2023

    @hugovk
    hugovk
    on Sep 14, 2023
    Member
    More actions

    This was added in #107863, cc @sobolevn.

  3. sobolevn
    added a commit that references this issue on Sep 14, 2023

    pythongh-109418: Fix hypothesis strategy for b2a_roundtrip test

    d95b355
  4. hugovk
    added a commit that references this issue on Sep 14, 2023

    gh-109418: Fix hypothesis strategy for b2a_roundtrip test (#109419)

    d7dc3d9
  5. hugovk
    closed this as completedon Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13only security fixesonly security fixestestsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.