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

[replaygain] TypeError: must be str or None, not bytes #2382

Closed
ArchangeGabriel opened this issue Jan 10, 2017 · 3 comments
Closed

[replaygain] TypeError: must be str or None, not bytes #2382

ArchangeGabriel opened this issue Jan 10, 2017 · 3 comments

Comments

@ArchangeGabriel
Copy link

Problem

Running this command in verbose (-vv) mode:

$ beet -vv replaygain -a

Led to this problem (also without -a):

user configuration: /home/<user>/.config/beets/config.yaml
data directory: /home/<user>/.config/beets
plugin paths: 
Sending event: pluginload
library database: /home/<user>/.config/beets/library.db
library directory: <path_to_music_dir>
Sending event: library_opened
replaygain: analyzing <some track>
Traceback (most recent call last):
  File "/usr/bin/beet", line 11, in <module>
    load_entry_point('beets==1.4.3', 'console_scripts', 'beet')()
  File "/usr/lib/python3.6/site-packages/beets/ui/__init__.py", line 1209, in main
    _raw_main(args)
  File "/usr/lib/python3.6/site-packages/beets/ui/__init__.py", line 1196, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/usr/lib/python3.6/site-packages/beetsplug/replaygain.py", line 943, in func
    self.handle_album(album, write)
  File "/usr/lib/python3.6/site-packages/beetsplug/replaygain.py", line 878, in handle_album
    album_gain = self.backend_instance.compute_album_gain(album)
  File "/usr/lib/python3.6/site-packages/beetsplug/replaygain.py", line 136, in compute_album_gain
    output = self.compute_gain(supported_items, True)
  File "/usr/lib/python3.6/site-packages/beetsplug/replaygain.py", line 189, in compute_gain
    return self.compute_chunk_gain(items, is_album)
  File "/usr/lib/python3.6/site-packages/beetsplug/replaygain.py", line 213, in compute_chunk_gain
    len(items) + is_album)
  File "/usr/lib/python3.6/site-packages/beetsplug/replaygain.py", line 230, in parse_tool_output
    part = parts.split(b'\n')
TypeError: must be str or None, not bytes
user configuration: /home/<user>/.config/beets/config.yaml
data directory: /home/<user>/.config/beets
plugin paths: 
Sending event: pluginload
library database: /home/<user>/.config/beets/library.db
library directory: <path_to_music_dir>
Sending event: library_opened
replaygain: analyzing <some_track>
Traceback (most recent call last):
  File "/usr/bin/beet", line 11, in <module>
    load_entry_point('beets==1.4.3', 'console_scripts', 'beet')()
  File "/usr/lib/python3.6/site-packages/beets/ui/__init__.py", line 1209, in main
    _raw_main(args)
  File "/usr/lib/python3.6/site-packages/beets/ui/__init__.py", line 1196, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/usr/lib/python3.6/site-packages/beetsplug/replaygain.py", line 947, in func
    self.handle_track(item, write)
  File "/usr/lib/python3.6/site-packages/beetsplug/replaygain.py", line 910, in handle_track
    track_gains = self.backend_instance.compute_track_gain([item])
  File "/usr/lib/python3.6/site-packages/beetsplug/replaygain.py", line 125, in compute_track_gain
    output = self.compute_gain(items, False)
  File "/usr/lib/python3.6/site-packages/beetsplug/replaygain.py", line 189, in compute_gain
    return self.compute_chunk_gain(items, is_album)
  File "/usr/lib/python3.6/site-packages/beetsplug/replaygain.py", line 213, in compute_chunk_gain
    len(items) + is_album)
  File "/usr/lib/python3.6/site-packages/beetsplug/replaygain.py", line 230, in parse_tool_output
    part = parts.split(b'\n')
TypeError: must be str or None, not bytes

Setup

  • OS: ArchLinux
  • Python version: 3.6
  • beets version: 1.4.3
  • Turning off plugins made problem go away (yes/no): hum… yes? :p

My configuration (output of beet config) is:

user configuration: /home/<user>/.config/beets/config.yaml
data directory: /home/<user>/.config/beets
plugin paths: 
Sending event: pluginload
library database: /home/<user>/.config/beets/library.db
library directory: <path_to_music_dir>
Sending event: library_opened
directory: <path_to_music_dir>
verbose: 2

replace:
    '[\\/]': _
    ^\.: _
    '[\x00-\x1f]': _
per_disc_numbering: yes
va_name: Compilations

plugins: replaygain

import:
    copy: no
    write: no
    timid: yes
    log: <path_to_log>

paths:
    default: "$albumartist/$original_year \u2013 $album/%if{$multidisc,$disc-}$track. $title"
    comp: "Compilations/$original_year \u2013 $album/%if{$multidisc,$disc-}$track. $title"
item_fields:
    multidisc: 1 if disctotal > 1 else 0
replaygain:
    backend: bs1770gain
    auto: no
    overwrite: no
    targetlevel: 89
    chunk_at: 5000
    method: replaygain

Please ask if you need more information to debug this.

@sampsyo
Copy link
Member

sampsyo commented Jan 10, 2017

Thanks! I just pushed a fix. Can you give the latest version a try?

@ArchangeGabriel
Copy link
Author

Seems to work. Thanks for the quick fix!

@sampsyo
Copy link
Member

sampsyo commented Jan 10, 2017

Woohoo! Thanks for checking.

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