Closed sirex closed 6 years ago
Works for me with that filename on Arch. And that error is indicating an error with temporary filename/path not input filename. Make sure your TEMP env var is set to /tmp or similar. Or use --transfer-mode=stream to avoid temp files.
Ok, after digging a bit deeper I found, that issue is with š
character, python receives it as \udcc5\udca1
. And because of that unicode error is raised:
> python -c "print('\udcc5\udca1')"
Traceback (most recent call last):
File "<string>", line 1, in <module>
UnicodeEncodeError: 'utf-8' codec can't encode characters in position 0-1: surrogates not allowed
I have no idea, how that happens, but it work with pure python:
> python -c "import sys; print(repr(sys.argv[1]))" š
'š'
But if I do that with kitty, by modifying /usr/lib/kitty/__main__.py
and adding print(repr(sys.argv[1]))
to the top of main
function, I get this:
> kitty š
'\udcc5\udca1'
So I guess, argument gets corrupted earlier before Python.
I did tried calling kitty
with TEMP=/tmp
, but that does not work too. --transfer-mode=stream
does work.
Make sure you have your locale setup for UTF-8 correctly. LANG should be something like
LANG=en_US.UTF-8
kitty, unlike python assumes utf-8 everywhere.
Nope:
> LANG=lt_LT.UTF-8 kitty š
'\udcc5\udca1'
> LANG=en_US.UTF-8 kitty š
'\udcc5\udca1'
Then I have no idea, sorry. Works fine for me:
kitty +runpy 'import sys; print(repr(sys.argv[-1]))' š
'š'
Try building kitty from source so it uses your system python, that might fix it.
> kitty +runpy 'import sys; print(repr(sys.argv[-1]))' š
'+runpy'
'\udcc5\udca1'
I got this error:
Versions:
Not sure, maybe error because of file name, that contains an unicode letter?