[mozprofile] add interpolation function and fix screwy m-c interpolation

RESOLVED WONTFIX

Status

RESOLVED WONTFIX
5 years ago
8 months ago

People

(Reporter: k0scist, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
From https://bugzilla.mozilla.org/show_bug.cgi?id=746243#c42

http://mxr.mozilla.org/mozilla-central/source/build/automation.py.in?rev=a3e34b989ebe#361

Fixed.  The preferences are now identical.  However, the code
is...questionable:

    interpolation = {"server": "%s:%s" % (self.webServer, self.httpPort)}
    prefs = json.loads(json.dumps(prefs) % interpolation)
    for pref in prefs:
        prefs[pref] = Preferences.cast(prefs[pref])

We dump and load the preferences to get string interpolation which is
probably bad.  More mysteriously, we call Preferences.cast() on each
preference....which should be completely redundant and can only do bad
things (that is, eliminate string quotes which were intended; unlikely
and does not happen in production, but still):

https://github.com/mozilla/mozbase/blob/master/mozprofile/mozprofile/prefs.py#L57

Instead, we should add an `interpolate` function in mozprofile
Preferences and kill all this code.

This bug involves:
1. adding a function to interpolate in mozprofile.prefs.Preferences
1.+ and a test!
2. releasing a new mozprofile version and mirroring to m-c
3. fixing m-c code to use the new function
I added an interpolation function in bug 881714. I was too lazy to cherry-pick that patch to m-c, and then I forgot about it. We just need to update the prefs_general.js file to use new-style Python interpolation, and update its consumers.

Comment 2

8 months ago
Mass closing bugs with no activity in 2+ years. If this bug is important to you, please re-open.
Status: NEW → RESOLVED
Last Resolved: 8 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.