Debian Bug report logs - #668226
gettext: Support the new style Python format strings

version graph

Package: gettext; Maintainer for gettext is Santiago Vila <sanvila@debian.org>; Source for gettext is src:gettext.

Reported by: "Rodrigo Silva \(MestreLion\)" <linux@rodrigosilva.com>

Date: Mon, 9 Apr 2012 22:03:02 UTC

Severity: normal

Tags: upstream

Found in version 0.18.1.1-1ubuntu2

Fixed in version gettext/0.18.3-1

Done: Santiago Vila <sanvila@debian.org>

Bug is archived. No further changes may be made.

Forwarded to bug-gnu-gettext@gnu.org

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Santiago Vila <sanvila@debian.org>:
Bug#668226; Package gettext. (Mon, 09 Apr 2012 22:03:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Rodrigo Silva \(MestreLion\)" <linux@rodrigosilva.com>:
New Bug report received and forwarded. Copy sent to Santiago Vila <sanvila@debian.org>. (Mon, 09 Apr 2012 22:03:05 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: "Rodrigo Silva \(MestreLion\)" <linux@rodrigosilva.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: gettext: Support the new style Python format strings
Date: Mon, 09 Apr 2012 18:58:44 -0300
Package: gettext
Version: 0.18.1.1-1ubuntu2
Severity: normal
Tags: upstream

I've stumbled on this issue recently, and while searching if this was
already reported somewhere, I've found upstream bug #30854 in Savannah. Looks
like it wasn't forwarded to neither the old nor the new bug mailing list,
so I'll do it now, make his words mine, and add a few comments on my own:

Mon 23 Aug 2010 05:10:05 PM GMT, original submission by David Planella
https://savannah.gnu.org/bugs/index.php?30854
---------------
Currently the gettext tools support only the old Python string format for
substitutions, that is, %s or %(variable)s type strings.

Python standards PEP 0292 [1] and PEP 3101 [2] recommend the use of $foo
and {foo} strings. More and more Python applications migrate to this new
syntax, and it would make sense for the gettext tools to support it.

The ones I can think, off the top of my head:

    xgettext to extract {foo} and $foo strings from Python files and mark
    them as python-format in the .pot templates
    msgmerge -c to validate those

[1] http://www.python.org/dev/peps/pep-0292/
[2] http://www.python.org/dev/peps/pep-3101/
-----------------

I think he means msgfmt -c, since AFAIK there's no msgmerge -c

A few remarks on my own:

The 3 formats currently co-exist in Python 2:
  %(foo)s is used by the % operator, as in "%(foo)s" % {'foo':bar}
  {foo}   is used by the str.format() method and format() builtin,
          as in "{foo}".format(foo=bar) or format("{foo}",foo=bar)
  $foo    is used by the Template class, as in "$foo".Template(foo=bar)

The % format is deprecated in Python 3, and, while still widely used in
Python 2, its usage for new code is discouraged. format() is the new
standard. See http://docs.python.org/library/stdtypes.html#str.format

That said, I urge gettext to support at least the new format() syntax. If
it's not possible to support 3 different syntax rules simultaneously, at
least give Python users a way to choose one of the sets, using xgettext's
--flag for example



-- System Information:
Debian Release: squeeze/sid
  APT prefers maverick-updates
  APT policy: (500, 'maverick-updates'), (500, 'maverick-security'), (500,
'maverick-backports'), (500, 'maverick')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.35-32-generic (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages gettext depends on:
ii  dpkg               1.15.8.4ubuntu3.1     Debian package management system
ii  gettext-base       0.18.1.1-1ubuntu2     GNU Internationalization utilities
ii  install-info       4.13a.dfsg.1-5ubuntu1 Manage installed documentation in
ii  libc6              2.12.1-0ubuntu10.4    Embedded GNU C Library: Shared lib
ii  libcroco3          0.6.2-1               a generic Cascading Style Sheet (C
ii  libglib2.0-0       2.26.1-0ubuntu1       The GLib library of C routines
ii  libgomp1           4.5.1-7ubuntu2        GCC OpenMP (GOMP) support library
ii  libncurses5        5.7+20100626-0ubuntu1 shared libraries for terminal hand
ii  libunistring0      0.9.3-1               Unicode string library for C
ii  libxml2            2.7.7.dfsg-4ubuntu0.4 GNOME XML library

Versions of packages gettext recommends:
ii  curl                   7.21.0-1ubuntu1.3 Get a file from an HTTP, HTTPS or
ii  wget                   1.12-1.1ubuntu3   retrieves files from the web

Versions of packages gettext suggests:
pn  gettext-doc                   <none>     (no description available)




Reply sent to Santiago Vila <sanvila@unex.es>:
You have marked Bug as forwarded. (Tue, 01 May 2012 13:03:25 GMT) Full text and rfc822 format available.

Message #8 received at 668226-forwarded@bugs.debian.org (full text, mbox):

From: Santiago Vila <sanvila@unex.es>
To: bug-gnu-gettext@gnu.org
Cc: 668226-forwarded@bugs.debian.org, "Rodrigo Silva (MestreLion)" <linux@rodrigosilva.com>
Subject: Bug#668226: gettext: Support the new style Python format strings (fwd)
Date: Tue, 1 May 2012 15:00:31 +0200 (CEST)
Hello.

Received this from the Debian bug system:

---------- Forwarded message ----------
From: "Rodrigo Silva (MestreLion)" <linux@rodrigosilva.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Date: Mon, 09 Apr 2012 18:58:44 -0300
Subject: Bug#668226: gettext: Support the new style Python format strings

Package: gettext
Version: 0.18.1.1-1ubuntu2
Severity: normal
Tags: upstream

I've stumbled on this issue recently, and while searching if this was
already reported somewhere, I've found upstream bug #30854 in Savannah. Looks
like it wasn't forwarded to neither the old nor the new bug mailing list,
so I'll do it now, make his words mine, and add a few comments on my own:

Mon 23 Aug 2010 05:10:05 PM GMT, original submission by David Planella
https://savannah.gnu.org/bugs/index.php?30854
---------------
Currently the gettext tools support only the old Python string format for
substitutions, that is, %s or %(variable)s type strings.

Python standards PEP 0292 [1] and PEP 3101 [2] recommend the use of $foo
and {foo} strings. More and more Python applications migrate to this new
syntax, and it would make sense for the gettext tools to support it.

The ones I can think, off the top of my head:

    xgettext to extract {foo} and $foo strings from Python files and mark
    them as python-format in the .pot templates
    msgmerge -c to validate those

[1] http://www.python.org/dev/peps/pep-0292/
[2] http://www.python.org/dev/peps/pep-3101/
-----------------

I think he means msgfmt -c, since AFAIK there's no msgmerge -c

A few remarks on my own:

The 3 formats currently co-exist in Python 2:
  %(foo)s is used by the % operator, as in "%(foo)s" % {'foo':bar}
  {foo}   is used by the str.format() method and format() builtin,
          as in "{foo}".format(foo=bar) or format("{foo}",foo=bar)
  $foo    is used by the Template class, as in "$foo".Template(foo=bar)

The % format is deprecated in Python 3, and, while still widely used in
Python 2, its usage for new code is discouraged. format() is the new
standard. See http://docs.python.org/library/stdtypes.html#str.format

That said, I urge gettext to support at least the new format() syntax. If
it's not possible to support 3 different syntax rules simultaneously, at
least give Python users a way to choose one of the sets, using xgettext's
--flag for example

[...]




Reply sent to Santiago Vila <sanvila@debian.org>:
You have taken responsibility. (Tue, 16 Jul 2013 10:21:09 GMT) Full text and rfc822 format available.

Notification sent to "Rodrigo Silva \(MestreLion\)" <linux@rodrigosilva.com>:
Bug acknowledged by developer. (Tue, 16 Jul 2013 10:21:09 GMT) Full text and rfc822 format available.

Message #13 received at 668226-close@bugs.debian.org (full text, mbox):

From: Santiago Vila <sanvila@debian.org>
To: 668226-close@bugs.debian.org
Subject: Bug#668226: fixed in gettext 0.18.3-1
Date: Tue, 16 Jul 2013 10:18:55 +0000
Source: gettext
Source-Version: 0.18.3-1

We believe that the bug you reported is fixed in the latest version of
gettext, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 668226@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Santiago Vila <sanvila@debian.org> (supplier of updated gettext package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Tue, 16 Jul 2013 11:32:34 +0200
Source: gettext
Binary: gettext-base gettext gettext-el gettext-doc autopoint libgettextpo0 libasprintf0c2 libgettextpo-dev libasprintf-dev
Architecture: source all amd64
Version: 0.18.3-1
Distribution: unstable
Urgency: low
Maintainer: Santiago Vila <sanvila@debian.org>
Changed-By: Santiago Vila <sanvila@debian.org>
Description: 
 autopoint  - The autopoint program from GNU gettext
 gettext    - GNU Internationalization utilities
 gettext-base - GNU Internationalization utilities for the base system
 gettext-doc - Documentation for GNU gettext
 gettext-el - Emacs po-mode for editing gettext .po files
 libasprintf-dev - GNU Internationalization library development files
 libasprintf0c2 - GNU library to use fprintf and friends in C++
 libgettextpo-dev - GNU Internationalization library development files
 libgettextpo0 - GNU Internationalization library
Closes: 590724 668226
Changes: 
 gettext (0.18.3-1) unstable; urgency=low
 .
   * New upstream release.
   * xgettext now partially supports JavaScript. Closes: #590724.
   * xgettext and msgfmt's format string checking now recognize Python
     format string in braced syntax (PEP 3101). Closes: #668226.
Checksums-Sha1: 
 0f1b4bbc0120260abe1e976acf2cdfb0d4f378d7 1872 gettext_0.18.3-1.dsc
 1ef780d0e56ae174c2781d71790cdf77a276a4a0 16171945 gettext_0.18.3.orig.tar.gz
 ede569af395a4514ea2a55be379988195bb97f6a 43135 gettext_0.18.3-1.debian.tar.gz
 c4deffcbe16938bbad0ca3541b658667c621673e 62642 gettext-el_0.18.3-1_all.deb
 97fbe518bcda23324e8a1ae25f20c2ecda850573 946306 gettext-doc_0.18.3-1_all.deb
 ace45c91d1e106a56d1a3e9798cbe69bee721f0d 393268 autopoint_0.18.3-1_all.deb
 7f72577dceec5e48fd827fd770b6ac8ee7f98986 160744 gettext-base_0.18.3-1_amd64.deb
 8a23d32a8b24fcaad75ac3ddb3494e1dfa50d999 1898172 gettext_0.18.3-1_amd64.deb
 1c8f18e9617028a4227c744ee9fd13510aeed986 152228 libgettextpo0_0.18.3-1_amd64.deb
 96156126773453f86535c2c5ae4ccbec3051c469 29646 libasprintf0c2_0.18.3-1_amd64.deb
 81aa658aaa4be64978c5aca12e8e6313dbd73127 196184 libgettextpo-dev_0.18.3-1_amd64.deb
 c6249965e99cf48cc65c330ef6d2bc80c9beeb14 29566 libasprintf-dev_0.18.3-1_amd64.deb
Checksums-Sha256: 
 331de97cbc906db27f104b318fbb12b29157bb06914fea0b17a3d62dd5652cf6 1872 gettext_0.18.3-1.dsc
 36f3c1043df803565d4977c1efbd41e1ec0f0301acf5f057984406c34cb9f948 16171945 gettext_0.18.3.orig.tar.gz
 e4b66aa92c10405ece532b66ef6cadb79440e2ee01328a834f7871f8ea486f65 43135 gettext_0.18.3-1.debian.tar.gz
 9918260d2cb4f6911c4d44976d1e6c0d5930d4aed8a6a943f2aa1854fe72bad9 62642 gettext-el_0.18.3-1_all.deb
 f221051658d759f8dcc702468b8848f848b11a2f45b891986b2e8f06c7ba92fa 946306 gettext-doc_0.18.3-1_all.deb
 85ef5de5086e4c1e58cffd29390432e1141309d1716037d5f08a296bca95a384 393268 autopoint_0.18.3-1_all.deb
 3f2d75704b725bc23eaeaeff2245b471b12405012d88226d8ab5d4a850ee6d3c 160744 gettext-base_0.18.3-1_amd64.deb
 1e878caeea9d15bb8c2a415f39baf6da96f82d0e9bc0e5201cd30c7eef6c8923 1898172 gettext_0.18.3-1_amd64.deb
 bf989ea9b38c3430fe037252a082132f912256fed43b001703ec9ba9a4dc113e 152228 libgettextpo0_0.18.3-1_amd64.deb
 c9a70faefe790aa4614ca9d25f3fc5105aad0e04f54921b841c5d38a14296fe9 29646 libasprintf0c2_0.18.3-1_amd64.deb
 f19c460e29b39ec44df966703f437e99e6fc7e8758185f8b7dda91113bb24237 196184 libgettextpo-dev_0.18.3-1_amd64.deb
 10eaa38b805e177b71b8aaff022ede61065b600c7124e593d6eb3f5217e12016 29566 libasprintf-dev_0.18.3-1_amd64.deb
Files: 
 ed3713c94e45ab7f8c0fbe4e5684d190 1872 devel optional gettext_0.18.3-1.dsc
 3fa4236c41b7e837355de144210207ec 16171945 devel optional gettext_0.18.3.orig.tar.gz
 31283c6414070b6fee34d5a391cae06d 43135 devel optional gettext_0.18.3-1.debian.tar.gz
 0d38be0ac4509d026cc1f05a736945de 62642 lisp optional gettext-el_0.18.3-1_all.deb
 75cbd42d53d81bb6f3104d7aa35a13b3 946306 doc optional gettext-doc_0.18.3-1_all.deb
 6d42df693ea72897d728191e69b3da0c 393268 devel optional autopoint_0.18.3-1_all.deb
 90473e6552a75a95a973e1aa87dcfe0f 160744 utils standard gettext-base_0.18.3-1_amd64.deb
 65fd28f816c6b738a0c4e14098f46dd0 1898172 devel optional gettext_0.18.3-1_amd64.deb
 3500a732d56033348834a84362b40d90 152228 libs optional libgettextpo0_0.18.3-1_amd64.deb
 f707fb908d6b5c0d84f6c77c2e891bdc 29646 libs standard libasprintf0c2_0.18.3-1_amd64.deb
 2b5b6611c8a1547c17806c1bf545f92f 196184 libdevel optional libgettextpo-dev_0.18.3-1_amd64.deb
 b04f20016c19d5f71a76940b90f3b206 29566 libdevel optional libasprintf-dev_0.18.3-1_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQEcBAEBCAAGBQJR5RdDAAoJEEHOfwufG4syG2sH/3Ov9589Hh7sTtQA0oLrjl/V
pknT4WJT7xX8ryrIERsubzsRVmqtw/CEDCNhqGFy4lggJN97Vgo8OmLw9EhANgBL
77awGx5zzemPUMyj01VQpouCLlvkQRR6xO8ENa5KuWRgO2jQPwq/GxRz2ir4ZIwJ
BxJJH6u5nu8N1joPQo6zEeSO3CGv9PzUuFpYef6jVET2ziP/b0OmAa6KEAOv57wO
lDVRCk18haQN/1dvLys5TA+l0IaM8s7kFVUiFUMpd1i8gmdjIc9AlpcKeeiobsyp
JEz5/vHVh5GUtMNitKedzEsz4yRkt5Xdw4pJuh4qEk1ZjVkcwV2MG2wOaNwGkYU=
=TEK6
-----END PGP SIGNATURE-----




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Wed, 14 Aug 2013 07:28:21 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Apr 20 13:35:45 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.