lycheesync icon indicating copy to clipboard operation
lycheesync copied to clipboard

TypeError: 'str' does not support the buffer interface

Open dfrumin opened this issue 8 years ago • 4 comments

Hi all - wondering if anyone else has run into this issue.

I am running the kdelfour-lychee docker inside a Synology diskstation. I installed lycheesync and configured it. However, when i try to run it from the terminal I get the error below:

(venv3.4) root@kdelfour-lychee-docker1:/lycheesync# python -m lycheesync.sync /p hoto /var/www/lychee ./ressources/conf.json
Traceback (most recent call last):
File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/lycheesync/lycheesync/sync.py", line 116, in
main()
File "/lycheesync/venv3.4/lib/python3.4/site-packages/click/core.py", line 716 , in call
return self.main(_args, *_kwargs)
File "/lycheesync/venv3.4/lib/python3.4/site-packages/click/core.py", line 675 , in main
_verify_python3_env()
File "/lycheesync/venv3.4/lib/python3.4/site-packages/click/_unicodefun.py", l ine 69, in _verify_python3_env
if locale.lower().endswith(('.utf-8', '.utf8')):
TypeError: 'str' does not support the buffer interface

Below are the results of the locale command so I suspect it's all set to some default and that may be throwing things off? I'm a C++ dev but this is my first time with python so I figure it's best to ask than to go changing code.

Any ideas?

Thanks!

LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

dfrumin avatar Jun 08 '16 04:06 dfrumin

Hi,

You should see this with @kdelfour This is a documented bug in python 3.4. It's python lib that breaks not my code.

You should have something like

LANG=en_US.UTF-8

in your locales in order to fix this.

You can fix this in the Dockerfile.

Does this reply suits you or do you want more information ?

Regards,

Gustave

GustavePate avatar Jun 08 '16 11:06 GustavePate

Hello,

I have the same issue but I have LANG=en_US.UTF-8 I am running Ubuntu 14.04

Traceback (most recent call last): File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.4/runpy.py", line 85, in _run_code exec(code, run_globals) File "/opt/lycheesync/lycheesync/sync.py", line 116, in main() File "/opt/lycheesync/venv3.4/lib/python3.4/site-packages/click/core.py", line 716, in call return self.main(*args, **kwargs) File "/opt/lycheesync/venv3.4/lib/python3.4/site-packages/click/core.py", line 675, in main _verify_python3_env() File "/opt/lycheesync/venv3.4/lib/python3.4/site-packages/click/_unicodefun.py", line 69, in _verify_python3_env if locale.lower().endswith(('.utf-8', '.utf8')): TypeError: 'str' does not support the buffer interface

Any ideas how to solve this issue? Regards, Lucas

skr3 avatar May 06 '17 22:05 skr3

To fix this, you just need to install the en_US.UTF-8 locale on the server.

locale-gen en_US.UTF-8

And you are good to go :)

atomrc avatar Oct 31 '17 21:10 atomrc

To fix the issue, I ran the following command on my server to list the installed locales:

locale -a

It gave the following error: Cannot set LC_CTYPE to default locale: No such file or directory

To fix this issue, I edited my /etc/default/locale file and added LC_TYPE and LC_ALL variables:

LC_CTYPE="en_US.UTF-8" LC_ALL="en_US.UTF-8" LANG="en_US.UTF-8"

Then re-login to the server and execute the script again.

skr3 avatar Nov 11 '17 22:11 skr3