scholrly / neo4django

Drop-in Neo4j/Django integration.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Django complains about __unicode__ = new_method_proxy(unicode) in Python 3.4

mattiasostmar opened this issue · comments

I've started porting neo4django to Python 3.4, but I get stuck at line 251 in functional.py in Django/utils (Note: Django itself, I run Django 1.7 RC 2). Not sure wether the problem can be fixed in neo4django or is located in Django itself. I'm on Mac OS X Mavericks.

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-8-1975d0806423> in <module>()
----> 1 from neo4django.db import models

/Users/mos/.virtualenvs/py3/lib/python3.4/site-packages/neo4django/db/__init__.py in <module>()
  1 __all__ = ['connection', 'connections','DEFAULT_DB_ALIAS']
  2 
----> 3 from django.conf import settings as _settings
  4 from django.core import exceptions
  5 from neo4jrestclient import client as _client

/Users/mos/.virtualenvs/py3/lib/python3.4/site-packages/django/conf/__init__.py in <module>()
 13 
 14 from django.conf import global_settings
---> 15 from django.utils.functional import LazyObject, empty
 16 from django.utils import importlib
 17 

/Users/mos/.virtualenvs/py3/lib/python3.4/site-packages/django/utils/functional.py in <module>()
226 
227 
--> 228 class SimpleLazyObject(LazyObject):
229     """
230     A lazy object initialised from any function.

/Users/mos/.virtualenvs/py3/lib/python3.4/site-packages/django/utils/functional.py in SimpleLazyObject()
249 
250     __str__ = new_method_proxy(str)
--> 251     __unicode__ = new_method_proxy(unicode)
252 
253     def __deepcopy__(self, memo):

NameError: name 'unicode' is not defined

@mattiasostmar the fact that it came from importing settings makes me think the problem is with Django. I believe in Py3k there isn't a unicode function, since it's subsumed by str?

Closing this in favor of #260.