Computer to cloud wizard page: if os.walk fails, 'Calculating' header never goes away

Bug #959447 reported by Natalia Bidart
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu One Control Panel
Status tracked in Trunk
Stable-3-0
Fix Released
Undecided
Roberto Alsina
Trunk
Fix Released
High
Roberto Alsina
ubuntuone-control-panel (Ubuntu)
Fix Released
Undecided
Unassigned
Precise
Fix Released
Undecided
Unassigned
Quantal
Fix Released
Undecided
Unassigned

Bug Description

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
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.

Related branches

Changed in ubuntuone-control-panel:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Natalia Bidart (nataliabidart)
Roberto Alsina (ralsina)
Changed in ubuntuone-control-panel:
assignee: Natalia Bidart (nataliabidart) → Roberto Alsina (ralsina)
Changed in ubuntuone-control-panel:
status: Triaged → Fix Committed
dobey (dobey)
Changed in ubuntuone-control-panel (Ubuntu Precise):
milestone: none → precise-updates
Revision history for this message
Brian Murray (brian-murray) wrote :

Thanks for uploading the fix for this bug report to -proposed. However, when reviewing the package in -proposed and the details of this bug report I noticed that this bug is not fixed in the development release of Ubuntu. What are the plans for getting this fixed in Quantal? Additionallly, the bug description is missing required SRU information as described at https://wiki.ubuntu.com/StableReleaseUpdates/#Procedure.

Revision history for this message
Roberto Alsina (ralsina) wrote :

We have not yet opened our stable branches for quantal, but this bug is fixed in trunk, from which that branch will be started, so it will be fixed in the first package we do for quantal.

Leo Arias (elopio)
tags: added: desktop+ wizard
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntuone-control-panel - 3.0.1-0ubuntu1.1

---------------
ubuntuone-control-panel (3.0.1-0ubuntu1.1) quantal; urgency=low

  * New upstream release.
    - Restore window properly when minimized to tray. (LP: #865688)
    - Make CalculateSize use bytes in os.walk. (LP: #959447)
    - Avoid obstruction of spin button hilights. (LP: #966283)
    - Fix external link buttons for RTL locales. (LP: #983665)
    - Avoid launching duplicate instances. (LP: #987909)
    - File sync status reports disabled while syncdaemon is IDLE. (LP: #995146)
  * debian/watch:
    - Update the watch file to use the stable-3-0 series
 -- Rodney Dawes <email address hidden> Tue, 22 May 2012 14:31:30 -0400

Changed in ubuntuone-control-panel (Ubuntu Quantal):
status: New → Fix Released
Revision history for this message
dobey (dobey) wrote :

Now it is fixed in Quantal. :)

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Hello! This bug is attached to an upload in the queue for precise-proposed. However, it does not contain the requisite fields for the SRU team to process the upload. Please add them per the process outlined here. To be more succinct, make sure the bug description lists these fields: "Impact, Dev Fix, Stable Fix, Regression Potential, Test case".

https://wiki.ubuntu.com/StableReleaseUpdates#Procedure

The upload will likely not be looked at by the SRU team until these fields are present.

Thank you!

dobey (dobey)
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Natalia, or anyone else affected,

Accepted ubuntuone-control-panel into precise-proposed. The package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in ubuntuone-control-panel (Ubuntu Precise):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Rick McBride (rmcbride) wrote :

Per ralsina, this actually occurs due to non-ascii. added file 優柔不断な人_ñandú.txt to one of the special folders and tested according to

[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.

tags: added: verification-complete
removed: verification-needed
Rick McBride (rmcbride)
tags: added: verification-done
removed: verification-complete
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntuone-control-panel - 3.0.1-0ubuntu1

---------------
ubuntuone-control-panel (3.0.1-0ubuntu1) precise-proposed; urgency=low

  * New upstream release.
    - Restore window properly when minimized to tray. (LP: #865688)
    - Make CalculateSize use bytes in os.walk. (LP: #959447)
    - Avoid obstruction of spin button hilights. (LP: #966283)
    - Fix external link buttons for RTL locales. (LP: #983665)
    - Avoid launching duplicate instances. (LP: #987909)
    - File sync status reports disabled while syncdaemon is IDLE. (LP: #995146)
  * debian/watch:
    - Update the watch file to use the stable-3-0 series
 -- Rodney Dawes <email address hidden> Tue, 22 May 2012 14:31:30 -0400

Changed in ubuntuone-control-panel (Ubuntu Precise):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.