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

beets crashes with UnicodeEncodeError #1895

Closed
sneak opened this issue Feb 26, 2016 · 2 comments
Closed

beets crashes with UnicodeEncodeError #1895

sneak opened this issue Feb 26, 2016 · 2 comments

Comments

@sneak
Copy link

sneak commented Feb 26, 2016

Describe your problem, feature request, or discussion topic here. If you're reporting a bug, please fill out the "Problem" and "Setup" sections below. Otherwise, you can delete it.

Problem

Running this command in verbose (-vv) mode:

$ beet -vv -l ./library -d ./music.clean/ import -q ./Music

Led to this problem:

[snip]
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: import_task_created
Sending event: albuminfo_received
Sending event: albuminfo_received
Sending event: albuminfo_received
Sending event: albuminfo_received
Sending event: albuminfo_received
Evaluating 5 candidates.
Candidate: Frank Bretschneider - Looping I-VI (And Other Assorted Love Songs)
Success. Distance: 0.74
Candidate: Frank Bretschneider - Curve
Success. Distance: 0.69
Candidate: Frank Bretschneider - Rand
Success. Distance: 0.81
Candidate: Frank Bretschneider - Kippschwingungen
Success. Distance: 0.74
Candidate: Frank Bretschneider - Super.Trigger
Success. Distance: 0.74
Sending event: import_task_start

/Volumes/ext/Music/Frank Bretschneider
/Volumes/ext/Music/Frank Bretschneider/Various Artists - Clicks & Cuts 3 (disc 1) (1 items)
Looking up: /Volumes/ext/Music/Impact Unit/Tenshin EP [Silent Steps]
Skipping.
Tagging Impact Unit - Tenshin EP [Silent Steps]
Sending event: import_task_choice
No album IDs found.
Search terms: Impact Unit - Tenshin EP [Silent Steps]
Album might be VA: False
Sending event: albuminfo_received
Sending event: albuminfo_received
Sending event: albuminfo_received
Sending event: albuminfo_received
Sending event: albuminfo_received
Evaluating 5 candidates.
Candidate: Deep Impact - The Good EP
Success. Distance: 0.62
Candidate: Critical Impact - The Leap of Faith EP
Success. Distance: 0.81
Candidate: Bypass Unit - Tunnel Flotation EP
Success. Distance: 0.70
Candidate: Unit 731 - The First Strike EP
Success. Distance: 0.76
Candidate: Unit Park - Digital Mobile Funk EP
Success. Distance: 0.83
Traceback (most recent call last):
  File "/Users/jp/Library/Python/2.7/bin/beet", line 9, in <module>
    load_entry_point('beets==1.3.17', 'console_scripts', 'beet')()
  File "/Users/jp/Library/Python/2.7/lib/python/site-packages/beets/ui/__init__.py", line 1236, in main
    _raw_main(args)
  File "/Users/jp/Library/Python/2.7/lib/python/site-packages/beets/ui/__init__.py", line 1226, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/Users/jp/Library/Python/2.7/lib/python/site-packages/beets/ui/commands.py", line 966, in import_func
    import_files(lib, paths, query)
  File "/Users/jp/Library/Python/2.7/lib/python/site-packages/beets/ui/commands.py", line 943, in import_files
    session.run()
  File "/Users/jp/Library/Python/2.7/lib/python/site-packages/beets/importer.py", line 321, in run
    pl.run_parallel(QUEUE_SIZE)
  File "/Users/jp/Library/Python/2.7/lib/python/site-packages/beets/util/pipeline.py", line 252, in run
    msg = self.coro.next()
  File "/Users/jp/Library/Python/2.7/lib/python/site-packages/beets/importer.py", line 1203, in read_tasks
    for t in task_factory.tasks():
  File "/Users/jp/Library/Python/2.7/lib/python/site-packages/beets/importer.py", line 1048, in tasks
    tasks = self._create(self.album(paths, dirs))
  File "/Users/jp/Library/Python/2.7/lib/python/site-packages/beets/importer.py", line 1127, in album
    items = map(self.read_item, paths)
  File "/Users/jp/Library/Python/2.7/lib/python/site-packages/beets/importer.py", line 1177, in read_item
    return library.Item.from_path(path)
  File "/Users/jp/Library/Python/2.7/lib/python/site-packages/beets/library.py", line 505, in from_path
    i.read(path)
  File "/Users/jp/Library/Python/2.7/lib/python/site-packages/beets/library.py", line 562, in read
    value = getattr(mediafile, key)
  File "/Users/jp/Library/Python/2.7/lib/python/site-packages/beets/mediafile.py", line 1082, in __get__
    out = style.get(mediafile.mgfile)
  File "/Users/jp/Library/Python/2.7/lib/python/site-packages/beets/mediafile.py", line 555, in get
    return _sc_decode(data)[self.index]
  File "/Users/jp/Library/Python/2.7/lib/python/site-packages/beets/mediafile.py", line 220, in _sc_decode
    soundcheck = soundcheck.replace(b' ', b'').decode('hex')
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/hex_codec.py", line 42, in hex_decode
    output = binascii.a2b_hex(input)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 59-61: ordinal not in range(128)

Here's a link to the music files that trigger the bug (if relevant):

Setup

  • OS: OSX 10.11.3
  • Python version: 2.7.10
  • beets version: 1.3.17
  • Turning off plugins made problem go away (yes/no): didn't test

My configuration (output of beet config) is:

import:
    move: yes
    write: yes
    incremental: yes
    log: ~/Library/Logs/beetimport.txt
quiet_fallback: skip
@sampsyo
Copy link
Member

sampsyo commented Feb 26, 2016

Thanks for the report! I've just pushed a fix. Can you check whether that solves the problem for you?

@sneak
Copy link
Author

sneak commented Feb 28, 2016

Tagging 䴀愀爀猀洀漀戀椀氀 - 䴀甀渀椀挀栀 䰀漀瘀攀猀 夀漀甀
No album IDs found.
Skipping.

Works a charm now. Thank you! 😃

sampsyo added a commit that referenced this issue Feb 28, 2016
shamangeorge added a commit to shamangeorge/beets that referenced this issue Mar 1, 2016
* master: (246 commits)
  Fix beetbox#1896 (bungled fix to beetbox#1895)
  Minor docs refinements for beetbox#1894
  Human-readable message in non-pretend mode (beetbox#1894)
  changelog entry for new convert.album_art_maxwidth option
  tweaks for style, option name
  Fix beetbox#1895: don't assume SC data is bytes
  Slightly more logical instruction placement
  Update ISSUE_TEMPLATE.md
  doc note for new copy_album_art_maxwidth option
  revert a chunk of the work to be the way it was
  better text for artwork resize/copy logs
  fix indentation
  add copy_album_art_maxwidth config option to convert plugin
  move and split fetchart valid_image
  Fix beetbox#1891: Missing `syspath` in `beet stats -e`
  Suggest ways to describe problems
  Start an issue template
  beet import: there is no such option: -M
  Grammar/formatting refinement for beetbox#1878
  fix documentation error
  ...
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

2 participants