-
Notifications
You must be signed in to change notification settings - Fork 20
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
UTF-8 Error in Docker Container based on Alpine Linux #21
Comments
I found a valid solution based on this article: https://www.howtosolutions.net/2019/04/python-fixing-unexpected-utf-8-bom-error-when-loading-json-data/ - easiest way ist described in step 4. Before each r.json call I have to add r.encoding='utf-8-sig' in die program code. Maybe Pectojin can add this in the master code? Otherwise I can add a pull request. |
I have the same problem. Even on ubuntu container. |
Like described in issue Pectojin#21 (Pectojin#21) there is an UTF-8-issue when you are calling r.json inside a docker cointainer. I found a valid solution based on this article: https://www.howtosolutions.net/2019/04/python-fixing-unexpected-utf-8-bom-error-when-loading-json-data/ - easiest way ist described in step 4. TheAmitMa asked to share my solution - here it is.
Like described in issue Pectojin#21 (Pectojin#21) there is an UTF-8-issue when you are calling r.json inside a docker cointainer. I found a valid solution based on this article: https://www.howtosolutions.net/2019/04/python-fixing-unexpected-utf-8-bom-error-when-loading-json-data/ - easiest way ist described in step 4. TheAmitMa commented asked to share my solution - here it is.
Like described in issue Pectojin#21 (Pectojin#21) there is an UTF-8-issue when you are calling r.json inside a docker cointainer. I found a valid solution based on this article: https://www.howtosolutions.net/2019/04/python-fixing-unexpected-utf-8-bom-error-when-loading-json-data/ - easiest way ist described in step 4. TheAmitMa commented asked to share my solution - here it is.
I have now added two pull requests (unfortnately instead of one). You can see like I have adjusted duplicaty_client.py and auth.py. |
I want to add duplicati-client as new layer on top of the official "nodered/node-red" image in docker hub. I know that there is no locale support of the underlying Alpine Linux. So I added musl-locales-master to my Dockerfile - hoping that this helps also for UTF-8. Unfortunately duplicati-client is still not working in this environment (see below). Does anyone has experience in running duplicati-client on Alpine?
Best regards
PS: On Ubuntu duplicati-client is working fine
$ duc login http://duplicati:8200 --password=my password
Traceback (most recent call last):
File "/usr/bin/duc", line 1372, in
main(**vars(args))
File "/usr/bin/duc", line 97, in main
data = auth.login(data, url, password, verify, interactive,
File "/usr/local/lib/duplicati-client/auth.py", line 126, in login
salt = r.json()["Salt"]
File "/usr/lib/python3.8/site-packages/requests/models.py", line 900, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.8/json/init.py", line 337, in loads
raise JSONDecodeError("Unexpected UTF-8 BOM (decode using utf-8-sig)",
json.decoder.JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0)
The text was updated successfully, but these errors were encountered: