Standardise_performers plugin doesn't work with python3

Hi

I try to use the standarize_performers plugin from the API v2 download page but it gives the following error:

D: 15:35:18,618 /home/vzell/.config/MusicBrainz/Picard/plugins/standardise_performers.zip/standardise_performers.standardise_performers:50: Standardise Performers: Splitting Performer [acoustic guitar and harmonica] into separate performers
E: 15:35:18,620 album.error_append:200: Traceback (most recent call last):
File “./picard/album.py”, line 330, in _finalize_loading_track
run_track_metadata_processors(self, tm, self._release_node, track_node)
File “./picard/metadata.py”, line 358, in run_track_metadata_processors
_track_metadata_processors.run(track_object, metadata, track, release)
File “./picard/plugin.py”, line 510, in run
function(*args, **kwargs)
File “/home/vzell/.config/MusicBrainz/Picard/plugins/standardise_performers.zip/standardise_performers.py”, line 38, in standardise_performers
for key, values in metadata.rawitems():
RuntimeError: dictionary changed size during iteration

This seems to be a Python2.x/3 issue

I have zero skill or knowledge in python as a programming language, but I was able to self-fix the release type plugin that was not working with Picard v2.0 in a manner that seems similar to what you are experiencing.

In Python3 some of the terms have changed. All I had to do was go to the line number that was being referenced in the error and change “iteritems” to “items” to conform with the new style. There are other such changes like “xrange” is now “range”. Works flawlessly now with no other changes required.

So if you unzip the plugin and use a .py editor you can try changing these terms in the code, re-zip, and see if that fixes it for you.

2 Likes

I encounter the same:

So this is probably not a Picard 2.x issue but an issue with the plugin?
Then hopefully @Sophist is able to take a look at it.

First thing we need to know is whether this error occurs in the Picard 1.x version of the plugin or the Picard 2.0 version.

I’m pretty sure I activated it from within Picard 2.0, so it would probably be the latter.

copy/paste:
PLUGIN_VERSION = ‘0.2’
PLUGIN_API_VERSIONS = [“0.15.0”, “0.15.1”, “0.16.0”, “1.0.0”, “1.1.0”, “1.2.0”, “1.3.0”, “2.0”]

Well - it was working OK on V1 so I can only assume that the problem has arisen in the conversion to v2.

I really need a repeatable example of e.g. an album that creates the problem in order that I can replicate it.

And I need time I currently don’t have to recreate the issue and determine how to fix it. Sorry.

P.S. I think it would help to create a Github issue in Picard-Plugins to hold as much detail as possible on recreating this issue and on the errors that occur.

I had a look at this, turns out this is indeed an issue caused by the migration to Python 3.

I have created a pull request with a fix on https://github.com/metabrainz/picard-plugins/pull/155

If you want to test this please give the updated plugin a try by placing standardise_performers.py in your plugins folder (and remove standardise_performers…zip if present).

2 Likes

@outsidecontext Philip - Thanks for looking at this - I just don’t have the time at present.

Thanks outsidecontext, this seems to have fixed it for me.

The patch was merged, and new plugin version deployed via Picard website.

2 Likes