Skip to content

Fix issue with cformat converting bytes to string for bytesinner #4760

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

Merged
merged 2 commits into from
Mar 25, 2023

Conversation

MegasKomnenos
Copy link
Contributor

@MegasKomnenos MegasKomnenos commented Mar 25, 2023

This is a follow-up of the following PR
#4746

It addresses the failing test case for test_mod, where,

b'...%(foo)b...' % {b'foo':b"abc"}

caused invalid key error for 'foo'

The cause of this issue was that individual tokens in bytesinner were converted to string before being used for string formatting, but the token being addressed was expected to be in bytes.

It was addressed by making sure that it is treated as bytes.

Copy link
Member

@youknowone youknowone left a comment

Choose a reason for hiding this comment

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

looks good, thank you!

@youknowone youknowone merged commit 887ffd1 into RustPython:main Mar 25, 2023
@youknowone youknowone added C-bug Something isn't working A-stdlib z-ca-2023 Tag to track contrubution-academy 2023 labels Mar 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-stdlib C-bug Something isn't working z-ca-2023 Tag to track contrubution-academy 2023
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants