slugify icon indicating copy to clipboard operation
slugify copied to clipboard

Name conflict with python-slugify package

Open EmileSonneveld opened this issue 6 years ago • 1 comments

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.

EmileSonneveld avatar Jul 28 '19 14:07 EmileSonneveld

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

rjalexa avatar Mar 29 '23 15:03 rjalexa