Mercurial > bitten > bitten-test
changeset 659:075087a17f06
0.6dev: Follow-up to [703] - forgot to read files as binary. Closes #435.
author | osimons |
---|---|
date | Wed, 26 Aug 2009 20:08:06 +0000 |
parents | b3237a5ace1d |
children | 3a7a1ca990ff |
files | bitten/recipe.py |
diffstat | 1 files changed, 1 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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: