I'm trying to parse through a massive file for an iTunes library and I'm attempting to use plistlib library.
My code looks something like this:
import plistlib
with open('iTunes Music Library.xml') as fp:
pl = plistlib.load(fp)
print(pl["aKey"])
As I do so, I get the error:
TypeError: startswith first arg must be str or a tuple of str, not bytes
I'm not sure what this is, any explanations?
As stated in the docs,
plistlib.loadtakes a binary file object. You've given it a file opened in text mode.