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

fix coding in 2 files #204

Merged
merged 1 commit into from Aug 6, 2022
Merged

fix coding in 2 files #204

merged 1 commit into from Aug 6, 2022

Conversation

aleksandernovikov
Copy link
Contributor

Corrected typos in the name of the encoding. It was in 2 files. In my Django project, because of this, it did not work i18n

@Ousret
Copy link
Owner

Ousret commented Aug 5, 2022

Could you provide a minimum reproducer so I could understand better the case.

@aleksandernovikov
Copy link
Contributor Author

https://github.com/aleksandernovikov/django_charset_normalizer
Here an example project with readme.

@Ousret
Copy link
Owner

Ousret commented Aug 5, 2022

Thanks for the detailed reproducer. Quickly I could try your repository using Python 3.10 and 3.8.
On Python 3.10 nothing breaks, could not reproduce.

On the other side using Python 3.8, it does break. What I noted is:

File "/home/ahmed/PycharmProjects/django_charset_normalizer/venv/lib/python3.8/site-packages/wheel/macosx_libfile.py", line 41, in <module>
          import ctypes
        File "/home/ahmed/.pyenv/versions/3.8.0/lib/python3.8/ctypes/__init__.py", line 7, in <module>
          from _ctypes import Union, Structure, Array
      ModuleNotFoundError: No module named '_ctypes'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for martor

...

python manage.py makemessages -l ru
CommandError: errors happened while running xgettext on ./django_charset_normalizer/__init__.py
./django_charset_normalizer/asgi.py
./django_charset_normalizer/settings.py
./django_charset_normalizer/urls.py
./django_charset_normalizer/wsgi.py
...................
./venv/lib/python3.8/site-packages/wheel/vendored/packaging/tags.py
./venv/lib/python3.8/site-packages/wheel/wheelfile.py
xgettext: ./venv/lib/python3.8/site-packages/charset_normalizer/__init__.py:1: Encodage « utf_8 » inconnu. Traitement effectué en ASCII.
xgettext: Non-ASCII string at ./venv/lib/python3.8/site-packages/charset_normalizer/__init__.py:12.
          Veuillez spécifier l'encodage de la source avec l'option « --from-code » ou avec un commentaire
          comme spécifié sur la page https://www.python.org/peps/pep-0263.html.

It is a bit weird for sure. xgettext + python 3.8 + i18n + django.
The easiest path moving forward is to change our encoding header. It is safe to patch.

@Ousret Ousret self-requested a review August 5, 2022 12:58
@Ousret Ousret merged commit d61def2 into Ousret:master Aug 6, 2022
@Ousret Ousret mentioned this pull request Aug 19, 2022
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

Successfully merging this pull request may close these issues.

None yet

3 participants