Open Vadim2S opened 2 years ago
Could you please show me your code snippet that contains a non-english path?
I am do some test and found another prerequisite for error: Windows Case 1: Pure Linux or WSL: jpeg = jpegio.read("/mnt/c/!4/bbb/example.jpg") #english only jpeg = jpegio.read("/mnt/c/!4/ббб/example.jpg") #not only english All Ok Case 2: Windows: jpeg = jpegio.read("c:\!4\bbb\example.jpg") #english only jpeg = jpegio.read("c:\!4\ббб\example.jpg") #not only english jpeg = jpegio.read("c:/!4/ббб/example.jpg") #not only english, reverse slash OK, error, error: jpeg = jpegio.read("c:/!4/ббб/example.jpg") File "C:\Users\Вадим\AppData\Roaming\Python\Python39\site-packages\jpegio\io.py", line 8, in read obj.read(fpath) File "jpegio\decompressedjpeg.pyx", line 38, in jpegio.decompressedjpeg.DecompressedJpeg.read File "jpegio\decompressedjpeg.pyx", line 46, in jpegio.decompressedjpeg.DecompressedJpeg.read RuntimeError: Unknown exception
It uses fpath.encode()
which uses utf8 by default. So if we use non-english path on non-utf8 system, e.g. Windows, it will fail.
Tested. English-only path to .jpeg work OK, National encoding lead to error.