Closed dayglojesus closed 10 years ago
As per the Twitters, this...
require "rexml/document"
file = '/System/Library/Security/authorization.plist'
File.open(file) { |fd| doc = REXML::Document.new(fd) }
Parses correctly.
The file referenced exists on all Macs. If you need me to send it you, I'll need your email address.
Ok, found the problem. It was caused by a nil return of REXML for an empty tag (like <key></key>
) instead of an empty string. Per se this is correct behavior, but XML plists interpret this as an empty string.
Confirmed. Thanks for the fix, Christian!
When CFPropertyList falls back to using REXML for parsing and it encounters a nil key, it raises. This is east to reproduce using the file referenced below.
Results: