Skip to content

fix: update test for python3.14 default buffer size change - #55

Open
abus-sh wants to merge 1 commit into
aws:masterfrom
abus-sh:master
Open

abus-sh wants to merge 1 commit into
aws:masterfrom
abus-sh:master

Conversation

@abus-sh

@abus-sh abus-sh commented Sep 23, 2026

Copy link
Copy Markdown

Python 3.14 changed the value of io.DEFAULT_BUFFER_SIZE, which breaks the test test_base64io_decode_readlines. This pull request changes the test and parameterized test case values to account for this change. This change is backwards compatible, and the test will still pass on older versions of Python that use the original value of io.DEFAULT_BUFFER_SIZE.

The 3rd and 4th test cases assumed that 102400 bytes was more data than could be read in a one or two Base64io.read calls (respectively), which is no longer true due to the increased io.DEFAULT_BUFFER_SIZE. Increasing source_plaintext to be sized based on the value of io.DEFAULT_BUFFER_SIZE fixes this by ensuring there will always be at least one extra byte that can't be read in two read calls.

I'm aware that this repository doesn't advertise Python 3.14 support, but the code passed all the unit tests and basic smoke tests I threw at it. Since this doesn't break anything on earlier Python versions, I hope you will accept it.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant