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

Character encoding issue during local media scan #1508

Closed
rmccawl opened this Issue May 9, 2016 · 1 comment

Comments

2 participants
@rmccawl

rmccawl commented May 9, 2016

When running mopidy local scan on a clean mopidy install I get the following error message

INFO     Scanned 3500 of 5494 files in 25s, ~14s left.
ERROR    'ascii' codec can't encode character u'\ufeff' in position 0: ordinal not in range(128)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/mopidy/__main__.py", line 134, in main
    return args.command.run(args, proxied_config)
  File "/usr/local/lib/python2.7/site-packages/mopidy/local/commands.py", line 150, in run
    track = tags.convert_tags_to_track(result.tags).replace(
  File "/usr/local/lib/python2.7/site-packages/mopidy/audio/tags.py", line 81, in convert_tags_to_track
    'musicbrainz-sortname')
  File "/usr/local/lib/python2.7/site-packages/mopidy/audio/tags.py", line 137, in _artists
    return [Artist(**attrs)]
  File "/usr/local/lib/python2.7/site-packages/mopidy/models/immutable.py", line 158, in __call__
    *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/mopidy/models/immutable.py", line 34, in __init__
    self._set_field(key, value)
  File "/usr/local/lib/python2.7/site-packages/mopidy/models/immutable.py", line 186, in _set_field
    object.__setattr__(self, name, value)
  File "/usr/local/lib/python2.7/site-packages/mopidy/models/fields.py", line 50, in __set__
    value = self.validate(value)
  File "/usr/local/lib/python2.7/site-packages/mopidy/models/fields.py", line 98, in validate
    return compat.intern(str(super(Identifier, self).validate(value)))
UnicodeEncodeError: 'ascii' codec can't encode character u'\ufeff' in position 0: ordinal not in range(128)
Traceback (most recent call last):
  File "/usr/local/bin/mopidy", line 9, in <module>
    load_entry_point('Mopidy==2.0.0', 'console_scripts', 'mopidy')()
  File "/usr/local/lib/python2.7/site-packages/mopidy/__main__.py", line 134, in main
    return args.command.run(args, proxied_config)
  File "/usr/local/lib/python2.7/site-packages/mopidy/local/commands.py", line 150, in run
    track = tags.convert_tags_to_track(result.tags).replace(
  File "/usr/local/lib/python2.7/site-packages/mopidy/audio/tags.py", line 81, in convert_tags_to_track
    'musicbrainz-sortname')
  File "/usr/local/lib/python2.7/site-packages/mopidy/audio/tags.py", line 137, in _artists
    return [Artist(**attrs)]
  File "/usr/local/lib/python2.7/site-packages/mopidy/models/immutable.py", line 158, in __call__
    *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/mopidy/models/immutable.py", line 34, in __init__
    self._set_field(key, value)
  File "/usr/local/lib/python2.7/site-packages/mopidy/models/immutable.py", line 186, in _set_field
    object.__setattr__(self, name, value)
  File "/usr/local/lib/python2.7/site-packages/mopidy/models/fields.py", line 50, in __set__
    value = self.validate(value)
  File "/usr/local/lib/python2.7/site-packages/mopidy/models/fields.py", line 98, in validate
    return compat.intern(str(super(Identifier, self).validate(value)))
UnicodeEncodeError: 'ascii' codec can't encode character u'\ufeff' in position 0: ordinal not in range(128)

I am running mopidy on OSX, installed via homebrew.

@rmccawl

This comment has been minimized.

rmccawl commented May 9, 2016

I had another look at the error message, it appears the character it can't encode is u'\ufeff' which is the Byte Order Mark character - http://stackoverflow.com/a/6786646

Something in my library must have this in a filename or tags.

@jodal jodal added the C-bug label May 10, 2016

@jodal jodal added this to the v2.0.1 - Bug fixes milestone May 10, 2016

@jodal jodal self-assigned this Aug 7, 2016

jodal added a commit to jodal/mopidy that referenced this issue Aug 7, 2016

jodal added a commit to jodal/mopidy that referenced this issue Aug 7, 2016

jodal added a commit that referenced this issue Aug 11, 2016

Merge pull request #1546 from jodal/fix/1508-identifier-field-encodin…
…g-error

Fix #1508: identifier field encoding error

@jodal jodal closed this in 3346778 Aug 11, 2016

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