slugify
slugify copied to clipboard
Name conflict with python-slugify package
Hi,
I come from this issue: https://github.com/un33k/python-slugify/issues/81
To quote: " When working on the following code:
from slugify import slugify
fname = slugify("cc / loc") + ".png"
My IDE (PyCharm 2018.2.5) will suggest to automatically download a package, but the wrong one. And this results in an error: NameError: name 'unicode' is not defined
"
Is there any way this could be solved? For example, by renaming this package on PIP.
May this be the cause? Python 3 renamed the unicode type to str, the old str type has been replaced by bytes.
if isinstance(unicode_or_str, str): text = unicode_or_str decoded = False else: text = unicode_or_str.decode(encoding) decoded = True from https://stackoverflow.com/questions/19877306/nameerror-global-name-unicode-is-not-defined-in-python-3