Note that there are some explanatory texts on larger screens.

plurals
  1. PObug in "django-admin.py makemessages" or xgettext call? -> "warning: unterminated string"
    text
    copied!<p><strong>django-admin.py makemessages</strong> dies with errors "warning: unterminated string" on cases where really long strings are wrapped:</p> <pre><code>string = "some text \ more text\ and even more" </code></pre> <p>These strings don't even need to be translated - e.g. sql query strings. The problem goes away when I concatenate the string, but the result looks ugly and it takes time to join them...</p> <p>Does anyone have a problem like this? Have you found a way to fix it?</p> <p>I have the following versions of the tools involved:</p> <p>xgettext-0.17, gettext-0.17, django-1.0.2, python-2.6.2</p> <p>There was a <a href="http://byteflow.su/ticket/107" rel="nofollow noreferrer">ticket</a> on this issue, but it was closed probably because the error appears only in some combination of component versions.</p> <p><strong>EDIT: found the source of problem</strong> - xgettext prints warning messages to sterr and django takes them as fatal errors and quits.</p> <p>return status of xgettext call is 0 - "success". I guess that django should recognize it as success and not quit because of warnings.</p> <p>Interestinly xgettext still extracts backslash-wrapped strings if they need to be translated, but gives warnings in stderr (<em>"unterminated string"</em>) and .po file (<em>"internationalized messages should not contain the `\r' escape sequence"</em>)</p> <p>xgettext call is the following: </p> <pre><code>xgettext -d django -L Python --keyword=gettext_noop \ --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 \ --keyword=ugettext_noop --keyword=ugettext_lazy \ --keyword=ungettext_lazy:1,2 --from-code UTF-8 -o - source_file.py </code></pre> <p>called from django/core/management/commands/makemessages.py</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload