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 default utf-8 encoding for string decode() and encode() #7983

Merged
merged 4 commits into from Jul 2, 2019

Conversation

Eric-Arellano
Copy link
Contributor

@Eric-Arellano Eric-Arellano commented Jun 30, 2019

Python 3 defaults to using utf-8 for these two methods: https://docs.python.org/3/library/stdtypes.html#str.encode.

By using the default encoding, we result in less code and less cognitive overload, because the default works and shouldn't require thinking about it. We should only specify the encoding when it's not utf-8, like ascii.

This change was generated via this script.

@Eric-Arellano
Copy link
Contributor Author

The second commit (d6640b8) is autogenerated, first and third are manual (8c4b92a and 980eba4).

@Eric-Arellano Eric-Arellano requested a review from benjyw July 1, 2019 20:47
@Eric-Arellano Eric-Arellano merged commit 14f079f into pantsbuild:master Jul 2, 2019
@Eric-Arellano Eric-Arellano deleted the update-decode-encode branch July 2, 2019 15:03
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.

None yet

2 participants