Python Plistlib File Invaded By Cocoa Values?
Solution 1:
I had the similar problem before, after I try biplist, it's solved.
Solution 2:
Binary plist support has been added to plistlib
since python 3.4.
https://docs.python.org/3.4/library/plistlib.html
Solution 3:
There's actually two categories of plist
format. One is actually simple XML file (which plistlib
knows how to parse with expat
), the other one is binary property list
.
Unfortunately they both share the same suffix .plist
, and all the tools from Apple treat them transparently (e.g. you don't know if you are working with an XML plist or a binary plist, using tools like defaults
)
Like @northtree said, the biplist
package is the right tool to read/write the binary plist file.
UPDATE:
You can also use plutil(1)
that comes with OSX to convert any plist
file back to XML format, and then processed by plistlib
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/plutil.1.html
Post a Comment for "Python Plistlib File Invaded By Cocoa Values?"