Skip to content
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

Unicode does not work #151

Open
pomponchik opened this issue Mar 28, 2024 · 2 comments
Open

Unicode does not work #151

pomponchik opened this issue Mar 28, 2024 · 2 comments

Comments

@pomponchik
Copy link

Hello!

I try your library with this code:

>>> from slugify import slugify
>>> text = 'Это против природы, это неестественно'
>>> slugify(text)

When i running this code, i get an exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/path_to_the_project/venv/lib/python3.7/site-packages/slugify.py", line 24, in slugify
    unicode(
NameError: name 'unicode' is not defined

I use Python 3.7.7 on MacOS darwin.

@pomponchik
Copy link
Author

pomponchik commented Mar 28, 2024

And if i use the allow_unicode flag with this code:

>>> from slugify import slugify
>>> text = 'Это против природы, это неестественно'
>>> slugify(text, allow_unicode=True)

... I get an another exception:

>>> slugify(text, allow_unicode=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: slugify() got an unexpected keyword argument 'allow_unicode'

@un33k
Copy link
Owner

un33k commented Mar 28, 2024

All Python versions have passed their tests, including 3.7, as per: https://github.com/un33k/python-slugify/actions/runs/8115538091.

It is possible that you are running another package called slugify.

Please do the following:

$ pip freeze | grep slugify
$ pip uninstall slugify
$ pip uninstall python-slugify
$ pip install python-slugify

And try again.

$ python --version
Python 3.11.4

from slugify import slugify
text = 'Это против природы, это неестественно'
slugify(text, allow_unicode=True)
'это-против-природы-это-неестественно'
slugify(text, allow_unicode=False)
'eto-protiv-prirody-eto-neestestvenno'

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

No branches or pull requests

2 participants