#32894: isinstance() checks with non-configured LazySettings raise an exception.
-------------------------------------+-------------------------------------
     Reporter:  simon klemenc        |                    Owner:  nobody
         Type:                       |                   Status:  closed
  Cleanup/optimization               |
    Component:  Utilities            |                  Version:  3.2
     Severity:  Normal               |               Resolution:  needsinfo
     Keywords:  lazyobject           |             Triage Stage:
  lazysettings                       |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Keryn Knight):

 Continuing to document new ways in which I come across this (always niche,
 naturally) in case there ever comes a tipping point where it's potentially
 ''worth'' investigating options further.

 Running:
 {{{
 monkeytype run -m runtests --parallel=1
 }}}
 against the Django test suite generates a lot of log noise like so:
 {{{
 Failed collecting trace
 Traceback (most recent call last):
   File "/path/to/python3.10/site-packages/monkeytype/tracing.py", line
 259, in __call__
     self.handle_call(frame)
   File "/path/to/python3.10/site-packages/monkeytype/tracing.py", line
 213, in handle_call
     func = self._get_func(frame)
   File "/path/to/python3.10/site-packages/monkeytype/tracing.py", line
 207, in _get_func
     self.cache[code] = get_func(frame)
   File "/path/to/python3.10/site-packages/monkeytype/tracing.py", line
 156, in get_func
     if not isinstance(v, type):
   File "/path/to/django/utils/functional.py", line 294, in
 __getattribute__
     value = super().__getattribute__(name)
   File "/path/to/django/utils/functional.py", line 266, in inner
     self._setup()
   File "/path/to/django/conf/__init__.py", line 72, in _setup
     raise ImproperlyConfigured(
 django.core.exceptions.ImproperlyConfigured: Requested settings, but
 settings are not configured. You must either define the environment
 variable DJANGO_SETTINGS_MODULE or call settings.configure() before
 accessing settings.
 }}}
 They all seem to be log messages which may not actually present as an
 error/problem in practice, though (that is, the test suite looks to
 continue running ... but I gave up on it as it was taking forever)

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32894#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018106e06851-b68f12e8-49b6-44b9-8a35-fa21738c17e4-000000%40eu-central-1.amazonses.com.

Reply via email to