django-uuidfield icon indicating copy to clipboard operation
django-uuidfield copied to clipboard

unicode() method does not work in Python 3.3

Open linkmic opened this issue 10 years ago • 4 comments

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

linkmic avatar Dec 17 '14 12:12 linkmic

I just noticed this commit/merge which I think would fix this problem. https://github.com/dcramer/django-uuidfield/commit/ec4f97fe6e59a6a67fa83db44dbd4250255651b6

Is a new release scheduled?

linkmic avatar Dec 17 '14 12:12 linkmic

actually this happens. we needed to add a patch to solve, because we are using in production. Is there any date for new release?

edersonbadeca avatar Jan 29 '15 12:01 edersonbadeca

A release with python 3 support would indeed be nice :)

xavfernandez avatar Mar 23 '15 16:03 xavfernandez

just ran into this issue too, any news?

erichaus avatar Mar 29 '15 05:03 erichaus