Message124437
I agree with Martin that this is a tricky one.
The file is problematic because it is invalid XML[1], however Apple's tools are perfectly happy to proces the file and as Mitchell notes plistlib exists to interoperate with Apple's plist files.
I'm therefore reopening the issue, but with a low priority. It is unlikely that I'll work on this in the near future though.
Replacing all control characters by entities before trying to parse the Plist XML would likely be the best way forward. A patch (including testcases) would definitely be appreciated.
BTW. I've checked that Apple's Cocoa libraries will read the file, this is not just a bug in the xml1 output formatter of plutil.
Using PyObjC:
>>> from Foundation import NSDictionary
>>> d = NSDictionary.dictionaryWithContentsOfFile_('com.apple.Terminal.plist')
[1] It is invalid XML because it contains control characters which are invalid according to the XML specification (<http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char>). |
|
Date |
User |
Action |
Args |
2010-12-21 17:00:37 | ronaldoussoren | set | recipients:
+ ronaldoussoren, loewis, MLModel |
2010-12-21 17:00:37 | ronaldoussoren | set | messageid: <1292950837.2.0.847454333341.issue10733@psf.upfronthosting.co.za> |
2010-12-21 17:00:35 | ronaldoussoren | link | issue10733 messages |
2010-12-21 17:00:35 | ronaldoussoren | create | |
|