diff -ur picard.orig/formats/id3.py picard/formats/id3.py --- picard.orig/formats/id3.py 2015-01-06 23:01:43.000000000 +0100 +++ picard/formats/id3.py 2016-08-08 12:09:32.613315575 +0200 @@ -35,23 +35,23 @@ # Ugly, but... I need to save the text in ISO-8859-1 even if it contains # unsupported characters and this better than encoding, decoding and # again encoding. -def patched_EncodedTextSpec_write(self, frame, value): +def patched_EncodedTextSpec_write(self, config, frame, value): try: enc, term = self._encodings[frame.encoding] except AttributeError: enc, term = self.encodings[frame.encoding] return value.encode(enc, 'ignore') + term -id3.EncodedTextSpec.write = patched_EncodedTextSpec_write +id3._specs.EncodedTextSpec.write = patched_EncodedTextSpec_write # One more "monkey patch". The ID3 spec says that multiple text # values should be _separated_ by the string terminator, which # means that e.g. 'a\x00' are two values, 'a' and ''. -def patched_MultiSpec_write(self, frame, value): - data = self._write_orig(frame, value) +def patched_MultiSpec_write(self, config, frame, value): + data = self._write_orig(config, frame, value) spec = self.specs[-1] - if isinstance(spec, id3.EncodedTextSpec): + if isinstance(spec, id3._specs.EncodedTextSpec): try: term = spec._encodings[frame.encoding][1] except AttributeError: @@ -61,8 +61,8 @@ return data -id3.MultiSpec._write_orig = id3.MultiSpec.write -id3.MultiSpec.write = patched_MultiSpec_write +id3._specs.MultiSpec._write_orig = id3._specs.MultiSpec.write +id3._specs.MultiSpec.write = patched_MultiSpec_write id3.TCMP = compatid3.TCMP diff -ur picard.orig/formats/mutagenext/compatid3.py picard/formats/mutagenext/compatid3.py --- picard.orig/formats/mutagenext/compatid3.py 2016-08-08 09:57:59.177734598 +0200 +++ picard/formats/mutagenext/compatid3.py 2016-08-08 12:09:32.613315575 +0200 @@ -23,7 +23,8 @@ import mutagen from mutagen._util import insert_bytes from mutagen.id3 import ID3, Frames, Frames_2_2, TextFrame, TORY, \ - TYER, TIME, APIC, IPLS, TDAT, BitPaddedInt, MakeID3v1 + TYER, TIME, APIC, IPLS, TDAT, MakeID3v1 +from mutagen.id3._util import BitPaddedInt class TCMP(TextFrame):