** Description changed: In my computer, my Music folder has some invalid pathnames, so when trying to calculate the size of it, the CalculateSize thread fails with: 2012-03-19 13:06:33,861 - ubuntuone.controlpanel.qt.folders - ERROR - size_calculator: failed for u'/home/nessita/Music': Traceback (most recent call last): - File "/home/nessita/canonical/controlpanel/computer-to-cloud-page/ubuntuone/controlpanel/gui/qt/folders.py", line 362, in run - for dirpath, _, filenames in os.walk(self.path_name): - File "/usr/lib/python2.7/os.py", line 294, in walk - for x in walk(new_path, topdown, onerror, followlinks): - File "/usr/lib/python2.7/os.py", line 284, in walk - if isdir(join(top, name)): - File "/usr/lib/python2.7/posixpath.py", line 71, in join - path += '/' + b + File "/home/nessita/canonical/controlpanel/computer-to-cloud-page/ubuntuone/controlpanel/gui/qt/folders.py", line 362, in run + for dirpath, _, filenames in os.walk(self.path_name): + File "/usr/lib/python2.7/os.py", line 294, in walk + for x in walk(new_path, topdown, onerror, followlinks): + File "/usr/lib/python2.7/os.py", line 284, in walk + if isdir(join(top, name)): + File "/usr/lib/python2.7/posixpath.py", line 71, in join + path += '/' + b UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in position 12: ordinal not in range(128) And then, the method LocalFoldersPanel.update_sizes never clears the header that reads 'Calculating', since item.size will return None for ever for the Music folder. We need to define a constant to flag the calculation error, and show in the listing something like 'size unknown' for the failing item. + + [Test Case] + 0. Place files with utf8-invalid file names inside the ~/Documents, ~/Music, or ~/Pictures folders for example, which is not synchronized to Ubuntu One. + 1. Ensure the local user account is not connected to an Ubuntu One account yet. + 2. Run ubuntuone-control-panel-qt and create a new account, or log into an existing account. + 3. When stepping through the resulting wizard, and arriving on the "Computer to Cloud" page, the above UnicodeDecodeError should occur, without this fix. With + the fix, size calculation of the local special folders should succeed without problem. + + [Regression Potential] + Minimal. Fix includes unit tests.
-- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/959447 Title: Computer to cloud wizard page: if os.walk fails, 'Calculating' header never goes away To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntuone-control-panel/+bug/959447/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
