← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:py3-config-fixture into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:py3-config-fixture into launchpad:master.

Commit message:
Make ConfigFixture treat config files as text, not bytes

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/388948
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-config-fixture into launchpad:master.
diff --git a/lib/lp/services/config/fixture.py b/lib/lp/services/config/fixture.py
index 3c7cdca..d79fe37 100644
--- a/lib/lp/services/config/fixture.py
+++ b/lib/lp/services/config/fixture.py
@@ -42,7 +42,7 @@ class ConfigFixture(Fixture):
 
     def add_section(self, sectioncontent):
         """Add sectioncontent to the lazy config."""
-        with open(self.absroot + '/launchpad-lazr.conf', 'ab') as out:
+        with open(self.absroot + '/launchpad-lazr.conf', 'a') as out:
             out.write(sectioncontent)
         # Trigger a refresh if and only if the config is in use at the moment
         # in order to make these new values available.
@@ -59,8 +59,8 @@ class ConfigFixture(Fixture):
             if entry.name == 'launchpad-lazr.conf':
                 self.add_section(self._extend_str % self.copy_from_instance)
                 continue
-            with open(entry.path, 'rb') as input:
-                with open(os.path.join(root, entry.name), 'wb') as out:
+            with open(entry.path) as input:
+                with open(os.path.join(root, entry.name), 'w') as out:
                     out.write(input.read())