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

Comments

Projects
None yet
3 participants
@bengadbois

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

This comment has been minimized.

Show comment
Hide comment
@jackwilsdon

jackwilsdon Jun 20, 2016

Member

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

Member

jackwilsdon commented Jun 20, 2016

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

@sampsyo sampsyo added the needinfo label Jun 20, 2016

@bengadbois

This comment has been minimized.

Show comment
Hide comment
@bengadbois

bengadbois Jun 20, 2016

Updated the original post with 1.3.18

bengadbois commented Jun 20, 2016

Updated the original post with 1.3.18

@jackwilsdon jackwilsdon changed the title from Runtime assert to UnicodeDecodeError with beet list Jun 20, 2016

@jackwilsdon

This comment has been minimized.

Show comment
Hide comment
@jackwilsdon

jackwilsdon Jun 20, 2016

Member

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

Member

jackwilsdon commented Jun 20, 2016

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 and removed needinfo labels Jun 20, 2016

@sampsyo

This comment has been minimized.

Show comment
Hide comment
@sampsyo

sampsyo Jun 20, 2016

Member

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.

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.

@sampsyo sampsyo closed this in 133c82b Jun 21, 2016

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