Beets: during pluginload ... Name node can't be used with 'None' constant

Created on 18 Jul 2020  路  8Comments  路  Source: beetbox/beets

Problem

running beet <any command> crashes

ValueError: Name node can't be used with 'None' constant

Running this command in verbose (-vv) mode:

$ beet -vv help

Led to this problem:

user configuration: /home/rmnull/.config/beets/config.yaml
data directory: /home/rmnull/.config/beets
plugin paths: 
Sending event: pluginload
Traceback (most recent call last):
  File "/home/rmnull/.local/bin/beet", line 8, in <module>
    sys.exit(main())
  File "/home/rmnull/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1266, in main
    _raw_main(args)
  File "/home/rmnull/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1249, in _raw_main
    subcommands, plugins, lib = _setup(options, lib)
  File "/home/rmnull/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1144, in _setup
    lib = _open_library(config)
  File "/home/rmnull/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1201, in _open_library
    get_path_formats(),
  File "/home/rmnull/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 619, in get_path_formats
    path_formats.append((query, template(view.as_str())))
  File "/home/rmnull/.local/lib/python3.8/site-packages/beets/util/functemplate.py", line 571, in template
    return Template(fmt)
  File "/home/rmnull/.local/lib/python3.8/site-packages/beets/util/functemplate.py", line 581, in __init__
    self.compiled = self.translate()
  File "/home/rmnull/.local/lib/python3.8/site-packages/beets/util/functemplate.py", line 614, in translate
    func = compile_func(
  File "/home/rmnull/.local/lib/python3.8/site-packages/beets/util/functemplate.py", line 155, in compile_func
    prog = compile(mod, '<generated>', 'exec')
ValueError: Name node can't be used with 'None' constant

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

Setup

  • OS: Linux eos 5.7.9_1 #1 SMP Thu Jul 16 10:02:50 UTC 2020 x86_64 GNU/Linux
  • Python version: 3.8.4
  • beets version: 1.4.9(referred from pip list, beet --version crashes)
  • Turning off plugins made problem go away (yes/no): no

My configuration (output of beet config) is:
beet config crashes with the same error mentioned above.
However beet config -e works fine

directory: /tmp/Music/
library: /tmp/Music/beets_library.db
import:
  move: no

Other Notes

The problem persists on reinstall
sh $ pip3 uninstall beets $ pip3 install beets $ beet help # same crash

I don't see this as a problem in beets,
There was no problem installing beets in docker.
Clarification: Asking it as a question to have this issue resolved rather than pointing it as bug in beets.

Most helpful comment

Running the latest source version of beets is probably the simplest option for the time being.

All 8 comments

@wisp3rwind thanks

Any workaround while we wait for the next release?

Running the latest source version of beets is probably the simplest option for the time being.

64bit W10, 64bit Py3.9.0, beets version 1.4.9 - same problem

@AssenD please see #3621 and #3625 (as mentioned in this comment).

A simple workaround on my Ubuntu machine was to force a specific version of python by changing the shebang in ~/.local/bin/beet from:

#!/usr/bin/python3

to:

#!/usr/bin/python3.6

Probably 3.7 would work as well, if that version of Python is installed on your machine.

Probably 3.7 would work as well, if that version of Python is installed on your machine.

Yeah, most likely, the relevant Python change wasn't backported to 3.7 as far as I can tell.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ctrueden picture ctrueden  路  3Comments

clounie picture clounie  路  3Comments

Moonbase59 picture Moonbase59  路  4Comments

udiboy1209 picture udiboy1209  路  3Comments

foways picture foways  路  5Comments