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

Allow specifying encodings #239

Merged
merged 2 commits into from
Dec 5, 2018
Merged

Allow specifying encodings #239

merged 2 commits into from
Dec 5, 2018

Conversation

flying-sheep
Copy link
Contributor

@flying-sheep flying-sheep commented Dec 5, 2018

This e.g. allows using future-fstrings, which I’d like to use in flying-sheep/get_version#3

You can check that this works via:

#!/usr/bin/env python3.5
import ast
st = ast.parse(b"# coding: future-fstrings\nprint(f'hi {ast}')")
exec(compile(st, filename="", mode="exec"))
# hi <module 'ast' from '/usr/lib64/python3.5/ast.py'>

@takluyver
Copy link
Member

The Path.read_bytes() method was new in 3.5, so there's a test failure on 3.4. However, I think we can move the minimum supported version to 3.5 at this point.

@flying-sheep
Copy link
Contributor Author

well, or we can open the file in binary mode. as you wish.

@takluyver
Copy link
Member

I'm OK with dropping 3.4, but I don't feel a strong need to, so since you've made it work with 3.4...

@takluyver takluyver merged commit 9691171 into pypa:master Dec 5, 2018
@flying-sheep flying-sheep deleted the patch-1 branch December 5, 2018 12:22
@flying-sheep
Copy link
Contributor Author

Great, thank you!

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