UDFs with non-ascii names are broken

Bug #577862 reported by Facundo Batista
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Ubuntu One Client
Confirmed
High
Guillermo Gonzalez

Bug Description

Create a directory in my home, called "camión".

Told it to be UDF, and the command never returned, but saw the following in the logs:

2010-05-09 16:44:46,444 - twisted - ERROR - Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/ubuntuone/syncdaemon/states.py", line 323, in _run
    queue.run()
  File "/usr/lib/python2.6/dist-packages/ubuntuone/syncdaemon/action_queue.py", line 440, in run
    d = command.run()
  File "/usr/lib/python2.6/dist-packages/ubuntuone/syncdaemon/action_queue.py", line 1389, in run
    d.addCallbacks(self._ready_to_run, self.end_errback)
  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 213, in addCallbacks
    self._runCallbacks()
--- <exception caught here> ---
  File "/usr/lib/python2.6/dist-packages/twisted/internet/defer.py", line 371, in _runCallbacks
    self.result = callback(self.result, *args, **kw)
  File "/usr/lib/python2.6/dist-packages/ubuntuone/syncdaemon/action_queue.py", line 1400, in _ready_to_run
    d = self._run()
  File "/usr/lib/python2.6/dist-packages/ubuntuone/syncdaemon/action_queue.py", line 1966, in _run
    return self.action_queue.client.create_udf(self.path, self.name)
  File "/usr/lib/python2.6/dist-packages/ubuntuone/storageprotocol/client.py", line 481, in create_udf
    p.start()
  File "/usr/lib/python2.6/dist-packages/ubuntuone/storageprotocol/request.py", line 346, in start
    return self._start()
  File "/usr/lib/python2.6/dist-packages/ubuntuone/storageprotocol/client.py", line 782, in _start
    message.create_udf.name = self.name
  File "/usr/lib/pymodules/python2.6/google/protobuf/reflection.py", line 420, in setter
    type_checker.CheckValue(new_value)
  File "/usr/lib/pymodules/python2.6/google/protobuf/internal/type_checkers.py", line 128, in CheckValue
    (proposed_value))
exceptions.ValueError: 'cami\xc3\xb3n' has type str, but isn't in 7-bit ASCII encoding. Non-ASCII strings must be converted to unicode objects before being added.

After that, if I try to create it again (always using u1sdtool), I see in the logs:

2010-05-09 16:44:58,712 - ubuntuone.SyncDaemon.VM - WARNING - Duplicated create_udf request for path (ingoring it!): '~'

But, it doesn't appear when I do u1sdtool --list-folders.

Revision history for this message
Facundo Batista (facundo) wrote :

I changed a file in my installed u1: In action_queue.py, changed

        # XXX Unicode boundary?
        self.name = name

by

        self.name = name.decode('utf8')

in CreateUDF class.

Now the creation itself worked, but the u1sdtool command never returned. Checking the logs, saw:

2010-05-09 18:04:04,557 - ubuntuone.SyncDaemon.EQ - ERROR - Error encountered while handling: VM_UDF_CREATED in <ubuntuone.syncdaemon.dbus_interface.EventListener object at 0x9f373cc>
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/ubuntuone/syncdaemon/event_queue.py", line 794, in _dispatch
    method(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/ubuntuone/syncdaemon/dbus_interface.py", line 640, in handle_VM_UDF_CREATED
    self.dbus_iface.folders.emit_folder_created(udf)
  File "/usr/lib/python2.6/dist-packages/ubuntuone/syncdaemon/dbus_interface.py", line 1322, in emit_folder_created
    udf_dict = self._get_udf_dict(folder)
  File "/usr/lib/python2.6/dist-packages/ubuntuone/syncdaemon/dbus_interface.py", line 1250, in _get_udf_dict
    udf_dict[unicode(k)] = unicode(v)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3: ordinal not in range(128)

And now everything is flaky: for example, --list-folders does not work anymore.

It seems that the whole UDF command set needs to be revised to work ok in these cases.

In any case, I now have the UDF created with the accent, and even putting files inside it are recognized ok.

tags: added: chicharra-maverick
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.