Opened 18 years ago

Last modified 18 years ago

#1556 closed defect

[magic-removal - r2594] Error/Typo in "django/core/management.py" causes "manage.py install app" to fail. — at Initial Version

Reported by: pawel.sawicki@… Owned by: Adrian Holovaty
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hello!

In the 2594th revision of "django/core/management.py" there's an error (I suppose) which was introduced in r2567.

$ ./manage.py install sampleapp
Traceback (most recent call last):

File "./manage.py", line 17, in ?

execute_manager(settings)

File "/usr/lib/python2.4/site-packages/django/core/management.py", line 1184, in execute_manager

execute_from_command_line(action_mapping)

File "/usr/lib/python2.4/site-packages/django/core/management.py", line 1152, in execute_from_command_line

output = action_mapping[action](mod)

File "/usr/lib/python2.4/site-packages/django/core/management.py", line 535, in install

sys.stderr.write(style.ERROR("""Error: %s couldn't be installed. Possible reasons:

TypeError: cannot concatenate 'str' and 'instance' objects

It can be fixed by:

$ svn diff django/core/management.py
Index: django/core/management.py
===================================================================
--- django/core/management.py (revision 2594)
+++ django/core/management.py (working copy)
@@ -537,7 +537,7 @@

  • At least one of the database tables already exists.
  • The SQL was invalid.

Hint: Look at the output of 'django-admin.py sqlall %s'. That's the SQL this command wasn't able to run.

-The full error: """ % (app_name, app_name)) + style.ERROR_OUTPUT(e) + '\n')
+The full error: """ % (app_name, app_name)) + str(style.ERROR_OUTPUT(e)) + '\n')

transaction.rollback_unless_managed()
sys.exit(1)

transaction.commit_unless_managed()

Though I don't know if it was the author's intention.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top