# HG changeset patch # User cmlenz # Date 1128424451 0 # Node ID 15d8d8c809f0822c745e4c3f280e069758c8a19b # Parent b28285d3ceecd552d1f65260b962c6a7bcbb6bee 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 diff --git a/bitten/build/xmltools.py b/bitten/build/xmltools.py --- 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: diff --git a/bitten/tests/model.py b/bitten/tests/model.py --- 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) diff --git a/bitten/util/archive.py b/bitten/util/archive.py --- 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: