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 697614 - giscanner: fix string formatting tuples
giscanner: fix string formatting tuples
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-04-09 08:18 UTC by Dieter Verfaillie
Modified: 2015-02-07 16:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
giscanner: fix string formatting tuples (5.29 KB, patch)
2013-04-09 08:18 UTC, Dieter Verfaillie
none Details | Review
giscanner: fix string formatting tuples (5.34 KB, patch)
2013-04-09 09:09 UTC, Dieter Verfaillie
committed Details | Review

Description Dieter Verfaillie 2013-04-09 08:18:26 UTC
Created attachment 241017 [details] [review]
giscanner: fix string formatting tuples

During review Colin Walters mentioned:

"""
One thing I should probably explain is my habit of *always* passing a
tuple for %.  The reason is pretty simple...a long time ago I had an
error handler that did:  print "unexpected data: %s" % foo.  And I'd
changed the type of "foo" from a string to a tuple at some point.
But this obviously caused "print" to fail because it was expecting
multiple format strings.

Basically always using tuples is safer in case you change the type
of a variable to a tuple.
"""

This fixes violations of this rule introduced up until now.
Comment 1 Dieter Verfaillie 2013-04-09 09:09:13 UTC
Created attachment 241030 [details] [review]
giscanner: fix string formatting tuples

Forgot to add bug link to commit message...
Comment 2 Colin Walters 2013-04-09 13:47:25 UTC
Review of attachment 241030 [details] [review]:

Yep, and thanks a lot for keeping the style consistent.  Maybe I'm the only Python programmer who got bit by this, but anyways, might as well be consistent now.
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-04-09 21:10:00 UTC
(In reply to comment #2)
> Yep, and thanks a lot for keeping the style consistent.  Maybe I'm the only
> Python programmer who got bit by this, but anyways, might as well be consistent
> now.

For what it's worth, I also tend to abide by this rule as well, so I'm happy to see this go by.
Comment 4 Dieter Verfaillie 2013-04-09 21:26:17 UTC
Comment on attachment 241030 [details] [review]
giscanner: fix string formatting tuples

Committed, thanks for the review!
Comment 5 André Klapper 2015-02-07 16:51:27 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]