You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I have a few use cases where I'm loading iTunes libraries from sources other than an XML file on disk (for example, from a compressed archive or over a network). Previously, this was trivially possible, since Library.__init__() took an open file-like object as input to read XML from With the recent change to replace the obsolete readPlist function (26b3fdf), Library.__init__() now expects itunesxml to be a filename, since it calls open(itunesxml, 'rb') as f internally.
Would it be possible to restore the original behavior, perhaps intelligently detecting whether itunesxml is a filename or a file-like object? Something like:
ifos.path.isfile(itunesxml):
# itunesxml is a filename, and must be openedwithopen(itunesxml, 'rb') asf:
self.il=plistlib.load(f)
else:
# itunesxml is a file-like object and can be loaded directlyself.il=plistlib.load(f)
The text was updated successfully, but these errors were encountered:
Hello! I have a few use cases where I'm loading iTunes libraries from sources other than an XML file on disk (for example, from a compressed archive or over a network). Previously, this was trivially possible, since
Library.__init__()
took an open file-like object as input to read XML from With the recent change to replace the obsoletereadPlist
function (26b3fdf),Library.__init__()
now expectsitunesxml
to be a filename, since it callsopen(itunesxml, 'rb') as f
internally.Would it be possible to restore the original behavior, perhaps intelligently detecting whether
itunesxml
is a filename or a file-like object? Something like:The text was updated successfully, but these errors were encountered: