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

refresh from jsonpickle master #1

Merged
merged 8 commits into from Aug 23, 2014

Conversation

marcintustin
Copy link
Owner

No description provided.

Add further pickle protocol 2 support

Signed-off-by: David Aguilar <davvid@gmail.com>
We might want to consider eliminating jsonpickle._samples (again)
if we can move everything inline instead.

Signed-off-by: David Aguilar <davvid@gmail.com>
An interesting edge case in Python is:

    class ObjectWithIterableSlots(object):
         __slots__ = iter('a')
         def __init__(self, a):
             self.a = a

    print(jsonpickle.encode(ObjectWithIterableSlots('a')))

The reason this is tricky is because __slots__ is an iterator
object and is consumed the first time it is used.  The initial
consumer may be python itself when building the class object.

There's no way to reset an iterator in Python but we can at
least use dir() to find attribute names when the __slots__
iterator has already been consumed.

Fallback to using dir() if we don't find any attributes when
iterating over __slots__.

Closes #67

Reported-by: Jason R. Coombs <jaraco@jaraco.com>
Helped-by: Marcin Tustin <marcin.tustin@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
u'' is not portable.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Python 3.4's object.__new__() takes a single parameter only.

Signed-off-by: David Aguilar <davvid@gmail.com>
Closes #66

Reported-by: Jason R. Coombs <jaraco@jaraco.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Teach jsonpickle to warn about objects that it cannot directly
serialize, e.g. file descriptors.

Add tests to verify that we properly serialize these objects as None.

Closes #3

Signed-off-by: David Aguilar <davvid@gmail.com>
marcintustin added a commit that referenced this pull request Aug 23, 2014
refresh from jsonpickle master
@marcintustin marcintustin merged commit 0a85d6b into marcintustin:master Aug 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants