Support for scripts with unicode content#1389
Support for scripts with unicode content#1389pganssle merged 3 commits intopypa:masterfrom expobrain:scripts_ascii
Conversation
changelog.d/1366.change.rst
Outdated
| @@ -1 +1,2 @@ | |||
| In package_index, fixed handling of encoded entities in URLs. | |||
| Scripts which have unicode content are now sopported | |||
There was a problem hiding this comment.
This should be in its own changelog file, changelog.d/1389.change.rst
|
|
||
| def _to_ascii(s): | ||
| return s.encode('ascii') | ||
| return s.encode('utf8') |
There was a problem hiding this comment.
Hm... Looking at what this does I think I agree with this change (though I don't know nearly enough about unicode issues to fully judge it), but maybe we should also change _to_ascii to _to_bytes?
Also, this change definitely needs tests.
There was a problem hiding this comment.
You mean having only the _to_bytes() function?
BTW, tests added
There was a problem hiding this comment.
Well just _to_ascii sounds like it turns something to an encoded ASCII string, but this is actually returning a utf-8-encoded byte string, so it should probably be called _to_bytes() instead of _to_ascii().
|
@pganssle fixed |
pganssle
left a comment
There was a problem hiding this comment.
I have rebased this and cleaned up the history a bit. Will merge when CI passes.
This also renames the _to_ascii function to better reflect its purpose.
Summary of changes
Makes the
_to_ascii()function able to handle script's contents in unicode format.Closes #761
Pull Request Checklist