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 absubmit: TypeError: the JSON object must be str, not 'bytes' #3070

Closed
gorgobacka opened this issue Nov 1, 2018 · 2 comments
Closed
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."

Comments

@gorgobacka
Copy link

Problem

Running beets absubmit produced the following error.

Running this command in verbose (-vv) mode:

$ beet -vv absubmit
user configuration: /home/noname/.config/beets/config.yaml
data directory: /home/noname/.config/beets
plugin paths: 
Sending event: pluginload
inline: adding item field multidisc
inline: adding item field bool_mp3
inline: adding item field custom_catalog
library database: /home/xxxxxxx/imported/musiclibrary.blb
library directory: /home/xxxxxxx/imported
Sending event: library_opened
Traceback (most recent call last):
  File "/usr/local/bin/beet", line 11, in <module>
    load_entry_point('beets==1.4.7', 'console_scripts', 'beet')()
  File "/usr/local/lib/python3.5/dist-packages/beets/ui/__init__.py", line 1256, in main
    _raw_main(args)
  File "/usr/local/lib/python3.5/dist-packages/beets/ui/__init__.py", line 1243, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/usr/local/lib/python3.5/dist-packages/beetsplug/absubmit.py", line 108, in command
    analysis = self._get_analysis(item)
  File "/usr/local/lib/python3.5/dist-packages/beetsplug/absubmit.py", line 137, in _get_analysis
    analysis = json.load(tmp_file)
  File "/usr/lib/python3.5/json/__init__.py", line 268, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
    s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'

Setup

  • OS: Linux Mint
  • Python version: 3.5.2
  • beets version: 1.4.7
  • Turning off plugins made problem go away (yes/no): no

It's do to this PR: #2673.

This change works for me:

with open(filename, 'r') as tmp_file:
@sampsyo
Copy link
Member

sampsyo commented Nov 1, 2018

Hi! That looks bad—can you please open a pull request with that change so we can try it out?

@sampsyo sampsyo added the needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature." label Nov 1, 2018
gorgobacka added a commit to gorgobacka/beets that referenced this issue Nov 2, 2018
@gorgobacka
Copy link
Author

A newer version of Python fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."
Projects
None yet
Development

No branches or pull requests

2 participants