Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-26707: enable plistlib to read UID keys #12153

Merged
merged 3 commits into from May 15, 2019
Merged

bpo-26707: enable plistlib to read UID keys #12153

merged 3 commits into from May 15, 2019

Conversation

bigfootjon
Copy link
Contributor

@bigfootjon bigfootjon commented Mar 4, 2019

Plistlib currently throws an exception when asked to decode a valid
.plist file that was generated by Apple's NSKeyedArchiver. Specifically,
this is caused by a byte 0x80 (signifying a UID) not being understood.

This fixes the problem by enabling the binary plist reader and writer
to read and write plistlib.UID objects.

https://bugs.python.org/issue26707

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Add tests for the following UIDs (this will expose a bug in your code):

  • from 2**8 to 2**16-1
  • from 2**16 to 2**32-1
  • from 2**32 to 2**63-1
  • from 2**63 to 2**64-1
  • larger than 2**64-1
  • 0
  • negative

Add tests for the data attribute of UID, for equality/inequality tests and hashing, for repr(uid), for operator.index(uid), and for pickling/unpickling and copying of UIDs.

Document the UID class. Add the versionchanged directives in the module documentation and a What's New entry.

Add your name into Misc/ACKS.

@bedevere-bot
Copy link

bedevere-bot commented Mar 4, 2019

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@serhiy-storchaka serhiy-storchaka added the type-feature A feature request or enhancement label Mar 4, 2019
Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Please add also a test for the data attribute.

Lib/plistlib.py Show resolved Hide resolved
Lib/plistlib.py Outdated Show resolved Hide resolved
Lib/test/test_plistlib.py Outdated Show resolved Hide resolved
@bigfootjon
Copy link
Contributor Author

bigfootjon commented Mar 4, 2019

I have made the requested changes; please review again

@bedevere-bot
Copy link

bedevere-bot commented Mar 4, 2019

Thanks for making the requested changes!

@serhiy-storchaka: please review the changes made to this pull request.

@bigfootjon
Copy link
Contributor Author

bigfootjon commented Mar 14, 2019

Bump

1 similar comment
@bigfootjon
Copy link
Contributor Author

bigfootjon commented Apr 2, 2019

Bump

bigfootjon and others added 3 commits Apr 20, 2019
Plistlib currently throws an exception when asked to decode a valid
.plist file that was generated by Apple's NSKeyedArchiver. Specifically,
this is caused by a byte 0x80 (signifying a UID) not being understood.

This fixes the problem by enabling the binary plist reader and writer
to read and write plistlib.UID objects.
Also, update the documentation to reflect the new UID class
@brettcannon
Copy link
Member

brettcannon commented Apr 25, 2019

@ronaldoussoren @ned-deily either of you want to take a look, or should @serhiy-storchaka go ahead and merge?

@ned-deily
Copy link
Member

ned-deily commented Apr 25, 2019

@ronaldoussoren and @serhiy-storchaka are the current plistlib experts. In the bpo issue, @ronaldoussoren expressed doubts about adding this support. @ronaldoussoren ?

@bigfootjon
Copy link
Contributor Author

bigfootjon commented May 1, 2019

@serhiy-storchaka
Copy link
Member

serhiy-storchaka commented May 5, 2019

The PR LGTM, and I understand why this feature is needed. But I am not even a macOS user.

@brettcannon
Copy link
Member

brettcannon commented May 6, 2019

I think if @ronaldoussoren doesn't respond in some capacity in the next week then we should merge based on the review from @serhiy-storchaka .

@bigfootjon
Copy link
Contributor Author

bigfootjon commented May 15, 2019

@serhiy-storchaka serhiy-storchaka merged commit c981ad1 into python:master May 15, 2019
@serhiy-storchaka
Copy link
Member

serhiy-storchaka commented May 15, 2019

Thank you for your contribution @bigfootjon!

@bigfootjon bigfootjon deleted the fix-issue-26707 branch May 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants