Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#29906 closed Bug (invalid)

`isinstance(django_settings, type)` triggers ImproperlyConfigured, although settings are not really accessed — at Version 2

Reported by: Daniel Hahler Owned by: nobody
Component: Core (Other) Version: 2.1
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 (last modified by Tim Graham)

Checking if django.conf.settings is a class should not trigger an exception, but the following code triggers ImproperlyConfigured already:

from django.conf import settings as django_settings
isinstance(django_settings, type)

(via https://github.com/pytest-dev/pytest/issues/4266)

Change History (2)

comment:1 by Simon Charette, 6 years ago

Resolution: invalid
Status: newclosed

As mentioned on the linked PR this has little to do with the isinstance check; accessing django.conf.settings attributes (in this case __class__ through isinstance) is prohibited until settings are configured.

comment:2 by Tim Graham, 6 years ago

Component: UncategorizedCore (Other)
Description: modified (diff)
Type: UncategorizedBug
Note: See TracTickets for help on using tickets.
Back to Top