-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
NameError: name 'unicode' is not defined #124
Comments
It should be defined for Python 3 on this line. What version of Python are you using? Maybe we need a more robust version check. |
Python 3.6.0 |Continuum Analytics, Inc.| (default, Dec 23 2016, 11:57:41) [MSC v.1900 64 bit (AMD64)] on win32 |
I can't reproduce on
Maybe you have a copy of Python 2's |
You are a genius. Thanks mate |
Glad that worked around the issue for you! I'ma keep this open. The clever EAFP Python version check has overstayed it's welcome. Don't want it to bite someone again. |
Hi,
Perhaps you will be able to help me.
I downloaded the "tldextract" in order to run "newspaper" (https://github.com/codelucas/newspaper), but I'm getting an error message "NameError: name 'unicode' is not defined". Why is unicode not defined, I can see "unicode = str" in the remote.py file.
After running this :
This error message appear :
This part seem to be the problem :
d```
ef _decode_utf8(text):
""" Decode from utf8 to Python unicode string.
The suffix list, wherever its origin, should be UTF-8 encoded.
"""
if not isinstance(text, unicode):
return unicode(text, 'utf-8')
else:
return text
The text was updated successfully, but these errors were encountered: