Tivix / django-common

Common things every Django project needs :-) It provides lot of helper functions, commonly used middlewares, context processors, custom email/auth backends, session helpers etc.

Home Page:http://www.tivix.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

errors 'force_unicode' and 'I/O operation on closed file'

nordbit opened this issue · comments

Trying run scaffold from docs:
python manage.py scaffold forum --model Forum char:name

py3, django 1.8.2
File "/srv/testy/lib/python3.4/site-packages/django_common/admin.py", line 12, in <module> from django.utils.encoding import force_unicode ImportError: cannot import name 'force_unicode'

py2, django 1.7.8
File "/srv/testy/lib/python3.4/site-packages/django_common/management/commands/scaffold.py", line 38, in handle scaffold.run() File "/srv/testy/lib/python3.4/site-packages/django_common/scaffold.py", line 730, in run self.create_model() File "/srv/testy/lib/python3.4/site-packages/django_common/scaffold.py", line 515, in create_model for line in self.models_file.readlines(): ValueError: I/O operation on closed file.

Made fixes in the pull request #20

I couldn't reproduce the first case with Python 3 and Django 1.8.2

PR #20 merged