-
Notifications
You must be signed in to change notification settings - Fork 10
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
Python 2 Support #9
Comments
I'm also seeing this issue |
There is a trick # Python 2 and 3: alternative 1
from io import open
f = open('myfile.txt', 'rb')
data = f.read() # as bytes
text = data.decode('utf-8') # unicode, not bytes
# Python 2 and 3: alternative 2
from io import open
f = open('myfile.txt', encoding='utf-8')
text = f.read() # unicode, not bytes |
@lucemia this is great. |
This issue seems to be really a case, we have 2 pull request #10 and recent #11 that got closed attempting to fix the issue. Does this issue actually exists on Python 3 and Python 2 works properly ? I actually never encountered in other packages that I maintain. What do you think ? |
I noticed that the LICENSE file contains some unprintable UTF8 characters that cause all the following decode issue. If possible, remove these utf-8 characters will solve the issue. https://github.com/Alir3z4/django-crequest/blob/master/LICENSE |
Could someone review/merge my PR and perform a release? |
I've done it. Sorry for delay in review and merge. Fixed in #12 |
The 2018.5.1 release will cause exception in python 2.
The text was updated successfully, but these errors were encountered: