Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appears not to like some unicode characters in titles #23

Open
talwrii opened this issue Feb 7, 2018 · 2 comments
Open

Appears not to like some unicode characters in titles #23

talwrii opened this issue Feb 7, 2018 · 2 comments

Comments

@talwrii
Copy link

talwrii commented Feb 7, 2018

Here is my attempt at a small reproducible example:

git checkout upstream/master; git show-ref HEAD; rm -rf venv; virtualenv -p python3 venv ; venv/bin/pip install i3-py &&  xterm -e 'echo -ne "\033]0;hë☺llo\007"; read' &  sleep 10; venv/bin/python3 quickswitch.py; venv/bin/pip freeze  ; venv/bin/python --version
HEAD is now at 0f19f64... Merge pull request #19 from adiog/master
699f689991725b15284ca502d7315aa01d3955c5 refs/remotes/origin/HEAD
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/user/.extraconfig/bins/quickswitch-for-i3/venv/bin/python3
Also creating executable in /home/user/.extraconfig/bins/quickswitch-for-i3/venv/bin/python
Installing setuptools, pip, wheel...done.
Collecting i3-py
Installing collected packages: i3-py
Successfully installed i3-py-0.6.4
[1] 26995
Traceback (most recent call last):
  File "quickswitch.py", line 563, in <module>
    main()
  File "quickswitch.py", line 541, in main
    lookup = lookup_func()
  File "quickswitch.py", line 67, in get_windows
    windows = parse_for_windows(i3.get_tree(), [])
  File "/home/user/.extraconfig/bins/quickswitch-for-i3/venv/lib/python3.6/site-packages/i3.py", line 409, in function
    response = msg(type, msg_full)
  File "/home/user/.extraconfig/bins/quickswitch-for-i3/venv/lib/python3.6/site-packages/i3.py", line 392, in msg
    response = default_socket().get(type, message)
  File "/home/user/.extraconfig/bins/quickswitch-for-i3/venv/lib/python3.6/site-packages/i3.py", line 182, in get
    return self.receive()
  File "/home/user/.extraconfig/bins/quickswitch-for-i3/venv/lib/python3.6/site-packages/i3.py", line 218, in receive
    return self.unpack(data)
  File "/home/user/.extraconfig/bins/quickswitch-for-i3/venv/lib/python3.6/site-packages/i3.py", line 248, in unpack
    payload = data[self.struct_header_size:msg_size].decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe2 in position 12641: invalid continuation byte
i3-py==0.6.4
Python 3.6.4
@OliverUv
Copy link
Owner

OliverUv commented Feb 8, 2018

Interesting! I've had no problems with unicode on my box for a long time, so maybe it's the particular unicode char use? Cheers for the bug report. I may be able to take a look at it during the spring festival. We can go about merging your --current request after that's taken care of.

@talwrii
Copy link
Author

talwrii commented Feb 8, 2018

so maybe it's the particular unicode char use

So using ë didn't hit the bug. But a unicode smiley face () did.

I'm not sure what the difference is. The smiley face is three bytes long... perhaps this makes a difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants