vlevit / xatk

a keyboard-driven window switcher for x11
GNU General Public License v2.0
13 stars 0 forks source link

'ascii' codec can't encode characters in position 0-8: ordinal not in range(128) #5

Closed ngsupb closed 9 years ago

ngsupb commented 9 years ago

thank you for this great window manager. I have a small issue though.

I get this error 'ascii' codec can't encode characters in position 0-8: ordinal not in range(128) when I try to open some website in cyrilic for example this one seoprofy.ua

I have replaced the string
return prop.value.decode('utf-8', 'ignore_log') to return prop.value

I think there might be a problem in case the decode is needed, so just to let you know you may want to take a look at it.

Looking forward for the LIFO feature!

Thank you !

vlevit commented 9 years ago

@ngsupb Thank you very much for the bug report! Unfortunately I can't reproduce the bug. How often does it occur? Can you easily reproduce it? Can you provide the log, please? To collect the log do the following.

xatk --kill  # stop running instance
xatk -l ~/.xatk/xatk.log
# reproduce the bug
# xatk must crash
# have a look at the log if it contains some info you wouldn't like to share
# post the log somewhere or send me to dev at vlevit.org

Thank you!

ngsupb commented 9 years ago

@vlevit Yes, it is easy to reproduce. It happens all the time when Firefox is up and has a website in a tab like that I mentioned. Here is the log https://dl.dropboxusercontent.com/u/2904315/xatk.log

vlevit commented 9 years ago

@ngsupb Thank you!

It seems the issue is that Debian/Ubuntu switched to unofficial version of python-xlib with python 3 support with inconsistent behavior: get_property meant to return binary data though the author of the port decided that it should return strings... or bytes sometimes...

The workaround should be easy, though I would like to verify that we don't have any similar cases.

vlevit commented 9 years ago

@ngsupb Sorry for the long delay. I have moved to a different country for some period and I haven't had too much free time recently.

So I added handling of the case when patched python-xlib (found in Debian or Ubuntu) is used and released xatk 0.2.1. Feel free to reopen the issue if you think it's not resolved.

Thank you for your report!