def to_python(self, value):
        if not isinstance(value, basestring):
            return value

        # Tries to convert unicode objects to string, cause loads pickle from
        # unicode excepts ugly ``KeyError: '\x00'``.
        try:
            return pickle.loads(smart_str(value))
        # If pickle could not loads from string it's means that it's Python
        # string saved to PickleField.
        except __HOLE__:
            return value
        except EOFError:
            return value
dataset/ETHPy150Open svetlyak40wt/django-fields/src/django_fields/fields.py/PickleField.to_python