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

Support for scripts with unicode content #1389

Merged
merged 3 commits into from Aug 17, 2018
Merged

Conversation

@expobrain
Copy link
Contributor

@expobrain expobrain commented Jun 16, 2018

Summary of changes

Makes the _to_ascii() function able to handle script's contents in unicode format.

Closes #761

Pull Request Checklist

  • Changes have tests
  • News fragment added in changelog.d
@@ -1 +1,2 @@
In package_index, fixed handling of encoded entities in URLs.
Scripts which have unicode content are now sopported

This comment has been minimized.

@pganssle

pganssle Jun 29, 2018
Member

This should be in its own changelog file, changelog.d/1389.change.rst

This comment has been minimized.

@pganssle

pganssle Jun 29, 2018
Member

Also s/sopported/supported

This comment has been minimized.

@expobrain

expobrain Jul 12, 2018
Author Contributor

fixed

@@ -108,7 +108,7 @@ def isascii(s):
else:

def _to_ascii(s):
return s.encode('ascii')
return s.encode('utf8')

This comment has been minimized.

@pganssle

pganssle Jun 29, 2018
Member

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.

This comment has been minimized.

@expobrain

expobrain Jul 11, 2018
Author Contributor

You mean having only the _to_bytes() function?

BTW, tests added

This comment has been minimized.

@pganssle

pganssle Jul 12, 2018
Member

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().

This comment has been minimized.

@expobrain

expobrain Jul 12, 2018
Author Contributor

done

@expobrain
Copy link
Contributor Author

@expobrain expobrain commented Aug 7, 2018

@pganssle fixed

@pganssle pganssle force-pushed the expobrain:scripts_ascii branch from e239095 to d94437c Aug 17, 2018
pganssle added a commit to expobrain/setuptools that referenced this pull request Aug 17, 2018
Copy link
Member

@pganssle pganssle left a comment

I have rebased this and cleaned up the history a bit. Will merge when CI passes.

@pganssle pganssle force-pushed the expobrain:scripts_ascii branch from d94437c to c43d0f6 Aug 17, 2018
@pganssle pganssle merged commit afba2d8 into pypa:master Aug 17, 2018
5 checks passed
5 checks passed
@codecov
codecov/patch 100% of diff hit (target 81.2%)
Details
@codecov
codecov/project 81.31% (+0.11%) compared to 85593de
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details
@expobrain expobrain deleted the expobrain:scripts_ascii branch Aug 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants