Merge lp:~diegosarmentero/ubuntuone-client/udf-issue into lp:ubuntuone-client

Proposed by Diego Sarmentero
Status: Merged
Approved by: Natalia Bidart
Approved revision: 1184
Merged at revision: 1184
Proposed branch: lp:~diegosarmentero/ubuntuone-client/udf-issue
Merge into: lp:ubuntuone-client
Diff against target: 54 lines (+16/-3)
3 files modified
tests/syncdaemon/test_vm_helper.py (+15/-0)
ubuntuone/platform/__init__.py (+0/-1)
ubuntuone/syncdaemon/vm_helper.py (+1/-2)
To merge this branch: bzr merge lp:~diegosarmentero/ubuntuone-client/udf-issue
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
Brian Curtin (community) Approve
Review via email: mp+90208@code.launchpad.net

Commit message

Fixed: Problem trying to create an udf with unicode username (LP: #921703 ).

To post a comment you must log in.
1183. By Diego Sarmentero

Adding missing docstring

1184. By Diego Sarmentero

Fixed unicode automatic promotion

Revision history for this message
Brian Curtin (brian.curtin) wrote :

+1

review: Approve
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Looks and works great!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/syncdaemon/test_vm_helper.py'
--- tests/syncdaemon/test_vm_helper.py 2012-01-04 13:18:50 +0000
+++ tests/syncdaemon/test_vm_helper.py 2012-01-25 21:09:23 +0000
@@ -66,6 +66,21 @@
66 in_home = os.path.join(self.home_dir, 'foo')66 in_home = os.path.join(self.home_dir, 'foo')
67 self.assertEqual(u'~/foo', get_udf_suggested_path(in_home))67 self.assertEqual(u'~/foo', get_udf_suggested_path(in_home))
6868
69 def test_get_udf_suggested_path_expand_user_decode(self):
70 """Test for get_udf_suggested_path."""
71 home = os.path.join(self.home_dir.decode('utf-8'),
72 u'雄鳥お人好し ñandú')
73
74 def fake_expand_user(path):
75 """Fake expand_user."""
76 return home.encode('utf-8')
77
78 self.patch(vm_helper, 'expand_user', fake_expand_user)
79 in_home = os.path.join(home, u'ñoño')
80 in_home = in_home.encode('utf-8')
81 suggested_path = get_udf_suggested_path(in_home)
82 self.assertEqual(u'~/ñoño', suggested_path)
83
69 def test_get_udf_suggested_path_long_path(self):84 def test_get_udf_suggested_path_long_path(self):
70 """Test for get_udf_suggested_path."""85 """Test for get_udf_suggested_path."""
71 deep_in_home = os.path.join(self.home_dir, 'docs', 'foo', 'bar')86 deep_in_home = os.path.join(self.home_dir, 'docs', 'foo', 'bar')
7287
=== modified file 'ubuntuone/platform/__init__.py'
--- ubuntuone/platform/__init__.py 2011-12-08 20:56:10 +0000
+++ ubuntuone/platform/__init__.py 2012-01-25 21:09:23 +0000
@@ -37,7 +37,6 @@
3737
38def expand_user(path):38def expand_user(path):
39 """Fix Python expanduser for weird chars in windows."""39 """Fix Python expanduser for weird chars in windows."""
40 # Receives bytes, returns unicode
41 assert isinstance(path, str)40 assert isinstance(path, str)
42 try:41 try:
43 path.decode('utf-8')42 path.decode('utf-8')
4443
=== modified file 'ubuntuone/syncdaemon/vm_helper.py'
--- ubuntuone/syncdaemon/vm_helper.py 2011-11-17 18:38:41 +0000
+++ ubuntuone/syncdaemon/vm_helper.py 2012-01-25 21:09:23 +0000
@@ -89,12 +89,11 @@
89 """89 """
90 if not path:90 if not path:
91 raise ValueError("no path specified")91 raise ValueError("no path specified")
92
93 assert isinstance(path, str)92 assert isinstance(path, str)
9493
95 path = path.decode('utf8')94 path = path.decode('utf8')
9695
97 user_home = expand_user('~')96 user_home = expand_user('~').decode('utf-8')
98 start_list = os.path.abspath(user_home).split(os.path.sep)97 start_list = os.path.abspath(user_home).split(os.path.sep)
99 path_list = os.path.abspath(path).split(os.path.sep)98 path_list = os.path.abspath(path).split(os.path.sep)
10099

Subscribers

People subscribed via source and target branches