Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python plistlib file invaded by cocoa values?

Tags:

python

plist

I'm using plistlib to create and update a simple plist file in OS X. A tester in Norway is getting an error from plistlib:

File "../axeomatic2/normal/build/pyi.darwin/aomDSP/out03-PYZ.pyz/plistlib", line 406, in parse
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 8

Looking at the plist file that was generated on his system, I see fields like this interspersed with the expected entries:

NSTableView Sort Ordering       Array
...
NSTableView Hidden Columns      Array
...
NSTableView Columns             Array
...
NSNavLastRootDirectory          Array

If I give him a plist from my system it works fine, but any time the program decides it needs to create one from scratch it gets an error.

I thought perhaps it was an encoding problem, but we're both on OS X 10.7 and both using the OS X version of UTF-8.

Any ideas as to what might be happening, or how I might troubleshoot this remotely?

like image 497
LMO Avatar asked Mar 11 '26 01:03

LMO


2 Answers

I had the similar problem before, after I try biplist, it's solved.

like image 136
northtree Avatar answered Mar 12 '26 16:03

northtree


Binary plist support has been added to plistlib since python 3.4. https://docs.python.org/3.4/library/plistlib.html

like image 36
hajimuz Avatar answered Mar 12 '26 16:03

hajimuz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!