Message124437
| Author |
ronaldoussoren |
| Recipients |
MLModel, loewis, ronaldoussoren |
| Date |
2010年12月21日.17:00:35 |
| SpamBayes Score |
2.7766322e-07 |
| Marked as misclassified |
No |
| Message-id |
<1292950837.2.0.847454333341.issue10733@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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>). |
|
History
|
|---|
| 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 |
|