mau_mau_bot icon indicating copy to clipboard operation
mau_mau_bot copied to clipboard

internationalization.py line 38

Open Sh1vam opened this issue 4 years ago • 10 comments

it gives error of this type:

\mau_mau_bot-master\internationalization.py", line 38, in open(gettext.find( TypeError: expected str, bytes or os.PathLike object, not NoneType

the code is: def init(self): self.translators = { locale: gettext.GNUTranslations( open(gettext.find( GETTEXT_DOMAIN, GETTEXT_DIR, languages=[locale] ), 'rb') ) for locale in available_locales.keys() if locale != 'en_US' # No translation file for en_US } self.locale_stack = list()

Sh1vam avatar Sep 25 '20 14:09 Sh1vam

More specifically, when this happens?

DO97 avatar Oct 02 '20 12:10 DO97

More specifically, when this happens?

when i was trying to run it on my PC

Sh1vam avatar Oct 06 '20 13:10 Sh1vam

same issue here

python3 bot.py
Traceback (most recent call last):
  File "bot.py", line 30, in <module>
    import settings
  File "/home/pi/unoplusbot/mau_mau_bot/settings.py", line 24, in <module>
    from utils import send_async
  File "/home/pi/unoplusbot/mau_mau_bot/utils.py", line 25, in <module>
    from internationalization import _, __
  File "/home/pi/unoplusbot/mau_mau_bot/internationalization.py", line 81, in <module>
    _ = _Underscore()
  File "/home/pi/unoplusbot/mau_mau_bot/internationalization.py", line 43, in __init__
    in available_locales.keys()
  File "/home/pi/unoplusbot/mau_mau_bot/internationalization.py", line 44, in <dictcomp>
    if locale != 'en_US'  # No translation file for en_US
TypeError: expected str, bytes or os.PathLike object, not NoneType

retiolus avatar Mar 12 '21 19:03 retiolus

did you follow the instructions in the readme, specifically about compiling the translation files?

jh0ker avatar Mar 12 '21 20:03 jh0ker

did you follow the instructions in the readme, specifically about compiling the translation files?

Yes

retiolus avatar Mar 14 '21 13:03 retiolus

This error usually happens if you're missing a .mo file for one or more of your translations. Confirm that you have a .mo file for every .po file, eg. locales/de_DE/LC_MESSAGES/unobot.mo. If you added custom translations, they have to be added in the locales/compile.sh script.

I suggest you ensure you're not missing any commits from this repos master branch and re-compile all translations, eg.

cd locales
./compile.sh

jh0ker avatar Mar 14 '21 13:03 jh0ker

compile.sh didn't work for me, made it with the full command... problem fixed! Wasn't executing the command inside the locales folder.

retiolus avatar Mar 15 '21 11:03 retiolus

Same issue in compiling

jofg123 avatar Mar 25 '21 09:03 jofg123

It didn't work the compile.sh

jofg123 avatar Mar 25 '21 09:03 jofg123

I'm not having any issue following the instructions.

DO97 avatar Jul 12 '22 11:07 DO97