Skip to content

Comments

Fix base64 deprecation#5378

Open
yaochengchen wants to merge 1 commit intoyt-project:mainfrom
yaochengchen:fix_base64_deprecation
Open

Fix base64 deprecation#5378
yaochengchen wants to merge 1 commit intoyt-project:mainfrom
yaochengchen:fix_base64_deprecation

Conversation

@yaochengchen
Copy link
Contributor

PR Summary

PR Summary

This PR updates the internal _rdbeta helper function to replace the deprecated base64.decodestring API with base64.decodebytes.

In addition, it fixes Python 3 byte handling in the XOR decoding logic. The previous implementation mixed str and bytes types and relied on ord() calls that raise TypeError under Python 3 (since iterating over bytes yields integers).

The updated implementation performs the XOR operation directly on byte values and decodes the result in a Python 3–compatible manner. This change preserves behavior while preventing runtime errors and future compatibility issues with newer Python versions.

PR Checklist

Adds a test for any bugs fixed. Adds tests for new features.

@welcome
Copy link

welcome bot commented Feb 12, 2026

Hi! Welcome, and thanks for opening this pull request. We have some guidelines for new pull requests, and soon you'll hear back about the results of our tests and continuous integration checks. Thank you for your contribution!

@matthewturk
Copy link
Member

Hmm. Have you used this function? Or verified it still produces correct results?

@matthewturk
Copy link
Member

I verified that this produces the correct results.

Copy link
Member

@matthewturk matthewturk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like it might include multiple PRs in one. If it's just the rdbeta change or just the field parameters it'd be OK with me.

@chrishavlin
Copy link
Contributor

This seems like it might include multiple PRs in one.

yup, this one #5377 has the same first commit

@yaochengchen , would you mind separating out the two PRs to make it a bit clearer (i.e., remove the changes to profile from this PR)? Or we can block this one until #5377 is reviewed. (also, thanks for the contributions!)

@yaochengchen yaochengchen force-pushed the fix_base64_deprecation branch from a5c0ca5 to e654747 Compare February 12, 2026 17:24
@yaochengchen
Copy link
Contributor Author

This seems like it might include multiple PRs in one.

yup, this one #5377 has the same first commit

@yaochengchen , would you mind separating out the two PRs to make it a bit clearer (i.e., remove the changes to profile from this PR)? Or we can block this one until #5377 is reviewed. (also, thanks for the contributions!)

@matthewturk @chrishavlin Sorry about that — I mistakenly based this PR on the previous PR’s commit without double-checking before pushing. That’s my fault, and I apologize for the confusion.

I’ve now removed the profile changes from this PR so it only includes the intended fix.

@chrishavlin chrishavlin added this to the 4.4.3 milestone Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants