Skip to content

unicode() method does not work in Python 3.3 #51

@linkmic

Description

@linkmic

Hi,

I recently submitted a fix for django-haystack so that UUID pk fields would work properly.
https://github.com/toastdriven/django-haystack/pull/1115

However, I notice that the Haystack tests for Python 3.3 fail because of:
(From https://travis-ci.org/toastdriven/django-haystack/jobs/44221681)

...
File "/home/travis/build/toastdriven/django-haystack/django_uuidfield-0.5.0-py3.3.egg/uuidfield/fields.py", line 26, in unicode
return unicode(str(self))
nose.proxy.NameError: Problem installing fixture '/home/travis/build/toastdriven/django-haystack/test_haystack/core/fixtures/initial_data.json': global name 'unicode' is not defined
...

In the unicode method for the field, a simple check of whether this is Python 2 or 3 might be the way to go.

Thanks,
/mike

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions