My fix removes specials characters, so plistlib can do its job.
Here is a stack trace:
2016-11-28 22:37:20 INFO: Outputting iTunes XML to '/Users/lendar/Music/iTunes/iTunes Library.xml'...
Traceback (most recent call last):
File "./swinsian2itlxml.py", line 327, in <module>
main()
File "./swinsian2itlxml.py", line 322, in main
itunes_music_folder=args.itunes_music_folder)
File "./swinsian2itlxml.py", line 312, in generate_xml
plistlib.writePlist(plist_dict, itunes_xml)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 94, in writePlist
writer.writeValue(rootObject)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 252, in writeValue
self.writeDict(value)
File "./swinsian2itlxml.py", line 37, in writeDict
self.writeValue(value)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 252, in writeValue
self.writeDict(value)
File "./swinsian2itlxml.py", line 37, in writeDict
self.writeValue(value)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 252, in writeValue
self.writeDict(value)
File "./swinsian2itlxml.py", line 37, in writeDict
self.writeValue(value)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 239, in writeValue
self.simpleElement("string", value)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 172, in simpleElement
value = _escapeAndEncode(value)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 215, in _escapeAndEncode
raise ValueError("strings can't contains control characters; "
ValueError: strings can't contains control characters; use plistlib.Data instead
Crash is caused by this code in plistlib.py: https://github.com/enthought/Python-2.7.3/blob/master/Lib/plistlib.py#L215
My fix removes specials characters, so plistlib can do its job.
Here is a stack trace: