Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeprecationWarning: The readPlist function is deprecated #18

Open
renato0584 opened this issue Aug 29, 2018 · 2 comments
Open

DeprecationWarning: The readPlist function is deprecated #18

renato0584 opened this issue Aug 29, 2018 · 2 comments

Comments

@renato0584
Copy link

renato0584 commented Aug 29, 2018

The code presents the following error:

anatomyPlaylist.py:16: DeprecationWarning: The readPlist function is deprecated, use load() instead
plist = plistlib.readPlist(fileName)
Traceback (most recent call last):
File "anatomyPlaylist.py", line 162, in
main()
File "anatomyPlaylist.py", line 149, in main
findCommonTracks(args.plFiles)
File "anatomyPlaylist.py", line 16, in findCommonTracks
plist = plistlib.readPlist(fileName)
File "C:\Users\ext.renatoss1\AppData\Local\Programs\Python\Python37-32\lib\plistlib.py", line 100, in readPlist
return load(fp, fmt=None, use_builtin_types=False)
File "C:\Users\ext.renatoss1\AppData\Local\Programs\Python\Python37-32\lib\plistlib.py", line 944, in load
raise InvalidFileException()
plistlib.InvalidFileException: Invalid file

I've changed the line:

plist = plistlib.readPlist(fileName)

to

plist = np.load(fileName)

but, the error changed to:

Traceback (most recent call last):
File "C:\Users\ext.renatoss1\AppData\Local\Programs\Python\Python37-32\lib\site-packages\numpy\lib\npyio.py", line 440, in load
return pickle.load(fid, **pickle_kwargs)_pickle.UnpicklingError: invalid load key, '\x0a'.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "anatomyPlaylist.py", line 162, in
main()
File "anatomyPlaylist.py", line 149, in main
findCommonTracks(args.plFiles)
File "anatomyPlaylist.py", line 16, in findCommonTracks
plist = np.load(fileName)
File "C:\Users\ext.renatoss1\AppData\Local\Programs\Python\Python37-32\lib\sit
e-packages\numpy\lib\npyio.py", line 443, in load
"Failed to interpret file %s as a pickle" % repr(file))
OSError: Failed to interpret file 'maya.xml' as a pickle

Of course there is some other modification to make, but I can't figure it out yet.

Advices?

Thanks and sorry for my poor english.

@kanzhong
Copy link

kanzhong commented Jun 3, 2019

with open(filename,'rb') as fp:
pl=plistlib.load(fp)

@rsersh
Copy link

rsersh commented Oct 26, 2019

Submitted PR #22 to accommodate this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants