Loading app fails with Python 3.3 resulting in: TypeError: '_NamespacePath' object does not support indexing
|Reported by:||elbaschid||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I have just created a new Django project using the freshly released Django 1.7a1 with Python 3.3. I've create the project using django-admin.
manage.py project/ photo/ models.py settings.py urls.py wsgi.py
I have created a custom app 'photo' that contains a single model 'Photo' and
nothing else. I've added the app in the settings using the old-style dotted
notation without an 'AppConfig'.
The INSTALLED_APPS in 'settings.py':
INSTALLED_APPS = [ ... 'project.photo', ]
The app 'project.photo' is loaded and './manage.py shell' or './manage.py runserver' are running fine.
When I am running './manage.py migrage' or even just './manage.py shell', I am
getting the following error:
Traceback (most recent call last): File "./manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/home/elbaschid/.virtualenvs/disperser/lib/python3.3/site-packages/django/core/management/__init__.py", line 427, in execute_from_command_line utility.execute() File "/home/elbaschid/.virtualenvs/disperser/lib/python3.3/site-packages/django/core/management/__init__.py", line 391, in execute django.setup() File "/home/elbaschid/.virtualenvs/disperser/lib/python3.3/site-packages/django/__init__.py", line 21, in setup apps.populate(settings.INSTALLED_APPS) File "/home/elbaschid/.virtualenvs/disperser/lib/python3.3/site-packages/django/apps/registry.py", line 84, in populate app_config = AppConfig.create(entry) File "/home/elbaschid/.virtualenvs/disperser/lib/python3.3/site-packages/django/apps/base.py", line 111, in create return cls(entry, module) File "/home/elbaschid/.virtualenvs/disperser/lib/python3.3/site-packages/django/apps/base.py", line 43, in __init__ self.path = upath(app_module.__path__) TypeError: '_NamespacePath' object does not support indexing
A similar problem has been reported on the pytest project with a fix that has
As the commit message there states "Starting with Python 3.3, NamespacePath
passed to importlib hooks seem to have lost the ability to be accessed by
index.". This seems to be the same issue here.
Change History (8)
comment:1 Changed 21 months ago by bmispelon
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:2 follow-up: ↓ 6 Changed 21 months ago by bmispelon
- Severity changed from Normal to Release blocker
- Triage Stage changed from Unreviewed to Accepted
comment:6 in reply to: ↑ 2 Changed 21 months ago by carljm
- Resolution set to duplicate
- Status changed from new to closed