Code

Opened 7 years ago

Closed 7 years ago

#4993 closed (duplicate)

Application cannot be called collections, but manage.py doesn't disallow the user to create it

Reported by: oliver@… Owned by: adrian
Component: Core (Other) Version: master
Severity: Keywords: collections model conflict
Cc: oliver@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

If one creates an application named 'collections', and subsequently attempts to run syncdb against it, an ImportError is raised as it 'overrides' the collections module, from which deque is tried to be imported by threading:

Traceback (most recent call last):
  File "manage.py", line 11, in ?
    execute_manager(settings)
  File "/opt/local/lib/python2.4/site-packages/django/core/management.py", line 1678, in execute_manager
    execute_from_command_line(action_mapping, argv)
  File "/opt/local/lib/python2.4/site-packages/django/core/management.py", line 1577, in execute_from_command_line
    action_mapping[action](int(options.verbosity), options.interactive)
  File "/opt/local/lib/python2.4/site-packages/django/core/management.py", line 468, in syncdb
    from django.db import connection, transaction, models, get_creation_module
  File "/opt/local/lib/python2.4/site-packages/django/db/__init__.py", line 11, in ?
    backend = __import__('django.db.backends.%s.base' % settings.DATABASE_ENGINE, {}, {}, [''])
  File "/opt/local/lib/python2.4/site-packages/django/db/backends/mysql/base.py", line 61, in ?
    from django.utils._threading_local import local
  File "/opt/local/lib/python2.4/site-packages/django/utils/_threading_local.py", line 240, in ?
    from dummy_threading import currentThread, enumerate, RLock
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/dummy_threading.py", line 50, in ?
    import threading
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/threading.py", line 13, in ?
    from collections import deque
ImportError: cannot import name deque

I know it's no biggie; just thought I might make people aware of it – not sure even if this even warrants a ticket, though!

Attachments (0)

Change History (2)

comment:1 Changed 7 years ago by anonymous

  • Cc oliver@… added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 7 years ago by Simon G. <dev@…>

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #4850

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.