AttributeError: module 're' has no attribute '_pattern_type'


#1

I’m running into an error with beets. I just installed it and things worked at first, but now it keep’s giving me the same error after I set things up, even with a minimal config.

Someone on the IRC chan suggested the following Phyton issue as cause.
https://github.com/python/cpython/pull/1646/files

Below is the verbose output

Thanks for the support

beet -vv import Music/iTunes/iTunes\ Media/Music/Raul\ Midón/
user configuration: /Users/***/.config/beets/config.yaml
data directory: /Users/***/.config/beets
plugin paths:
Sending event: pluginload
library database: /Users/***/Music/iTunes/musiclibrary.db
library directory: /Users/***/Music/iTunes/iTunes\ Media/Music
Sending event: library_opened
Sending event: import_begin
Sending event: import_task_created
Sending event: import_task_start
Looking up: /Users/**/Music/iTunes/iTunes Media/Music/Raul Midón/State of Mind
Tagging Raul Midón - State of Mind
Searching for discovered album ID: f07c9a36-6a3d-4597-b28e-7bcc01e556f2
Requesting MusicBrainz release f07c9a36-6a3d-4597-b28e-7bcc01e556f2
primary MB release type: album
Sending event: albuminfo_received
Candidate: Raul Midón - State of Mind (f07c9a36-6a3d-4597-b28e-7bcc01e556f2)
Computing track assignment…
…done.
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.7/bin/beet”, line 11, in
sys.exit(main())
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/beets/ui/init.py”, line 1256, in main
_raw_main(args)
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/beets/ui/init.py”, line 1243, in _raw_main
subcommand.func(lib, suboptions, subargs)
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/beets/ui/commands.py”, line 943, in import_func
import_files(lib, paths, query)
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/beets/ui/commands.py”, line 913, in import_files
session.run()
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/beets/importer.py”, line 329, in run
pl.run_parallel(QUEUE_SIZE)
File “/Library/Frameworks/Python.framework/Versions/3.7/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 “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/six.py”, line 693, in reraise
raise value
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/beets/util/pipeline.py”, line 312, in run
out = self.coro.send(msg)
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/beets/util/pipeline.py”, line 194, in coro
func(
(args + (task,)))
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/beets/importer.py”, line 1351, in lookup_candidates
task.lookup_candidates()
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/beets/importer.py”, line 641, in lookup_candidates
autotag.tag_album(self.items, search_ids=self.search_ids)
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/beets/autotag/match.py”, line 432, in tag_album
_add_candidate(items, candidates, id_info)
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/beets/autotag/match.py”, line 377, in _add_candidate
dist = distance(items, info, mapping)
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/beets/autotag/match.py”, line 191, in distance
dist.add_equality(‘media’, album_info.media, likelies[‘media’])
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/beets/autotag/hooks.py”, line 461, in add_equality
if self._eq(opt, value):
File “/Library/Frameworks/Python.framework/Versions/3.7/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’


#2

See: https://github.com/beetbox/beets/issues/2986


#3

Thanks! I managed to fix the issue with those instructions.