Ticket #2500 (closed defect: worksforme)

Opened 2 years ago

Last modified 2 years ago

Sending file with accentuated chars in the filename / path

Reported by: jim++ Owned by: asterix
Priority: normal Milestone: 0.11
Component: None Version: svn
Severity: major Keywords:
Cc: OS:

Description

Traceback (most recent call last):
  File "/home/jim/gajim/gajim-propre-svn/src/dialogs.py", line 876, in on_dialog_response
    self.response_ok(dialog)
  File "/home/jim/gajim/gajim-propre-svn/src/filetransfers_window.py", line 238, in on_ok
    if self.send_file(account, contact, file_path) and file_dir is None:
  File "/home/jim/gajim/gajim-propre-svn/src/filetransfers_window.py", line 279, in send_file
    self.add_transfer(account, contact, file_props)
  File "/home/jim/gajim/gajim-propre-svn/src/filetransfers_window.py", line 571, in add_transfer
    text_props += contact.get_shown_name()
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 14-16: invalid data

Attachments

Change History

Changed 2 years ago by nk

Jim, what fails here, is because of bad names in the contact name than the filename..

what was the name of that contact, and can u repro?

Changed 2 years ago by jim++

No, no it really comes from the file name, not the contact name. I can always repro with éèêà in the filename.

Moreover, once this TB occur, I can't send ANY file to ANY contact without having :

Traceback (most recent call last):
  File "/home/jim/gajim/gajim-propre-svn/src/dialogs.py", line 896, in on_dialog_response
    self.response_ok(dialog)
  File "/home/jim/gajim/gajim-propre-svn/src/filetransfers_window.py", line 238, in on_ok
    if self.send_file(account, contact, file_path) and file_dir is None:
  File "/home/jim/gajim/gajim-propre-svn/src/filetransfers_window.py", line 279, in send_file
    self.add_transfer(account, contact, file_props)
  File "/home/jim/gajim/gajim-propre-svn/src/filetransfers_window.py", line 582, in add_transfer
    self.set_status(file_props['type'], file_props['sid'], status)
  File "/home/jim/gajim/gajim-propre-svn/src/filetransfers_window.py", line 392, in set_status
    iter = self.get_iter_by_sid(typ, sid)
  File "/home/jim/gajim/gajim-propre-svn/src/filetransfers_window.py", line 524, in get_iter_by_sid
    if typ + sid == self.model[iter][C_SID].decode('utf-8'):
AttributeError: 'NoneType' object has no attribute 'decode'


Changed 2 years ago by jim++

Note that I have no idea what is the filesystem encoding or how it works. This may (or not) cause the problem.

Changed 2 years ago by baze

filenames are now escaped since 7268. i couldn't reproduce the tb with a file called éèêà and en_US.utf8

you should try with a version >=7268, maybe it's fixed.

Changed 2 years ago by asterix

unfortunatly it's not. in fact with some print we saw that decode_filechooser_file_paths() func fail to return unicode object. So when we do after that str + unicode that fails cause python tries to convert str to unicode.

locale returns eo_XX.UTF-8 for everything.

Changed 2 years ago by asterix

  • status changed from new to closed
  • resolution set to worksforme

it was an encoding pb of his file names, and there is no way to guess the encoding. so decode() couldn't work

Add/Change #2500 (Sending file with accentuated chars in the filename / path)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.