Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix bug, TypeError: unicode argument expected, got 'str' on core management validation #983

Closed
wants to merge 3 commits into from

3 participants

@avelino

Error:

2013-04-03 02:37:08 [71497] [INFO] Starting gunicorn 0.17.2
2013-04-03 02:37:08 [71497] [INFO] Listening at: http://127.0.0.1:8000 (71497)
2013-04-03 02:37:08 [71497] [INFO] Using worker: sync
2013-04-03 02:37:08 [71500] [INFO] Booting worker with pid: 71500
2013-04-03 02:37:10 [71500] [ERROR] Exception in worker process:
Traceback (most recent call last):
  File "/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/gunicorn/arbiter.py", line 485, in spawn_worker
    worker.init_process()
  File "/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/gunicorn/workers/base.py", line 100, in init_process
    self.wsgi = self.app.wsgi()
  File "/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/gunicorn/app/base.py", line 103, in wsgi
    self.callable = self.load()
  File "/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/gunicorn/app/djangoapp.py", line 101, in load
    return mod.make_wsgi_application()
  File "/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/gunicorn/app/django_wsgi.py", line 36, in make_wsgi_application
    if get_validation_errors(s):
  File "/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/django/core/management/validation.py", line 150, in get_validation_errors
    e.add(opts, "'%s' has a relation with model %s, which has either not been installed or is abstract." % (f.name, f.rel.to))
  File "/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/django/core/management/validation.py", line 19, in add
    self.outfile.write(self.style.ERROR(force_str(u"%s: %s\n" % (context, error))))
TypeError: unicode argument expected, got 'str'
Traceback (most recent call last):
  File "/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/gunicorn/arbiter.py", line 485, in spawn_worker
    worker.init_process()
  File "/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/gunicorn/workers/base.py", line 100, in init_process
    self.wsgi = self.app.wsgi()
  File "/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/gunicorn/app/base.py", line 103, in wsgi
    self.callable = self.load()
  File "/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/gunicorn/app/djangoapp.py", line 101, in load
    return mod.make_wsgi_application()
  File "/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/gunicorn/app/django_wsgi.py", line 36, in make_wsgi_application
    if get_validation_errors(s):
  File "/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/django/core/management/validation.py", line 150, in get_validation_errors
    e.add(opts, "'%s' has a relation with model %s, which has either not been installed or is abstract." % (f.name, f.rel.to))
  File "/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/django/core/management/validation.py", line 19, in add
    self.outfile.write(self.style.ERROR(force_str(u"%s: %s\n" % (context, error))))
TypeError: unicode argument expected, got 'str'
2013-04-03 02:37:10 [71500] [INFO] Worker exiting (pid: 71500)
2013-04-03 02:37:10 [71497] [INFO] Shutting down: Master
2013-04-03 02:37:10 [71497] [INFO] Reason: Worker failed to boot.
avelino added some commits
@avelino avelino Fix bug, TypeError: unicode argument expected, got 'str' on core mana…
…gement validation

Traceback (most recent call last):
  File
"/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/gunicorn/arbiter.py",
line 485, in spawn_worker
    worker.init_process()
  File
"/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/gunicorn/workers/base.py",
line 100, in init_process
    self.wsgi = self.app.wsgi()
  File
"/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/gunicorn/app/base.py",
line 103, in wsgi
    self.callable = self.load()
  File
"/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/gunicorn/app/djangoapp.py",
line 101, in load
    return mod.make_wsgi_application()
  File
"/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/gunicorn/app/django_wsgi.py",
line 36, in make_wsgi_application
    if get_validation_errors(s):
  File
"/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/django/core/management/validation.py",
line 150, in get_validation_errors
    e.add(opts, "'%s' has a relation with model %s, which has either not
been installed or is abstract." % (f.name, f.rel.to))
  File
"/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/django/core/management/validation.py",
line 19, in add
    self.outfile.write(self.style.ERROR(force_str(u"%s: %s\n" %
(context, error))))
TypeError: unicode argument expected, got 'str'
ca3c7cf
@avelino avelino Add myself in AUTHORS 53c5563
@avelino avelino Remove import not used, force_str on core management validation 8317efb
@jezdez jezdez closed this
@apollo13
Owner

Closed as per the ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 3, 2013
  1. @avelino

    Fix bug, TypeError: unicode argument expected, got 'str' on core mana…

    avelino authored
    …gement validation
    
    Traceback (most recent call last):
      File
    "/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/gunicorn/arbiter.py",
    line 485, in spawn_worker
        worker.init_process()
      File
    "/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/gunicorn/workers/base.py",
    line 100, in init_process
        self.wsgi = self.app.wsgi()
      File
    "/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/gunicorn/app/base.py",
    line 103, in wsgi
        self.callable = self.load()
      File
    "/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/gunicorn/app/djangoapp.py",
    line 101, in load
        return mod.make_wsgi_application()
      File
    "/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/gunicorn/app/django_wsgi.py",
    line 36, in make_wsgi_application
        if get_validation_errors(s):
      File
    "/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/django/core/management/validation.py",
    line 150, in get_validation_errors
        e.add(opts, "'%s' has a relation with model %s, which has either not
    been installed or is abstract." % (f.name, f.rel.to))
      File
    "/Users/avelino/.virtualenvs/yacows.virgula/lib/python2.7/site-packages/django/core/management/validation.py",
    line 19, in add
        self.outfile.write(self.style.ERROR(force_str(u"%s: %s\n" %
    (context, error))))
    TypeError: unicode argument expected, got 'str'
  2. @avelino

    Add myself in AUTHORS

    avelino authored
  3. @avelino
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +1 −0  AUTHORS
  2. +1 −2  django/core/management/validation.py
View
1  AUTHORS
@@ -609,6 +609,7 @@ answer newbie questions, and generally made Django that much better:
Gasper Zejn <zejn@kiberpipa.org>
Jarek Zgoda <jarek.zgoda@gmail.com>
Cheng Zhang
+ Thiago Avelino <thiagoavelinoster@gmail.com>
A big THANK YOU goes to:
View
3  django/core/management/validation.py
@@ -3,7 +3,6 @@
from django.conf import settings
from django.core.management.color import color_style
-from django.utils.encoding import force_str
from django.utils.itercompat import is_iterable
from django.utils import six
@@ -16,7 +15,7 @@ def __init__(self, outfile=sys.stdout):
def add(self, context, error):
self.errors.append((context, error))
- self.outfile.write(self.style.ERROR(force_str("%s: %s\n" % (context, error))))
+ self.outfile.write(self.style.ERROR(u"%s: %s\n" % (context, error)))
def get_validation_errors(outfile, app=None):
Something went wrong with that request. Please try again.