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

Scan Photos errors out if files contain non-ASCII characters #85

Open
KarimGeiger opened this issue Mar 12, 2019 · 2 comments
Open

Scan Photos errors out if files contain non-ASCII characters #85

KarimGeiger opened this issue Mar 12, 2019 · 2 comments

Comments

@KarimGeiger
Copy link

KarimGeiger commented Mar 12, 2019

When running a Photo Scan (on Nextcloud), the worker errors out if there's a file containing Non-ASCII characters, like ö, ä and so on.

Traceback (most recent call last):
  File "/miniconda/lib/python3.6/site-packages/rq/worker.py", line 793, in perform_job
    rv = job.perform()
  File "/miniconda/lib/python3.6/site-packages/rq/job.py", line 599, in perform
    self._result = self._execute()
  File "/miniconda/lib/python3.6/site-packages/rq/job.py", line 605, in _execute
    return self.func(*self.args, **self.kwargs)
  File "/code/nextcloud/directory_watcher.py", line 63, in scan_photos
    if not os.path.exists(local_dir):
  File "/miniconda/lib/python3.6/genericpath.py", line 19, in exists
    os.stat(path)
UnicodeEncodeError: 'ascii' codec can't encode character '\xfc' in position 50: ordinal not in range(128)
@guysoft
Copy link
Collaborator

guysoft commented Apr 27, 2019

I am getting similar issue when running dirtree.
See: #98

@chas-mafli
Copy link

I was able to fix this in the docker-compose setup with

# docker exec -it ownphotos-backend /bin/bash
docker # apt-get update
docker # apt-get install locales
docker # dpkg-reconfigure locales # select en_US.utf8

Then you need to add export LC_ALL=en_US.utf8 to the top of /code/entrypoint.sh and restart the container.

Would be nice if this was the default in the docker setup, or at least configurable.

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

3 participants