Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(263387)

#14455: plistlib unable to read json and binary plist files

Can't Edit
Can't Publish+Mail
Start Review
Created:
7 years, 4 months ago by python
Modified:
5 years, 7 months ago
Reviewers:
storchaka, ronaldoussoren
CC:
Ronald Oussoren, ned.deily, eric.araujo, r.david.murray, jrjsmrtn_gmail.com, devnull_psf.upfronthosting.co.za, storchaka, d9pouces, markgrandi
Visibility:
Public.

Patch Set 1 #

Patch Set 2 #

Patch Set 3 #

Patch Set 4 #

Patch Set 5 #

Patch Set 6 #

Total comments: 34

Patch Set 7 #

Patch Set 8 #

Patch Set 9 #

Total comments: 116

Patch Set 10 #

Total comments: 20

Patch Set 11 #

Patch Set 12 #

Patch Set 13 #

Total comments: 6

Patch Set 14 #

Patch Set 15 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Doc/library/plistlib.rst View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -7 lines 0 comments Download
Lib/plistlib.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +6 lines, -5 lines 0 comments Download
Lib/test/test_plistlib.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 9
storchaka_gmail.com
This is only a preliminary review. The patch contains a lot of too long lines. ...
6 years, 1 month ago #1
Ronald Oussoren
I'm working on a patch that addresses the review. I'm not sure about the dump/load ...
6 years, 1 month ago #2
storchaka_gmail.com
http://bugs.python.org/review/14455/diff/8618/Doc/library/plistlib.rst File Doc/library/plistlib.rst (right): http://bugs.python.org/review/14455/diff/8618/Doc/library/plistlib.rst#newcode86 Doc/library/plistlib.rst:86: file object. *fp* http://bugs.python.org/review/14455/diff/8618/Doc/library/plistlib.rst#newcode136 Doc/library/plistlib.rst:136: Added the *fmt*, *use_builtin_types* ...
5 years, 9 months ago #3
Ronald Oussoren
I have not yet uploaded a new version of the patch because I didn't run ...
5 years, 9 months ago #4
storchaka_gmail.com
http://bugs.python.org/review/14455/diff/8618/Doc/library/plistlib.rst File Doc/library/plistlib.rst (right): http://bugs.python.org/review/14455/diff/8618/Doc/library/plistlib.rst#newcode86 Doc/library/plistlib.rst:86: file object. On 2013/11/19 22:24:25, Ronald Oussoren wrote: > ...
5 years, 9 months ago #5
storchaka_gmail.com
http://bugs.python.org/review/14455/diff/10021/Lib/plistlib.py File Lib/plistlib.py (right): http://bugs.python.org/review/14455/diff/10021/Lib/plistlib.py#newcode50 Lib/plistlib.py:50: "Plist", "Data", "Dict", "FMT_XML", "FMT_BINARY", "load", "dump", "loads", "dumps" ...
5 years, 9 months ago #6
Ronald Oussoren
http://bugs.python.org/review/14455/diff/10021/Lib/plistlib.py File Lib/plistlib.py (right): http://bugs.python.org/review/14455/diff/10021/Lib/plistlib.py#newcode50 Lib/plistlib.py:50: "Plist", "Data", "Dict", "FMT_XML", "FMT_BINARY", "load", "dump", "loads", "dumps" ...
5 years, 9 months ago #7
storchaka_gmail.com
http://bugs.python.org/review/14455/diff/10372/Lib/plistlib.py File Lib/plistlib.py (right): http://bugs.python.org/review/14455/diff/10372/Lib/plistlib.py#newcode888 Lib/plistlib.py:888: self._fp.write(struct.pack('>BQ', 0x13, value)) 64-bit integers are signed. Apple's libraries ...
5 years, 8 months ago #8
Ronald Oussoren
5 years, 8 months ago #9
http://bugs.python.org/review/14455/diff/10372/Lib/plistlib.py
File Lib/plistlib.py (right):

http://bugs.python.org/review/14455/diff/10372/Lib/plistlib.py#newcode888
Lib/plistlib.py:888: self._fp.write(struct.pack('>BQ', 0x13, value))
On 2013/12/19 11:51:19, storchaka wrote:
> 64-bit integers are signed. Apple's libraries able to read 64-bit unsigned
> integers when they are serialized as 128-bit.

But Apple's libraries won't serialize 64-bit unsigned integers as 128-bit. That
is when you write 2**63+1 to a binary plist  and read it back (all using Apple's
APIs)  the result is a negative integer. 

This library's primary purpose is interaction with Apple's data, which is why
I'd prefer to match the behavior of the Foundation framework on OSX instead of
trying to coax that framework into doing something better.

And I haven't been able to find a way to create a plist with integers larger
than 2**63 using Apple's APIs yet.

BTW. I'll post a script (using PyObjC) that demonstrates the behavior for
2**63+1. That script should behave the same as the corresponding Objective-C
code.

http://bugs.python.org/review/14455/diff/10372/Lib/test/test_plistlib.py
File Lib/test/test_plistlib.py (right):

http://bugs.python.org/review/14455/diff/10372/Lib/test/test_plistlib.py#newc...
Lib/test/test_plistlib.py:157: data = plistlib.dumps(pl,
fmt=plistlib.FMT_BINARY)
On 2013/12/19 11:51:19, storchaka wrote:
> We can test this for all formats.

Agreed. Especially because the OverflowError exception should also be raised for
the XML format (just tested the behavior of Apple's code for this)

http://bugs.python.org/review/14455/diff/10372/Lib/test/test_plistlib.py#newc...
Lib/test/test_plistlib.py:197: if data != TESTDATA[fmt]:
On 2013/12/19 11:51:19, storchaka wrote:
> Debugging remnants?

Yes :-(
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+