Skip to content

Allow specifying encodings#239

Merged
takluyver merged 2 commits into
pypa:masterfrom
flying-sheep:patch-1
Dec 5, 2018
Merged

Allow specifying encodings#239
takluyver merged 2 commits into
pypa:masterfrom
flying-sheep:patch-1

Conversation

@flying-sheep
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

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

@takluyver
Copy link
Copy Markdown
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
Copy Markdown
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.

2 participants