Bug 40490

Summary: ModuleNotFoundError: No module named 'unidecode'
Product: Sisyphus Reporter: Vitaly Lipatov <lav>
Component: python3-module-slugifyAssignee: Grigory Ustinov <grenka>
Status: CLOSED FIXED QA Contact: qa-sisyphus
Severity: normal    
Priority: P5 CC: antohami, cas, cow, evg, george, grenka, imz, kotopesutility, lav, nbr, qa_viy, rider, sem, shaba, sin, slev, toni, vitty, viy
Version: unstable   
Hardware: x86_64   
OS: Linux   

Description Vitaly Lipatov 2021-07-14 14:22:02 MSK
$ python3
> import slugify

  File "/usr/lib/python3/site-packages/slugify/slugify.py", line 17, in <module>
    import text_unidecode as unidecode
ModuleNotFoundError: No module named 'text_unidecode'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/opensnitch-ui", line 18, in <module>
    from opensnitch.service import UIService
  File "/usr/lib/python3/site-packages/opensnitch/service.py", line 19, in <module>
    from dialogs.prompt import PromptDialog
  File "/usr/lib/python3/site-packages/opensnitch/dialogs/prompt.py", line 10, in <module>
    from slugify import slugify
  File "/usr/lib/python3/site-packages/slugify/__init__.py", line 2, in <module>
    from .slugify import *
  File "/usr/lib/python3/site-packages/slugify/slugify.py", line 19, in <module>
    import unidecode
ModuleNotFoundError: No module named 'unidecode'

В модуле используется перебор для получения name2codepoint и unidecode . Нужно обеспечить наличие желаемого модуля добавлением зависимости в пакет.

Код перебора:
try:
    from htmlentitydefs import name2codepoint
    _unicode = unicode
    _unicode_type = types.UnicodeType
except ImportError:
    from html.entities import name2codepoint
    _unicode = str
    _unicode_type = str
    unichr = chr

try:
    import text_unidecode as unidecode
except ImportError:
    import unidecode
Comment 1 Grigory Ustinov 2023-02-08 16:38:44 MSK
* Fri Mar 11 2022 Stanislav Levin <slev@altlinux.org> 6.1.1-alt1
- 4.0.1 -> 6.1.1.