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

Use utf-8 so we support non-ascii module names #201

Merged
merged 1 commit into from
Jul 6, 2023
Merged

Conversation

Zac-HD
Copy link
Member

@Zac-HD Zac-HD commented Jul 6, 2023

It's safe to assume that this is always utf-8-safe because we only ever use the function to send Python source code, which must be utf-8 encodable (and indeed utf-8 at rest). Importantly, it's not relevant that the filesystem might use a non-utf8 encoding, because this directory name has already been decoded to a string and will be re-encoded from the string literal in the utf-8 source code to whatever the filesystem encoding happens to be at the other end.

Does not include tests because they'd be very painful to write, it's correct by inspection (grep sendexec(), and can't possibly break anything that already worked.

Fixes #153, unblocks #199.

It's safe to assume that this is always utf-8-safe because we only ever use the function to send Python source code, which must be utf-8 encodable (and indeed utf-8 at rest)
Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

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

To be fair, this only turned safe after drop of python 2.7 support

Thanks for sorting it out

@Zac-HD Zac-HD merged commit 1cb4284 into master Jul 6, 2023
@Zac-HD Zac-HD deleted the zac/use-utf8 branch July 6, 2023 07:23
@nicoddemus nicoddemus mentioned this pull request Jul 6, 2023
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.

UnicodeEncodeError when source-path includes a special character
2 participants