bugGNU gettext - Bugs: bug #30558, xgettext chokes on string literals...


You are not allowed to post comments on this tracker with your current authentication level.

bug #30558: xgettext chokes on string literals not being extracted

Submitted by:  None
Submitted on:  Tue 27 Jul 2010 01:58:27 AM UTC  
Category:  Python Severity:  3 - Normal
Item Group:  None Status:  Works For Me
Privacy:  Public Assigned to:  Miguel Ángel Arruga Vivas <m1gu3l>
Open/Closed:  Closed

Wed 26 Mar 2014 09:53:40 AM UTC, comment #2:

Works for me as well, closing.

Daiki Ueno <ueno>
Project Administrator
Tue 29 Jan 2013 03:08:28 PM UTC, comment #1:

It is already fixed at some release since 2010.

$ xgettext --add-comments isjpeg.py -o -
# This file is distributed under the same license as the PACKAGE package.
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-01-29 16:06+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: isjpeg.py:9
#, python-format
msgid "%s looks like a JPEG file"
msgstr ""

#: isjpeg.py:11
#, python-format
msgid "%s does not look like a JPEG file"
msgstr ""

#: isjpeg.py:16
#, python-format
msgid "Usage: %s <filename>"
msgstr ""

Miguel Ángel Arruga Vivas <m1gu3l>
Project MemberIn charge of this item.
Tue 27 Jul 2010 01:58:27 AM UTC, original submission:

Attached is a simple example where xgettext chokes on a string literal ('\xff\xd8' representing a binary JPEG header) which is not supposed to be processed at all as it is not passed to a translation function and the --extract-all option was not specified.

$ xgettext isjpeg.py
xgettext: Non-ASCII string at isjpeg.py:5.
Please specify the source encoding through --from-code.

xgettext should ignore string literals which are not being extracted. This is particularly a problem in languages such as Python (< 3.0) where there is no clear distinction between binary strings and text strings.

(BTW the error message above is doubly wrong because the --from-code option is not available for Python).



Attached Files
file #21079:  isjpeg.py added by None (513B - text/plain - corrected example python source file)
file #21078:  isjpeg.py added by None (513B - text/plain - example python source file)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by haible (Updated the item)
  • -email is unavailable- added by ueno (Posted a comment)
  • -email is unavailable- added by m1gu3l (Posted a comment)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-27 haible CategoryNone => Python
    2014-03-26 ueno StatusNeed Info => Works For Me
        Open/ClosedOpen => Closed
    2013-03-01 m1gu3l StatusNone => Need Info
        Assigned toNone => m1gu3l
    2010-07-27 None Attached File- => Added isjpeg.py, #21079
    2010-07-27 None Attached File- => Added isjpeg.py, #21078

    Back to the top

    Powered by Savane 3.3