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

Python 3.7 incompatibility #2978

Closed
kimpenhaus opened this issue Jul 5, 2018 · 7 comments

Comments

Projects
None yet
4 participants
@kimpenhaus
Copy link

commented Jul 5, 2018

Problem

After upgrading to the latest stable of Python an AttributeError is thrown due to changes in the regular expression module of python 3.7.

Traceback (most recent call last):
  File "/usr/local/bin/beet", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/beets/ui/__init__.py", line 1256, in main
    _raw_main(args)
  File "/usr/local/lib/python3.7/site-packages/beets/ui/__init__.py", line 1243, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/usr/local/lib/python3.7/site-packages/beets/ui/commands.py", line 943, in import_func
    import_files(lib, paths, query)
  File "/usr/local/lib/python3.7/site-packages/beets/ui/commands.py", line 913, in import_files
    session.run()
  File "/usr/local/lib/python3.7/site-packages/beets/importer.py", line 329, in run
    pl.run_parallel(QUEUE_SIZE)
  File "/usr/local/lib/python3.7/site-packages/beets/util/pipeline.py", line 445, in run_parallel
    six.reraise(exc_info[0], exc_info[1], exc_info[2])
  File "/usr/local/lib/python3.7/site-packages/six.py", line 693, in reraise
    raise value
  File "/usr/local/lib/python3.7/site-packages/beets/util/pipeline.py", line 312, in run
    out = self.coro.send(msg)
  File "/usr/local/lib/python3.7/site-packages/beets/util/pipeline.py", line 194, in coro
    func(*(args + (task,)))
  File "/usr/local/lib/python3.7/site-packages/beets/importer.py", line 1351, in lookup_candidates
    task.lookup_candidates()
  File "/usr/local/lib/python3.7/site-packages/beets/importer.py", line 641, in lookup_candidates
    autotag.tag_album(self.items, search_ids=self.search_ids)
  File "/usr/local/lib/python3.7/site-packages/beets/autotag/match.py", line 432, in tag_album
    _add_candidate(items, candidates, id_info)
  File "/usr/local/lib/python3.7/site-packages/beets/autotag/match.py", line 377, in _add_candidate
    dist = distance(items, info, mapping)
  File "/usr/local/lib/python3.7/site-packages/beets/autotag/match.py", line 191, in distance
    dist.add_equality('media', album_info.media, likelies['media'])
  File "/usr/local/lib/python3.7/site-packages/beets/autotag/hooks.py", line 461, in add_equality
    if self._eq(opt, value):
  File "/usr/local/lib/python3.7/site-packages/beets/autotag/hooks.py", line 436, in _eq
    if isinstance(value1, re._pattern_type):
AttributeError: module 're' has no attribute '_pattern_type'

This is related to following changes: python/cpython#1646
From what I saw _pattern_type is replaced by Pattern - see https://github.com/python/cpython/pull/1646/files#diff-daea55f2fca784d9a64ca8f190403904 around Line 267 - 272

Setup

  • OS: macOS 10.13.5
  • Python version: 3.7
  • beets version: 1.4.7
  • Turning off plugins made problem go away (yes/no): no

My configuration (output of beet config) is:

directory: /Volumes/music/

paths:
    default: $albumartist/$album/%if{$disc == 0 && $totaldisc == 1, 01, $disc} - $track - $title
    comp: Compilations/$album/%if{$disc == 0 && $totaldisc == 1, 01, $disc} - $track - $title

ignore: ['Ringtones', '#recycle', '.*', '*~', 'System Volume Information', 'lost+found', '.m4r']

format_item: ($format) $artist - $album - $track - $title

clutter: ['Thumbs.db', '.DS_Store', '*.m3u', '*.pls', '*.nfo', '*.sfv', '*.jpg', '*.jpeg', '*.png', '*.url', '*.URL', '*.txt', '*.ini']

import:
    copy: no
    write: yes
    move: yes

plugins: [discogs, bandcamp, fetchart, embedart, chroma, zero, scrub, duplicates, missing, edit, lastgenre, ftintitle]

bandcamp:
    art: yes

fetchart:
    cautious: yes
    minwidth: 200
    maxwidth: 200
    enforce_ratio: yes
    sources: [filesystem, bandcamp, coverart, amazon, albumart, wikipedia, google]

zero:
    fields: comments
    update_database: yes

lastgenre:
    source: album
    count: 5
    force: yes
    canonical: '~/Documents/git/india.kimpenhaus.home/beets/genres-tree.yaml'
    whitelist: '~/Documents/git/india.kimpenhaus.home/beets/genres.txt'
    prefer_specific: yes
    min_weight: 0
    fallback: ''
    separator: ';'

missing:
    format: $albumartist - $album - $title
    count: no
    total: no

edit:
    itemfields: [track, title, artist, albumartist, album, genre]

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

This comment has been minimized.

Copy link
Member

commented Jul 5, 2018

Oh dear; that's alarming! Thanks for pointing this out.

It looks like we'll need a fix like this:
https://github.com/getsentry/responses/pull/196/files

@translit

This comment has been minimized.

Copy link
Contributor

commented Aug 10, 2018

Adrian, I'm having this issue too. How should I upgrade beets to apply your fix?

@sampsyo

This comment has been minimized.

Copy link
Member

commented Aug 10, 2018

Yo! I should release it very soon, but in the mean time there's an FAQ about that:
http://docs.beets.io/en/v1.4.7/faq.html#run-the-latest-source-version-of-beets

@translit

This comment has been minimized.

Copy link
Contributor

commented Aug 10, 2018

Oh, yes. Funny, how I overlooked that FAQ entry. You're helpful as ever. Thanks so much.

@tarrasque73

This comment has been minimized.

Copy link

commented Mar 29, 2019

Perdon me, but I installed beets some days ago and the problem still persists.

Hasn't the fix been pushed to the release yet? Do I need to get the code from git?

@sampsyo

This comment has been minimized.

Copy link
Member

commented Mar 29, 2019

Hasn't the fix been pushed to the release yet

No.

Do I need to get the code from git?

Yes.

@tarrasque73

This comment has been minimized.

Copy link

commented Mar 29, 2019

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.