Closed jchien14 closed 7 years ago
Thanks. Fixed in 0.2.2.
Thanks for the quick fix!
I notice when using 0.2.2, that the above plist isn't handled as I would expect it to. After I call plist.as_dictionary().get('Test')
, the resulting Plist
returns None
when I call as_integer
(also as_boolean
) but returns the string "1"
when I call as_string
. Should as_integer
never be called for binary plists?
It appears converting it to XML does also convert it as a string, so I guess this is correct -- just a bit unintuitive given the API options.
Looking at the defaults man page (https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/defaults.1.html) it seems like it defaults to writing a string unless you specify otherwise.
On 5 May 2017, at 20:06, jchien14 notifications@github.com wrote:
Thanks for the quick fix!
I notice when using 0.2.2, that the above plist isn't handled as I would expect it to. After I call plist.as_dictionary().get('Test'), the resulting Plist returns None when I call as_integer (also as_boolean) but returns the string "1" when I call as_string. Should as_integer never be called for binary plists?
It appears converting it to XML does also convert it as a string, so I guess this is correct -- just a bit unintuitive given the API options.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.
as_X could be named better though.
Haven't looked in detail, but this failed on both 0.2.1 and 0.1.3, giving Err(InvalidData).
It worked when I converted it to XML, so I'm guessing it's an issue with the binary parser.