GNOME Bugzilla – Bug 330948
intltool-update -m warns about quoting in Python files
Last modified: 2009-07-13 06:42:46 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:
Confirmed in 0.35.5
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.
This recipe may be a good inspirational material: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/475109
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?
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...
Fixed in bzr trunk now.
Awesome!