Can't Encode More Than One UID

Issue #4 resolved
Tyler Kennedy created an issue

I'm noticing some odd behaviour while trying to output some KeyedArchiver bplists.

Trying to encode something similar to:

    {'$archiver': 'NSKeyedArchiver',
     '$objects': ['$null',
                  {'$class': Uid(2),
                   'NSColorSpace': 3,
                   'NSWhite': '0 0.85000002\x00'},
                  {'$classes': ['NSColor', 'NSObject'], '$classname': 'NSColor'}],
     '$top': {'root': Uid(1)},
     '$version': 100000}

Reading this back gives:

{'$archiver': 'NSKeyedArchiver',
 '$objects': ['$null',
  {'$class': 2,
   'NSColorSpace': 2,
   'NSRGB': '0.10897059 0.10897059 0.10897244\x00'},
  {'$classes': ['NSColor', 'NSObject'], '$classname': 'NSColor'}],
 '$top': {'root': Uid(1)},
 '$version': 100000}

or sometimes,

{'$archiver': 'NSKeyedArchiver',
 '$objects': ['$null',
  {'$class': Uid(2),
   'NSColorSpace': 2,
   'NSRGB': '0.10897059 0.10897059 0.10897244\x00'},
  {'$classes': ['NSColor', 'NSObject'], '$classname': 'NSColor'}],
 '$top': {'root': 1},
 '$version': 100000}

Only one UID seems to be en/decoded, depending on the order of the dict.

Comments (3)

  1. Andrew Wooster repo owner

    Which version/platform of Python are you using? What are the results of python setup.py test ? Do you have a full example in python of the above?

    There is a test case that tests multiple Uids, and I've tried the above without success.

  2. Log in to comment