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

Submitter:  None
Submitted:  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:  m1gu3l
Open/Closed:  Closed

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

Works for me as well, closing.

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

It is already fixed at some release since 2010.

<code>
$ xgettext --add-comments isjpeg.py -o -
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, 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 ""
</code>

Miguel Ángel Arruga Vivas <m1gu3l>
Group Member
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).

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    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.13-f8d8.
    Corresponding source code