Merge lp:~brian.curtin/ubuntuone-control-panel/is_link-bytes into lp:ubuntuone-control-panel

Proposed by Brian Curtin on 2012-11-08
Status: Merged
Approved by: Mike McCracken on 2012-11-13
Approved revision: 381
Merged at revision: 382
Proposed branch: lp:~brian.curtin/ubuntuone-control-panel/is_link-bytes
Merge into: lp:ubuntuone-control-panel
Diff against target: 13 lines (+2/-1)
1 file modified
ubuntuone/controlpanel/gui/qt/folders.py (+2/-1)
To merge this branch: bzr merge lp:~brian.curtin/ubuntuone-control-panel/is_link-bytes
Reviewer Review Type Date Requested Status
Mike McCracken (community) Approve on 2012-11-13
Michał Karnicki (community) 2012-11-08 Approve on 2012-11-08
Review via email: mp+133559@code.launchpad.net

Commit Message

- Encode the volume path before checking whether or not it is a link.

Description of the Change

Choosing to subscribe to a folder while on Windows is causing an AssertionError inside ubuntuone.platform.is_link because it expects to be working with encoded bytes but is given Unicode. This isn't a problem on Unix systems as the is_link function is a pass-through to os.path.islink which can accept either bytes or Unicode.

To post a comment you must log in.
Michał Karnicki (karni) :
review: Approve
Mike McCracken (mikemc) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/controlpanel/gui/qt/folders.py'
2--- ubuntuone/controlpanel/gui/qt/folders.py 2012-08-07 01:37:24 +0000
3+++ ubuntuone/controlpanel/gui/qt/folders.py 2012-11-08 21:00:27 +0000
4@@ -331,7 +331,8 @@
5 os.path.exists(volume_path))
6 response = YES
7 if subscribed and os.path.exists(volume_path):
8- if os.path.isdir(volume_path) and not is_link(volume_path):
9+ if (os.path.isdir(volume_path) and not
10+ is_link(volume_path.encode("utf8"))):
11 text = FOLDERS_CONFIRM_MERGE % {'folder_path': volume_path}
12 buttons = YES | NO | CANCEL
13 response = QtGui.QMessageBox.warning(self, '', text, buttons,

Subscribers

People subscribed via source and target branches