Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upqubes-manager: UnicodeEncodeError when restoring from backup #1859
Comments
marmarek
added
bug
C: qubes-manager
P: minor
labels
Mar 20, 2016
marmarek
added this to the Release 3.0 updates milestone
Mar 20, 2016
marmarek
modified the milestones:
Release 3.0 updates,
Release 3.1 updates
Nov 19, 2016
andrewdavidwong
modified the milestones:
Release 3.1 updates,
Release 3.2 updates
May 31, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
donob4n
Feb 20, 2018
Maybe it's different issue but is likely related. After doing a properly recover I got an UnicodeEncodeError and after click ok I entered in an infinite loop trying to close the restore window.
The relevant code is:
def reject(self):
if self.currentPage() is self.commit_page:
if backup.backup_cancel():
self.emit(SIGNAL("restore_progress(QString)"),
'<font color="red">{0}</font>'
.format(self.tr("Aborting the operation...")))
self.button(self.CancelButton).setDisabled(True)
else:
self.done(0)
And the line raising UnicodeEncodeError:
.format(self.tr("Aborting the operation...")))
I guess it's problem with the Spanish translation and accents.
donob4n
commented
Feb 20, 2018
|
Maybe it's different issue but is likely related. After doing a properly recover I got an UnicodeEncodeError and after click ok I entered in an infinite loop trying to close the restore window. The relevant code is:
And the line raising UnicodeEncodeError: I guess it's problem with the Spanish translation and accents. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
donob4n
Feb 20, 2018
I fixed this adding 'u' for forcing unicode:
self.emit(SIGNAL("restore_progress(QString)"),
u'<font color="red">{0}</font>'
.format(self.tr("Aborting the operation...")))
I was going to fix similar bugs but I see there are already some unicode() calls which do same effect. Do you see fine if I change all of them to this way or prefer unicode() method?
I also see some similar problems on Qubes 4 version.
donob4n
commented
Feb 20, 2018
•
|
I fixed this adding 'u' for forcing unicode:
I was going to fix similar bugs but I see there are already some unicode() calls which do same effect. Do you see fine if I change all of them to this way or prefer unicode() method? I also see some similar problems on Qubes 4 version. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Feb 20, 2018
Member
Do you see fine if I change all of them to this way or prefer unicode() method?
u'' is fine on string constants
I also see some similar problems on Qubes 4 version.
It shouldn't be an issue there, because qubes-manager was ported to python 3 there, which use unicode by default.
u'' is fine on string constants
It shouldn't be an issue there, because qubes-manager was ported to python 3 there, which use unicode by default. |
added a commit
to donob4n/qubes-manager
that referenced
this issue
Feb 21, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
donob4n
Feb 21, 2018
Ok @marmarek
I've fixed the translations problems with donob4n/qubes-manager@f3a16c4
I will look for more potentially similar problems on qubes-manager.
For this current issue I did some steps forward, but I found a problem in https://github.com/QubesOS/qubes-core-admin/blob/19d55b546352c61b88990a8fc6b38f568955a81d/core/backup.py#L491
It seems that I tries to convert the utf8 string into asci for writing into the pipeline. I was trying to enable utf8 encoding but I'm pretty worried if this could break other things.
UPDATE:
Well it seems working fine with:
vmproc.stdin.write((base_backup_dir.replace("\r", "").replace("\n", "") + "\n").enconde('utf-8'))
Except I don't know why the "select dir" window doesn't appear after finishing when using a utf8 path.
donob4n
commented
Feb 21, 2018
•
|
Ok @marmarek I've fixed the translations problems with donob4n/qubes-manager@f3a16c4 I will look for more potentially similar problems on qubes-manager. For this current issue I did some steps forward, but I found a problem in https://github.com/QubesOS/qubes-core-admin/blob/19d55b546352c61b88990a8fc6b38f568955a81d/core/backup.py#L491 It seems that I tries to convert the utf8 string into asci for writing into the pipeline. I was trying to enable utf8 encoding but I'm pretty worried if this could break other things. UPDATE: Well it seems working fine with:
Except I don't know why the "select dir" window doesn't appear after finishing when using a utf8 path. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Feb 21, 2018
Member
I've fixed the translations problems with donob4n/qubes-manager@f3a16c4
Well it seems working fine with:
Care to create pull request with those?
Except I don't know why the "select dir" window doesn't appear after finishing when using a utf8 path.
Probably similar thing - the window is opened by a call to qubes.SelectDirectory service and the path is piped on its stdin. See here: https://github.com/QubesOS/qubes-manager/blob/release3.2/qubesmanager/backup_utils.py#L59
Care to create pull request with those?
Probably similar thing - the window is opened by a call to |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
donob4n
Feb 21, 2018
Care to create pull request with those?
Yes, let me check if there is another translation problem and try to fix the unicode path and I will request a pull with all together.
donob4n
commented
Feb 21, 2018
•
Yes, let me check if there is another translation problem and try to fix the unicode path and I will request a pull with all together. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
donob4n
Feb 21, 2018
It works fine, just failed because I binded the device to a unicode dir without "media" on the path.
donob4n
commented
Feb 21, 2018
•
|
It works fine, just failed because I binded the device to a unicode dir without "media" on the path. |
added a commit
to donob4n/qubes-manager
that referenced
this issue
Feb 21, 2018
donob4n
referenced this issue
in QubesOS/qubes-manager
Feb 21, 2018
Merged
Fix UnicodeErrors with translations and Unicode path's when restoring backup #73
added a commit
to donob4n/qubes-manager
that referenced
this issue
Feb 21, 2018
added a commit
to donob4n/qubes-core-admin
that referenced
this issue
Feb 21, 2018
donob4n
referenced this issue
in QubesOS/qubes-core-admin
Feb 21, 2018
Merged
Fix UnicodeEncodeError when using Unicode path #196
added a commit
to donob4n/qubes-core-admin
that referenced
this issue
Feb 21, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
donob4n
commented
Jul 15, 2018
|
@andrewdavidwong I think this is already fixed. |
pdinoto commentedMar 20, 2016
Restoring from a path with accented characters results in
and variations of the same error. This one is triggered by pasting a path with unicode chars into Backup File: text field.
Selecting a valid restore file inside a disk mounted on a path with unicode characters triggers same error later in the process, after selecting which VMs to restore and right after showing the restore progress dialog. In that case, error happens at different code:
More info can be found on the original mailing list post