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

Ints are being turned into Uids and vice versa when both are present in a plist. #9

Closed
Redoubts opened this issue Dec 4, 2015 · 2 comments

Comments

@Redoubts
Copy link

Redoubts commented Dec 4, 2015

I'm noticing confusion in how Uids are being handled, when a plist is going to contain both UIds and Ints. Example:

# int to Uid
a = {'$archiver': 'NSKeyedArchiver',
 '$objects': ['$null',
  {'$class': Uid(3), 'somekey': Uid(2), 'someOtherKey': 3},
  'object value as string',
  {'$classes': ['Archived', 'NSObject'], '$classname': 'Archived'}],
 '$top': {'root': Uid(1)},
 '$version': 100000}

biplist.readPlistFromString(biplist.writePlistToString(a))

{'$archiver': 'NSKeyedArchiver',
 '$objects': ['$null',
  {'$class': Uid(3), 

'someOtherKey': Uid(3), 

'somekey': Uid(2)},
  'object value as string',
  {'$classes': ['Archived', 'NSObject'], '$classname': 'Archived'}],
 '$top': {'root': Uid(1)},
 '$version': 100000}

# Uid to int

a = {'$archiver': 'NSKeyedArchiver',
 '$objects': ['$null',
  {'$class': 1, 'somekey': 2},
  'object value as string',
  {'$classes': ['Archived', 'NSObject'], '$classname': 'Archived'}],
 '$top': {'root': Uid(1)},
 '$version': 100000}

biplist.readPlistFromString(biplist.writePlistToString(a))

{'$archiver': 'NSKeyedArchiver',
 '$objects': ['$null',
  {'$class': 1, 'somekey': 2},
  'object value as string',
  {'$classes': ['Archived', 'NSObject'], '$classname': 'Archived'}],

 '$top': {'root': 1},

 '$version': 100000}
OS X 10.11
Python 2.7.10 (default, Oct 23 2015, 18:05:06) 
IPython 4.0.0 -- An enhanced Interactive Python.
@Redoubts
Copy link
Author

Redoubts commented Dec 4, 2015

Even more simply:

In [65]: biplist.readPlistFromString(biplist.writePlistToString(
    [1, biplist.Uid(1)]
))
Out[65]: [1, 1]

In [66]: biplist.readPlistFromString(biplist.writePlistToString(
    [biplist.Uid(1), 1]
))
Out[66]: [Uid(1), Uid(1)]

wooster added a commit that referenced this issue Jan 9, 2016
@wooster
Copy link
Owner

wooster commented Jan 9, 2016

This should be fixed in the 1.0.0 release, out today. Thanks!

@wooster wooster closed this as completed Jan 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants