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

Umlaut directories #1676

Closed
laclaro opened this Issue May 11, 2018 · 3 comments

Comments

4 participants
@laclaro

laclaro commented May 11, 2018

Hi,

I stumbled upon a little issue with a specific directory in local database.

[file]
...
media_dirs =
/var/lib/mopidy/media/Hörbücher|Hörbücher
...

does not work, however

[file]
...
media_dirs =
/var/lib/mopidy/media/Hoerbuecher|Hörbücher
...

does work. I am on my rpi3 with all locale variables set to de_DE.uft8 via /etc/default/locale. Note: /var/lib/mopidy/media/Hoerbuecher is a symbolic link. I have the media-directory /var/lib/mopidy/media/ filled with several symlinks that point to my actual media sources. I did not test the issue with actual directories, but assume it won't make any difference. "Umlaut"-directories within that symlinked directory path can be accessed in the latter case.

I use the same directory for "local-sqlite" and "file", but I think it happend only for "file".

Best regards,

Henning

@kingosticks

This comment has been minimized.

Member

kingosticks commented May 11, 2018

I thought the file backend didn't allow symlinks that point outside of the configured media_dir(s), could you be clearer about your directory structure?

Also please provide a debug log showing an example of exactly "does not work".

@laclaro

This comment has been minimized.

laclaro commented May 12, 2018

Sorry. Forget about the symlinks. This is not the problem. "Does not work" means, the directory cannot be accessed after the process. However, there is an ascii decoding error thrown (which explains the observations) which looks like this:

2018-05-12 06:48:15,044 ERROR [332:Core-8] mopidy.core.library: FileBackend backend caused an exception.
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/mopidy/core/library.py", line 19, in _backend_error_handling
yield
File "/usr/lib/python2.7/dist-packages/mopidy/core/library.py", line 112, in _browse
result = backend.library.browse(uri).get()
File "/usr/lib/python2.7/dist-packages/pykka/threading.py", line 52, in get
compat.reraise(*self._data['exc_info'])
File "/usr/lib/python2.7/dist-packages/pykka/compat.py", line 12, in reraise
exec('raise tp, value, tb')
File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 201, in _actor_loop
response = self._handle_receive(message)
File "/usr/lib/python2.7/dist-packages/pykka/actor.py", line 295, in _handle_receive
return callee(*message['args'], **message['kwargs'])
File "/usr/lib/python2.7/dist-packages/mopidy/file/library.py", line 54, in browse
if not self._is_in_basedir(os.path.realpath(local_path)):
File "/usr/lib/python2.7/dist-packages/mopidy/file/library.py", line 145, in _is_in_basedir
for media_dir in self._media_dirs)
File "/usr/lib/python2.7/dist-packages/mopidy/file/library.py", line 145, in
for media_dir in self._media_dirs)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 23: ordinal not in range(128)

My locale settings display as:

pi@pi:~$ sudo -u mopidy sh -c 'locale'
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="de_DE.utf8"
LC_NUMERIC="de_DE.utf8"
LC_TIME="de_DE.utf8"
LC_COLLATE="de_DE.utf8"
LC_MONETARY="de_DE.utf8"
LC_MESSAGES="de_DE.utf8"
LC_PAPER="de_DE.utf8"
LC_NAME="de_DE.utf8"
LC_ADDRESS="de_DE.utf8"
LC_TELEPHONE="de_DE.utf8"
LC_MEASUREMENT="de_DE.utf8"
LC_IDENTIFICATION="de_DE.utf8"
LC_ALL=de_DE.utf8

Please advise how to further debug.

Best,

Henning

@evamvid

This comment has been minimized.

evamvid commented Sep 23, 2018

Is there some way to force the config reader to read unicode instead of ASCII?

Szunti added a commit to Szunti/mopidy that referenced this issue Oct 7, 2018

Szunti added a commit to Szunti/mopidy that referenced this issue Oct 7, 2018

@jodal jodal self-assigned this Nov 26, 2018

@jodal jodal added this to the v2.2.2 milestone Nov 26, 2018

jodal added a commit that referenced this issue Nov 27, 2018

jodal added a commit that referenced this issue Nov 27, 2018

@jodal jodal closed this Nov 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment