-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Add special handling in PycodeSerializer for bytes #879
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #879 +/- ##
=======================================
Coverage 99.89% 99.89%
=======================================
Files 105 105
Lines 9304 9307 +3
Branches 2079 2080 +1
=======================================
+ Hits 9294 9297 +3
Misses 3 3
Partials 7 7 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you maintain the double quotes, please?
Bit confused - based on the unit test I think the |
from the w3c-tests
|
Ah whoops, got it. I've added a fix that should maintain the double quotes for bytes. It's a bit messier than I was hoping, just because there's the chance that a byte string could contain both single quotes and double quotes, which makes a blind |
852efcc
to
55fad70
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you1
📒 Description
Adds special handling to
PycodeSerializer
to ensure that byte strings are not modified and that their representation is handled literally.Resolves #878
🔗 What I've Done
Update
literal_value()
to add special handling for byte strings, so that the literalrepr()
of the string is used, instead of falling back to the default call torepr()
which subsequently replaces single quotes in the resulting string.Also adds a quick unit test to exhibit the fix.
💬 Comments
🛫 Checklist