"AttributeError: module 're' has no attribute '_pattern_type'" during import


#1

I get the following random error during import. I’ve remove albums that were next in line to see if they caused a problem. Sometimes it continued one/two albums but in the end it always exits with this error. Thanks for any ideas as to what this could be?

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

It’s a lot of verbose output but at the end you’ll find the error:

    user configuration: /Users/jpeeters/.config/beets/config.yaml
    data directory: /Users/jpeeters/.config/beets
    plugin paths: 
    Sending event: pluginload
    inline: adding item field multidisc
    inline: adding item field my_samplerate
    inline: adding item field is_flac
    inline: adding album field format
    inline: adding album field av_bitrate
    library database: /Users/jpeeters/Music/Beets/musiclibrary.db
    library directory: /Volumes/Stor/Tunez
    Sending event: library_opened
    Sending event: import_begin
    Import of the directory:
    /Volumes/Tunez/Tunez/1 Folder
    was interrupted. Resume (Y/n)? Y
    Resuming interrupted import of /Volumes/Tunez/Tunez/1 Folder
    Skipping previously-imported path: /Volumes/Tunez/Tunez/1 Folder/1 Giant Leap/1 Giant Leap
    Skipping previously-imported path: /Volumes/Tunez/Tunez/1 Folder/12 Tasty Grooves/12 

………………… I deleted part of the output here since it went past post max body characters.

    Correcting tags from:
    Searching for discovered album ID: 932ca638-2b97-4f90-8c94-41d60da54954
    Requesting MusicBrainz release 932ca638-2b97-4f90-8c94-41d60da54954
    A Tribe Called Quest - Midnight Marauders (V0)
    To:
    A Tribe Called Quest - Midnight Marauders
    URL:
    https://musicbrainz.org/release/f8ac3c95-897d-4b04-91c5-e643c24cc8ee
    (Similarity: 99.8%) (album) (CD, 1997, AU, Mushroom Records)
     * Keep It Rollin' -> Keep It Rollin’
     * Lyrics To Go    -> Lyrics to Go
    Sending event: import_task_choice
    Sending event: import_task_apply
    0 of 15 items replaced
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    acousticbrainz: getting data for: A Tribe Called Quest - The Anthology - Scenario
    Sending event: database_change
    primary MB release type: album
    Sending event: albuminfo_received
    Candidate: A Tribe Called Quest - People’s Instinctive Travels and the Paths of Rhythm (1c65dc93-6748-3bb5-be18-bdbbad7f8d42)
    Sending event: database_change
    Computing track assignment...
    Sending event: database_change
    ...done.
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: database_change
    Sending event: import_task_created
    Sending event: database_change
    acousticbrainz: getting data for: A Tribe Called Quest - The Anthology - Buggin’ Out
    Sending event: database_change
    acousticbrainz: getting data for: A Tribe Called Quest - The Anthology - Electric Relaxation
    Sending event: database_change
    acousticbrainz: getting data for: A Tribe Called Quest - The Anthology - Jazz (We’ve Got)
    Sending event: database_change
    acousticbrainz: getting data for: A Tribe Called Quest - The Anthology - I Left My Wallet in El Segundo
    Sending event: database_change
    acousticbrainz: getting data for: A Tribe Called Quest - The Anthology - Hot Sex
    Sending event: database_change
    acousticbrainz: getting data for: A Tribe Called Quest - The Anthology - Oh My God
    Sending event: database_change
    acousticbrainz: getting data for: A Tribe Called Quest feat. Faith Evans - The Anthology - Stressed Out
    Sending event: database_change
    acousticbrainz: getting data for: A Tribe Called Quest - The Anthology - Luck of Lucien
    Sending event: database_change
    acousticbrainz: getting data for: A Tribe Called Quest - The Anthology - Description of a Fool
    Sending event: database_change
    acousticbrainz: getting data for: A Tribe Called Quest - The Anthology - Keeping It Moving
    Sending event: database_change
    acousticbrainz: getting data for: A Tribe Called Quest - The Anthology - Find a Way
    Sending event: database_change
    acousticbrainz: getting data for: A Tribe Called Quest - The Anthology - Sucka Nigga
    Sending event: database_change
    acousticbrainz: getting data for: Violator feat. Q‐Tip - The Anthology - Vivrant Thing
    Sending event: database_change
    Sending event: album_imported
    Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/3.7/bin/beet", line 11, in <module>
    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 246, in distance
    album_info.album_id)
      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

Please see:


#3

Thanks for pointing me towards the issues tracker. A place I will visit first in the future when experiencing an error :wink:.