karlch/vimiv

Uncaught UnicodeEncodeError on startup

Closed this issue · 9 comments

Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/vimiv/app.py", line 183, in activate_vimiv
self._init_widgets()
File "/usr/lib/python3.6/site-packages/vimiv/app.py", line 370, in _init_widgets
self["library"] = Library(self)
File "/usr/lib/python3.6/site-packages/vimiv/library.py", line 75, in init
self.set_model(self._liststore_create())
File "/usr/lib/python3.6/site-packages/vimiv/library.py", line 327, in _liststore_create
self.files, filesize = self._filelist_create()
File "/usr/lib/python3.6/site-packages/vimiv/library.py", line 380, in _filelist_create
for sub in subfiles[:file_check_amount]
File "/usr/lib/python3.6/site-packages/vimiv/library.py", line 381, in
if is_image(os.path.join(fil, sub))]
File "/usr/lib/python3.6/site-packages/vimiv/fileactions.py", line 101, in is_image
return bool(GdkPixbuf.Pixbuf.get_file_info(complete_name)[0])
UnicodeEncodeError: 'utf-8' codec can't encode characters in position 22-23: surrogates not allowed

It looks like it is having problem with one specific filename, can you share the exact name of the file that creates this problem, possibly even the file itself?

yes,there have three files, l will pass on these files.thank you.``

Uploading fileactions_py.txt…
Uploading library_py.txt…
app_py.txt

i don't know what happened ,but i find when i use the vimiv in ~/ folder ,the vimiv will return this error.if in another folder such as the ~/picture ,vimiv can be run.it's very funny.Perhaps i need move some picture to the ~/picture folder.

Umm, sorry if I was being unclear. I didn't mean the source files of vimiv, but the file in your home folder that creates this exception.

I am pretty sure you have one file which vimiv is trying to read, but isn't able to because of some weird character in the filename.

The output of ls ~ should also do, unless you have some confidential information there, then you will have to find out manually which file it is.

I would like to be able to reproduce the problem with the same character and then fix this by simply catching the exception 😄

No,i only to open a screenshot,but ... the screenshot is a png file.i will try to remove the files in home folder,and i will open the vimiv again.if i find the file i will tell you.

i find it! the Downloads folder have some problem.when i come to the Download folder i find a very strange folder,one folder which download from a netdisc ,that folder is a windows folder which be file compressioned. And when i open it in Arch linux by unzip.the folder will have a very strange name, like this #@$%@%@$^%&$/#$%#@%@\03#@¥%@%/. it the windows's problem which be issued in China.(windows of Chinese version)Maybe in US or other country where in English.This problem will not happen.thank you.And solving the problem , the best way is change the folder name.

Thanks for investigating!

I think c16dbc9 should fix this as well, I accidentally linked the wrong issue in the commit, shame on me 😃

no,l have not found this question at first,this is my problem.and thank you help me to solve this question.

Closing as this seems to be solved, sorry for the long delay 😃