Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support base64.b64encode() and friends #293

Closed
Zac-HD opened this issue Aug 4, 2024 · 2 comments
Closed

Support base64.b64encode() and friends #293

Zac-HD opened this issue Aug 4, 2024 · 2 comments

Comments

@Zac-HD
Copy link
Contributor

Zac-HD commented Aug 4, 2024

Recent upgrades fixed enough prior problems for HypothesisWorks/hypothesis#4034 to uncover:

Traceback (most recent call last):
  File ".../hypothesis/hypothesis-python/tests/cover/test_reproduce_failure.py", line 37, in test_encoding_loop
    assert decode_failure(encode_failure(b)) == b
  File ".../hypothesis/core.py", line 357, in encode_failure
    return base64.b64encode(buffer)
  File ".../lib/python3.10/base64.py", line 58, in b64encode
    encoded = binascii.b2a_base64(s, newline=False)
TypeError: a bytes-like object is required, not 'SymbolicBytes'

and unlike e.g. #286, base64-encoding seems suffiently well-behaved that it would be feasible to have a symbolic implementation instead of realizing. Thoughts?

@pschanely
Copy link
Owner

and unlike e.g. #286, base64-encoding seems suffiently well-behaved that it would be feasible to have a symbolic implementation instead of realizing. Thoughts?

Yeah, very feasible! (heh, though I've been putting off a similar support for int(s, base=n) where n != 10)

@pschanely
Copy link
Owner

This is in 0.0.66!

Only supporting base64.b64encode and base64.b64decode so far. There's a lot of binascii left to do, but tracking that in #289

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants