Re.error: invalid group reference 48 at position 24 - What does that mean?

Any idea what this means? “re.error: invalid group reference 48 at position 24”

I have several CD that are red, and the error is a bunch of code. Sometimes the reference and position are different. Google and website searches turned up nothing. It seems I can save the songs if I like.

Here is the complete text from one of the errors.

Traceback (most recent call last):
  File "album.py", line 407, in _finalize_loading_track
  File "metadata.py", line 655, in run_track_metadata_processors
  File "plugin.py", line 257, in run
  File "C:\Users\JON_i9_CPU\AppData\Local\MusicBrainz\Picard\plugins\smart_title_case.zip\smart_title_case.py", line 121, in title_case
    new_artist = [artist_title_case(x, artists, new_artists) for x in artist]
  File "C:\Users\JON_i9_CPU\AppData\Local\MusicBrainz\Picard\plugins\smart_title_case.zip\smart_title_case.py", line 121, in <listcomp>
    new_artist = [artist_title_case(x, artists, new_artists) for x in artist]
  File "C:\Users\JON_i9_CPU\AppData\Local\MusicBrainz\Picard\plugins\smart_title_case.zip\smart_title_case.py", line 73, in artist_title_case
    result = re.sub(find, replace, string_cleanup(text))
  File "re.py", line 210, in sub
  File "re.py", line 327, in _subx
  File "re.py", line 318, in _compile_repl
  File "sre_parse.py", line 1036, in parse_template
  File "sre_parse.py", line 980, in addgroup
re.error: invalid group reference 48 at position 24

This looks like a bug in the smart title case plugin. Which releases on MB do cause the issue?

As an alternative to the plugin you could also use the built-in $title scripting function.

E.g.

$set(album,$title(%album%))
$set(title,$title(%title%))
1 Like

There are some 20 albums. Do you want me to list them or just turn the plug in off?

If you give me the link to two or three albums in MB I can debug this and see that I get the plugin fixed. That would be great.

For you personally the fastest way to deal with this and be able to load the releases will indeed be to turn of the plugin.

2 Likes

Here are the first 4. Info page then the error page.


1 Like




Thank you very much for the examples. I could find and fix the issue. The problem were artist names starting with numbers, e.g. in “Kesha feat. 3OH!3”. That would cause issue with the replacements the Smart Title Case plugin was doing.

The updated version 0.4.1 of the Smart Title Case plugin will be available as an update later today from inside Picard.

2 Likes

Thank you! (I typed this because to this dumb computer system a simple sign of gratitude to the programmer is not enough, and I have to add 20 characters.)

2 Likes