After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 330948 - intltool-update -m warns about quoting in Python files
intltool-update -m warns about quoting in Python files
Status: RESOLVED FIXED
Product: intltool
Classification: Deprecated
Component: general
0.36.x
Other All
: Normal minor
: ---
Assigned To: intltool maintainers
intltool maintainers
Depends on:
Blocks:
 
 
Reported: 2006-02-13 02:39 UTC by Richard Laager
Modified: 2009-07-13 06:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Multiline python strings (1.48 KB, patch)
2008-04-12 21:13 UTC, Claude Paroz
none Details | Review

Description Richard Laager 2006-02-13 02:39:48 UTC
Please describe the problem:
The spurious warnings happen on code like this: 
    if code == 102:                     # let's talk 
 
As well as (and this is the more serious problem) any code that uses multiline 
quotes: 
 
"""This 
is 
all 
one 
string.""" 
 
(In case Bugzilla wraps this, the words above were each on their own line.) 

Steps to reproduce:
1. Checkout Gaim CVS 
2. cd po 
3. intltool-update -m 
 

Actual results:
mismatched quotes at line 161 in ../src/gaim-remote.py 
mismatched quotes at line 185 in ../src/gaim-remote.py 
mismatched quotes at line 190 in ../src/gaim-remote.py 
 
If you checkout Gaim CVS from 2006-02-11, also these errors: 
mismatched quotes at line 62 in ../src/gaim-notifications-example.py 
mismatched quotes at line 80 in ../src/gaim-notifications-example.py 
mismatched quotes at line 81 in ../src/gaim-notifications-example.py 

Expected results:
No warnings. 

Does this happen every time?
Yes. 

Other information:
Comment 1 Claude Paroz 2007-07-30 11:24:18 UTC
Confirmed in 0.35.5
Comment 2 Richard Laager 2008-01-13 16:04:22 UTC
This is still a problem in intltool 0.36.2. Now that we have more Python code (in Pidgin), we're getting even more useless errors.
Comment 3 Claude Paroz 2008-04-11 08:05:00 UTC
This recipe may be a good inspirational material:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/475109
Comment 4 Rodney Dawes 2008-04-12 19:27:40 UTC
Perhaps removing "py" from the gettext builtin support list in intltool-update would be enough for now, until we can fix this properly? Looking at the code, I don't see that this would have any real adverse effects. It would keep this warning suprressed, but it would mean that py files no longer show up in the missing list when "intltool-update -m" is being run.

I'm not sure the regex in that python recipe will translate directly to perl, and I'm not sure how exactly one would translate it to perl. My regex-fu isn't that great. But if someone can submit a regex working in perl to satisfy this check, I will gladly work it into the intltool-update code.

Until then would people object skipping py files in the search for leftout files?
Comment 5 Claude Paroz 2008-04-12 21:13:37 UTC
Created attachment 109146 [details] [review]
Multiline python strings

I'm sorry, but I'm unfamiliar with Perl and no regex guru either. But basically this patch (still partially pseudo-code) gives you the idea I'd follow to cope with triple quotes strings in python. Don't know if this makes sense for you...
Comment 6 Rodney Dawes 2009-07-12 21:51:00 UTC
Fixed in bzr trunk now.
Comment 7 Mark Doliner 2009-07-13 06:42:46 UTC
Awesome!