# HG changeset patch # User osimons # Date 1251317286 0 # Node ID 075087a17f069fc5694e37c06501b95334763dfa # Parent b3237a5ace1dc3a6559770c31c802c6fe4b1a2a6 0.6dev: Follow-up to [703] - forgot to read files as binary. Closes #435. diff --git a/bitten/recipe.py b/bitten/recipe.py --- a/bitten/recipe.py +++ b/bitten/recipe.py @@ -170,11 +170,10 @@ :param description: description saved with attachment :resource: which resource to attach the file to, either 'build' (default) or 'config' - :replace: non-empty to replace existing attachment with same name """ filename = self.resolve(file_) try: - fileobj = file(filename, 'r') + fileobj = open(filename, 'rb') try: xml_elem = xmlio.Element('file', filename=os.path.basename(filename), @@ -182,7 +181,6 @@ resource=resource or 'build') xml_elem.append(fileobj.read().encode('base64')) self.output.append((Recipe.ATTACH, None, None, xml_elem)) - finally: fileobj.close() except IOError, e: