Skip to content

Commit dcd3c78

Browse files
xcp/accessor.py: MountingAccessor.writeFile(): use mode="wb"
Fix MountingAccessor.writeFile() for binary files as checked by the new test in tests/test_mountingaccessor.py: check_binary_write() Signed-off-by: Bernhard Kaindl <bernhard.kaindl@cloud.com>
1 parent 2bcf6b6 commit dcd3c78

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xcp/accessor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def finish(self):
161161

162162
def writeFile(self, in_fh, out_name):
163163
logger.info("Copying to %s" % os.path.join(self.location, out_name))
164-
out_fh = open(os.path.join(self.location, out_name), 'w')
164+
out_fh = open(os.path.join(self.location, out_name), "wb")
165165
return self._writeFile(in_fh, out_fh)
166166

167167
def __del__(self):

0 commit comments

Comments
 (0)