Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#105 Fix coding: utf8 -> utf-8 (with dash) header in Python files

None
closed-fixed
nobody
None
5
2013-07-03
2013-05-23
Sergey Shepelev
No

When I run manage.py makemessages --all in some closed source Django project which uses docutils installed in virtualenv, I get this error:

Error: errors happened while running xgettext on lt.py
xgettext: ./venv/lib/python2.7/site-packages/docutils/parsers/rst/languages/lt.py:1: Unknown encoding "utf8". Proceeding with ASCII instead.
xgettext: Non-ASCII string at ./venv/lib/python2.7/site-packages/docutils/parsers/rst/languages/lt.py:21.
Please specify the source encoding through --from-code or through a comment
as specified in http://www.python.org/peps/pep-0263.html.

While Python itself is liberate enough on # encoding header, by standard proper name of UTF-8 includes dash.

Please, accept this patch that changes coding header to utf-8 with dash. It fixes my problem.

1 Attachments

Discussion

  • Günter Milde
    Günter Milde
    2013-06-04

    I agree that a consistent naming is preferable and will change the comments to
    "coding: utf-8". -> Done in revision 7668

    However, please consider a bug report to the used Python variant, as both
    utf8 and utf-8 are valid aliases for the codec "utf_8".
    (I cannot see a preference for an alias with hyphen in
    http://docs.python.org/2/library/codecs.html)

     
  • Günter Milde
    Günter Milde
    2013-06-04

    • status: open --> closed-fixed