pyinstrument
pyinstrument copied to clipboard
[bug] pyinstruments not working TypeError: 'NoneType' object is not callable
I found a bug that pyinstrument not to work at all, I think it may be related with my logger configuration, but I'm not sure. this is the error:
Traceback (most recent call last):
File "C:\Users\PabloRuiz\AppData\Local\Programs\Python\Python311\Lib\logging\__init__.py", line 845, in _removeHandlerRef
File "C:\Users\PabloRuiz\AppData\Local\Programs\Python\Python311\Lib\logging\__init__.py", line 845, in _removeHandlerRef
File "C:\Users\PabloRuiz\AppData\Local\pypoetry\Cache\virtualenvs\transformer-wi-nHELc-py3.11\Lib\site-packages\pyinstrument\stack_sampler.py", line 134, in _sample
File "C:\Users\PabloRuiz\AppData\Local\pypoetry\Cache\virtualenvs\transformer-wi-nHELc-py3.11\Lib\site-packages\pyinstrument\stack_sampler.py", line 148, in _timer
TypeError: 'NoneType' object is not callable
Sorry for the delay, but I'll need a recreation to really work on this.
Please feel free to reopen if you manage to find a recreation!
I hit this recently and I don't have a way to reproduce it, but I'll mention that it only happened when I started and stopped profiling using the Profiler() start() and stop() methods. I worked around the problem by starting profiling through running pyinstrument from the command line instead.