Pass unicode to io.open

We must pass unicode objects (unicode in py2, str in py3) to io.open,
otherwise it would fail with:

    TypeError: can't write str to text stream

Change-Id: I9d2ba46ae6b967feb64fe180f9a6ce85918b0791
Closes-Bug: #1509325
This commit is contained in:
Igor Kalnitsky 2015-10-23 15:00:51 +03:00
parent 2892f44d28
commit e4056a7923
No known key found for this signature in database
GPG Key ID: 38306881ADFE39E4

View File

@ -529,10 +529,10 @@ class Manager(object):
# a corresponding file system will never be checked. We assume
# puppet or other configuration tool will care of it.
if fs.mount == '/':
f.write('UUID=%s %s %s defaults,errors=panic 0 0\n' %
f.write(u'UUID=%s %s %s defaults,errors=panic 0 0\n' %
(mount2uuid[fs.mount], fs.mount, fs.type))
else:
f.write('UUID=%s %s %s defaults 0 0\n' %
f.write(u'UUID=%s %s %s defaults 0 0\n' %
(mount2uuid[fs.mount], fs.mount, fs.type))
self.umount_target(chroot)