changeset 248:15d8d8c809f0

Some minor fixes: * Make sure the order of build steps is deterministic in the unit test for `BuildStep.select()`. * Fix typo (extra space) that prevented fixing the encoding in the XML file generated by MSXML
author cmlenz
date Tue, 04 Oct 2005 11:14:11 +0000
parents b28285d3ceec
children dcba83c01266
files bitten/build/xmltools.py bitten/tests/model.py bitten/util/archive.py
diffstat 3 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/bitten/build/xmltools.py
+++ b/bitten/build/xmltools.py
@@ -71,7 +71,7 @@
         # MSXML seems to always write produce the resulting XML document using
         # UTF-16 encoding, regardless of the encoding specified in the
         # stylesheet. For better interoperability, recode to UTF-8 here.
-        result = result.encode('utf-8').replace('  encoding="UTF-16"?>', '?>')
+        result = result.encode('utf-8').replace(' encoding="UTF-16"?>', '?>')
 
         dest_file = file(ctxt.resolve(dest), 'w')
         try:
--- a/bitten/tests/model.py
+++ b/bitten/tests/model.py
@@ -378,8 +378,8 @@
         db = self.env.get_db_cnx()
         cursor = db.cursor()
         cursor.executemany("INSERT INTO bitten_step VALUES (%s,%s,%s,%s,%s,%s)",
-                           [(1, 'test', 'Foo bar', BuildStep.SUCCESS, 0, 0),
-                            (1, 'dist', 'Foo baz', BuildStep.FAILURE, 0, 0)])
+                           [(1, 'test', 'Foo bar', BuildStep.SUCCESS, 1, 2),
+                            (1, 'dist', 'Foo baz', BuildStep.FAILURE, 2, 3)])
 
         steps = list(BuildStep.select(self.env, build=1))
         self.assertEqual(1, steps[0].build)
--- a/bitten/util/archive.py
+++ b/bitten/util/archive.py
@@ -157,8 +157,8 @@
     if format in ('bzip2', 'gzip'):
         try:
             tar_file = tarfile.open(filename)
-            tar_file.chown = lambda *args: None # Don't chown extracted members
             try:
+                tar_file.chown = lambda *args: None # Don't chown extracted members
                 for tarinfo in tar_file:
                     if tarinfo.isfile() or tarinfo.isdir():
                         if tarinfo.name.startswith('/') or '..' in tarinfo.name:
Copyright (C) 2012-2017 Edgewall Software