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

UnicodeDecodeError with beet list #2063

Closed
bengadbois opened this issue Jun 20, 2016 · 4 comments
Closed

UnicodeDecodeError with beet list #2063

bengadbois opened this issue Jun 20, 2016 · 4 comments
Labels
bug bugs that are confirmed and actionable

Comments

@bengadbois
Copy link

bengadbois commented Jun 20, 2016

Problem

Runtime assert
Note: double quotes after the -f, and a smart quote inside double quotes for the query

x@sub:~$ beet --version
beets version 1.3.18
plugins: copyartifacts, embedart, fetchart, ftintitle, info, scrub, zero
x@sub:~$ beet -vv ls -f"$album" ""
user configuration: /home/x/.config/beets/config.yaml
data directory: /home/x/.config/beets
plugin paths:
Sending event: pluginload
library database: /home/x/Dropbox/beets_data/musiclibrary.blb
library directory: /home/x/music
Sending event: library_opened
Traceback (most recent call last):
  File "/usr/local/bin/beet", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/beets/ui/__init__.py", line 1250, in main
    _raw_main(args)
  File "/usr/local/lib/python2.7/dist-packages/beets/ui/__init__.py", line 1239, in _raw_main
    subcommand, suboptions, subargs = parser.parse_subcommand(subargs)
  File "/usr/local/lib/python2.7/dist-packages/beets/ui/__init__.py", line 1040, in parse_subcommand
    suboptions, subargs = subcommand.parse_args(args)
  File "/usr/local/lib/python2.7/dist-packages/beets/ui/__init__.py", line 904, in parse_args
    return self.parser.parse_args(args)
  File "/usr/lib/python2.7/optparse.py", line 1400, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib/python2.7/optparse.py", line 1444, in _process_args
    self._process_short_opts(rargs, values)
  File "/usr/lib/python2.7/optparse.py", line 1551, in _process_short_opts
    option.process(opt, value, values, self)
  File "/usr/lib/python2.7/optparse.py", line 789, in process
    self.action, self.dest, opt, value, values, parser)
  File "/usr/lib/python2.7/optparse.py", line 809, in take_action
    self.callback(self, opt, value, parser, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/beets/ui/__init__.py", line 802, in _set_format
    value = fmt or value and unicode(value) or ''
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 0: ordinal not in range(128)

Setup

  • OS: Ubuntu 1404
  • Python version: 2.7.6
  • beets version: 1.3.18
  • Turning off plugins made problem go away (yes/no): no

My configuration (output of beet config) is:

paths:
    default: $albumartist/$album/$track $title
    singleton: $albumartist/$album/$track $title
    comp: $albumartist/$album/$track $title
    ext:jpg: $albumpath/cover
    ext:jpeg: $albumpath/cover
    ext:png: $albumpath/cover

format_item: $album - $track - $albumartist - $artist - $title
fetchart:
    cautious: yes
    source: itunes amazon albumart
    minwidth: 700
    sources:
    - coverart
    - itunes
    - amazon
    - albumart
    - google
    - wikipedia
    maxwidth: 0
    google_search: no
    auto: yes
    cover_names:
    - cover
    - front
    - art
    - album
    - folder
    remote_priority: no
    enforce_ratio: no
ftintitle:
    auto: yes
    format: (feat. {0})
    drop: no
library: ~/Dropbox/beets_data/musiclibrary.blb
replace:
    '[\\/]': ''
    _: ''
    '[\x00-\x1f]': ''
    '[<>"\*\|]': ''
zero:
    fields: month day genre comments
    update_database: yes

ui:
    color: yes
copyartifacts:
    extensions: .jpg .jpeg .png
    print_ignored: yes

plugins: fetchart embedart scrub zero info ftintitle copyartifacts
directory: ~/music

import:
    move: no
    copy: yes
    write: yes
sort_item: album+ disc+ track+
scrub:
    auto: yes
embedart:
    compare_threshold: 0
    auto: yes
    ifempty: no
    maxwidth: 0
@jackwilsdon
Copy link
Member

You're on a rather old version of beets, could you update to 1.3.18?

@sampsyo sampsyo added the needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature." label Jun 20, 2016
@bengadbois
Copy link
Author

Updated the original post with 1.3.18

@jackwilsdon jackwilsdon changed the title Runtime assert UnicodeDecodeError with beet list Jun 20, 2016
@jackwilsdon
Copy link
Member

I can reproduce this with the same command, it seems we have some problems with Unicode encoding in our command line parsing?

@sampsyo sampsyo added bug bugs that are confirmed and actionable and removed needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature." labels Jun 20, 2016
@sampsyo
Copy link
Member

sampsyo commented Jun 20, 2016

Yep, this looks like a real bug! It's reproducible for me just by typing beet ls -f 'é'. We should probably use our decargs() function instead of that plain unicode() call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs that are confirmed and actionable
Projects
None yet
Development

No branches or pull requests

3 participants