Skip to content

Profiler raises ValueError in Python 3.12 #1875

Open
@anorthall

Description

@anorthall

Enabling the profiling panel in Python 3.12 and Django 5.0.1 causes the following exception:

   File "/usr/local/lib/python3.12/site-packages/debug_toolbar/panels/profiling.py", line 144, in process_request
     return self.profiler.runcall(super().process_request, request)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/usr/local/lib/python3.12/cProfile.py", line 109, in runcall
     self.enable()
 ValueError: Another profiling tool is already active

This is due to a change in Python 3.12: python/cpython#110770

There is also some relevant discussion of the same issue over on the django-silk repo which may be helpful in finding a way forward: jazzband/django-silk#682

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions