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

Updating to python 3.8.5 breaks beets, was working on 3.8.2 #3772

Closed
Extarys opened this issue Oct 10, 2020 · 2 comments
Closed

Updating to python 3.8.5 breaks beets, was working on 3.8.2 #3772

Extarys opened this issue Oct 10, 2020 · 2 comments

Comments

@Extarys
Copy link

Extarys commented Oct 10, 2020

Problem

Beet was working yesterday. This morning I made some system updates and now beets doesn't work. (Might be another issue than Python though)
Running this command in verbose (-vv) mode:

$ beet -vv ls

Led to this problem:

$ beet -vv ls
user configuration: /home/jer/.config/beets/config.yaml
data directory: /home/jer/.config/beets
plugin paths: 
Sending event: pluginload
lastgenre: Loading canonicalization tree /home/jer/.local/lib/python3.8/site-packages/beetsplug/lastgenre/genres-tree.yaml
Traceback (most recent call last):
  File "/home/jer/.local/bin/beet", line 8, in <module>
    sys.exit(main())
  File "/home/jer/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1266, in main
    _raw_main(args)
  File "/home/jer/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1249, in _raw_main
    subcommands, plugins, lib = _setup(options, lib)
  File "/home/jer/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1144, in _setup
    lib = _open_library(config)
  File "/home/jer/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1201, in _open_library
    get_path_formats(),
  File "/home/jer/.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/jer/.local/lib/python3.8/site-packages/beets/util/functemplate.py", line 571, in template
    return Template(fmt)
  File "/home/jer/.local/lib/python3.8/site-packages/beets/util/functemplate.py", line 581, in __init__
    self.compiled = self.translate()
  File "/home/jer/.local/lib/python3.8/site-packages/beets/util/functemplate.py", line 614, in translate
    func = compile_func(
  File "/home/jer/.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
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 76, in apport_excepthook
    binary = os.path.realpath(os.path.join(os.getcwd(), sys.argv[0]))
FileNotFoundError: [Errno 2] No such file or directory

Original exception was:
Traceback (most recent call last):
  File "/home/jer/.local/bin/beet", line 8, in <module>
    sys.exit(main())
  File "/home/jer/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1266, in main
    _raw_main(args)
  File "/home/jer/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1249, in _raw_main
    subcommands, plugins, lib = _setup(options, lib)
  File "/home/jer/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1144, in _setup
    lib = _open_library(config)
  File "/home/jer/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1201, in _open_library
    get_path_formats(),
  File "/home/jer/.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/jer/.local/lib/python3.8/site-packages/beets/util/functemplate.py", line 571, in template
    return Template(fmt)
  File "/home/jer/.local/lib/python3.8/site-packages/beets/util/functemplate.py", line 581, in __init__
    self.compiled = self.translate()
  File "/home/jer/.local/lib/python3.8/site-packages/beets/util/functemplate.py", line 614, in translate
    func = compile_func(
  File "/home/jer/.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

image

Setup

  • OS: Linux Linux Mint 20 Cinnamon 5.4.0-48-generic
  • Python version: 3.8
  • beets version: unknown, latest as of last week
  • Turning off plugins made problem go away (yes/no): No

My configuration (output of beet config) is:
Command gives an error. But here is my config, I commented a lot of lines to try and find if the config was the problem, doesn't appear to be.

directory: /media/NAS/Music
library: /media/hdd/.beet_library.blb
#logs: /media/hdd/opt/beet/library.log


original_date: no
per_disc_numbering: yes
threaded: yes
#clutter: ["Thumbs.DB", ".DS_Store", "*.m3u", ".pls"]
#ignore: ["*~", "System Volume Information"]

import:
    languages: en de fr jp
    move: yes
    copy: no
    bell: yes

ui:
    color: yes
    colors:
        text_success: green
        text_warning: yellow
        text_error: red
        text_highlight: red
        text_highlight_minor: lightgray
        action_default: turquoise
        action: cyan

plugins: inline convert bpm discogs lastgenre acousticbrainz scrub fromfilename chroma acousticbrainz beatport the ftintitle fetchart embedart

aunique:
    keys: albumartist album
    disambiguators: albumtype year label catalognum albumdisambig releasegroupdisambig
    bracket: '()'

set_fields:
    how: ''

# item_fields:
#     my_samplerate: str(round(samplerate / 1000))
#     my_bitrate: str(round(bitrate/1000))
#     is_flac: 1 if format == "FLAC" else 0
#     is_album: 1 if albumtype.upper() == "ALBUM" else 0
#     multidisc: 1 if disctotal > 1 else 0
#     vinyl: 1 if media in ['12" Vinyl', 'Vinyl'] else 0
#     compilation_display: '''Soundtracks'' if albumtype.upper() == ''SOUNDTRACK'' else ''Compilations'''
#     #first_artist: albumartist.split(', ',1)[0:1][0]

# album_fields:  
#     fileformat: |
#         formatList = []
#         for item in items:
#             formatList.append(item.format.upper())
#         return formatList
#     av_bitrate: |
#         total = 0
#         for item in items:
#             total += item.bitrate
#         return str(round(total / len(items) / 1000))
#     avg_samplerate: |
#         total = 0
#         for item in items:
#             total += item.samplerate
#         return str(round(total / len(items) / 1000))
#     avg_bitdepth: |
#         total = 0
#         for item in items:
#             total += item.bitdepth
#         return str(round(total / len(items)))

paths:
    #default: %upper{%left{%asciify{%the{$albumartist}},1}}/$albumartist/%if{$year,$year - ,%if{$original_year,$original_year - }}$album%aunique{} ($format)/%if{$multidisc,$disc-}$track - $title
    # Albums/A/ASCI Artist Name, The/[YEAR] ASCI Album Name, The [EP]/01 - Track Name.mp3
    # %bucket{%upper{%left{%the{$albumartist},1}}}/
    default: $title
    #default: '%the{$albumartist}/%if{$original_year,$original_year,0000} - $album%aunique{albumartist album year catalognum, catalognum albumtype label albumdisambig} [%ifdef{how,$how }%upper{$format}%if{$is_flac, $avg_samplerate-$avg_bitdepth, $av_bitrate}]/%if{$multidisc,$disc-}$track - $title'
    #albumtype:single: '%the{$albumartist}/Singles/%if{$original_year,$original_year,0000} - $album%aunique{albumartist album year catalognum, catalognum albumtype label albumdisambig} [%ifdef{how,$how }%upper{$format}%if{$is_flac, $avg_samplerate-$avg_bitdepth, $av_bitrate}]/%if{$multidisc,$disc-}$track - $title'
    #albumtype:ep: '%the{$albumartist}/EPs/%if{$original_year,$original_year,0000} - $album%aunique{albumartist album year catalognum, catalognum albumtype label albumdisambig} [%ifdef{how,$how }%upper{$format}%if{$is_flac, $avg_samplerate-$avg_bitdepth, $av_bitrate}]/%if{$multidisc,$disc-}$track - $title'
    #albumtype:soundtrack: Soundtracks/%if{$year,$year - ,%if{$original_year,$original_year - }}$album%aunique{} [%ifdef{how,$how }%upper{$format}%if{$is_flac, $avg_samplerate-$avg_bitdepth, $av_bitrate}]/%if{$vinyl,$track_alt,%if{$multidisc,$disc-}$track} - $title
    #comp: $compilation_display/%if{$year,$year - ,%if{$original_year,$original_year - }}$album%aunique{} [%ifdef{how,$how }%upper{$format}%if{$is_flac, $avg_samplerate-$avg_bitdepth, $av_bitrate}]/%if{$multidisc,$disc-}$track - $title
    #singleton: '%the{$artist}/Non-Album/$title%if{$original_year, ($original_year),%if{$year, ($year),}} [%ifdef{how,$how }%upper{$format}%if{$is_flac, $samplerate-$bitdepth, $my_bitrate}]'

replace:
    '[\\/]': _
    '^\.': _
    '[\x00-\x1f]': _
    '[<>:"\?\*\|]': _
    '\.$': _
    '\s+$': ''
    '^\s+': ''
    '^-': _
    '[\u2018\u2019]': ''''
    '[\u201c\u201d\u2033]': '"'

check:
    import: yes
    write-check: yes
    write-update: yes
    convert-update: yes
    threads: 4

ftintitle:
    auto: yes
    drop: no
    format: feat. {0}

lyrics:
  fallback: ''
  google_engine_ID: xxxxxxx
  google_API_key: xxxxxxx

lastgenre:
    min_weight: 80
    count: 5
    prefer_specific: yes
    separator: '; '

extrafiles:
    patterns:
        artworkdir:
          - '[sS]cans/'
          - '[aA]rtwork/'
        #lyrics:
        #  - '*.lrc'
        nfo:
          - 'album.nfo'
    paths:
        artworkdir: $albumpath/artwork
        #lyrics: $albumpath/$filename.lrc

embedart:
    # I dont want album art auto-embedded either
    auto: no

fetchart:
  auto: yes
  minwidth: 400
  maxwidth: 1600
  sources: filesystem coverart itunes amazon albumart

acousticbrainz:
    force: yes

acoustid:
    apikey: xxxxxxx
@jackwilsdon
Copy link
Member

This has been fixed on master but we haven't pushed a release containing the fix yet. See #3674.

@Extarys
Copy link
Author

Extarys commented Oct 10, 2020

@jackwilsdon Oh I'm sorry! Thanks!

I'll follow the instructions here: https://beets.readthedocs.io/en/latest/faq.html#run-the-latest-source-version-of-beets

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