Closed Bug 1170038 Opened 9 years ago Closed 9 years ago

Invalid string formatting in refdata.py _add_platform() and _add_name_and_symbol()

Categories

(Tree Management :: Treeherder, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: emorley, Unassigned)

Details

In _add_platform(): https://github.com/mozilla/treeherder/blob/acbc0b6d362880e2a3dbae7ae2ffda0d1ce33bd4/treeherder/model/derived/refdata.py#L438 # WHERE clause for the retrieval SELECT where_filters.append( "(`os_name` = %s AND `platform` = %s AND `architecture` = %s)".format( os_name, platform, arch ) ) In _add_name_and_symbol(): https://github.com/mozilla/treeherder/blob/acbc0b6d362880e2a3dbae7ae2ffda0d1ce33bd4/treeherder/model/derived/refdata.py#L499 where_filters.append( "(`name` = %s AND `symbol` = %s)".format(name, symbol) ) Using "%s" with .format() doesn't work. eg: >>> print "(`name` = %s AND `symbol` = %s)".format("Foo", "F") (`name` = %s AND `symbol` = %s) So not sure how this is currently working? Changing the "%s" to "{}" causes tests to fail... unless we're testing broken behaviour?
This code is no longer operative.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.