nose-devs/nose — Issue #391: Work around hotshot IndexError: pop from empty list in python < 2.7
Author: jpellerin
Created: 2011-12-14 16:09:44+00:00
State: open

What steps will reproduce the problem?
1. run --with-profile using a version of Python < 2.7
2. wait until stats are processed

What is the expected output? What do you see instead?

It should process the stats but instead I get this Traceback:

Traceback (most recent call last):
File "./manage.py", line 64, in
execute_manager(settings)
File "/Users/kumar/dev/zamboni/vendor/src/django/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/Users/kumar/dev/zamboni/vendor/src/django/django/core/management/__init__.py", line 379, in execute
...
self.config.plugins.report(self.stream)
File "/Users/kumar/dev/zamboni/vendor/lib/python/nose/plugins/manager.py", line 82, in __call__
return self.call(*arg, **kw)
File "/Users/kumar/dev/zamboni/vendor/lib/python/nose/plugins/manager.py", line 150, in simple
result = meth(*arg, **kw)
File "/Users/kumar/dev/zamboni/vendor/lib/python/nose/plugins/prof.py", line 102, in report
prof_stats = stats.load(self.pfile)
File "/usr/local/Cellar/python2.6/2.6.5/lib/python2.6/hotshot/stats.py", line 12, in load
return StatsLoader(filename).load()
File "/usr/local/Cellar/python2.6/2.6.5/lib/python2.6/hotshot/stats.py", line 29, in load
for event in log:
File "/usr/local/Cellar/python2.6/2.6.5/lib/python2.6/hotshot/log.py", line 109, in next
return what, self._pop(), tdelta
IndexError: pop from empty list

Note that this is a Python bug that is **fixed** in Python 2.7, see http://bugs.python.org/issue1019882

The bug suggests working around the issue by calling .run() instead of .start() and .stop() so perhaps Nose can do that? Not sure if that's feasible.

Please use labels and text to provide additional information.

In this case Nose was executed as manage.py test using DjangoNose http://github.com/jbalogh/django-nose

Google Code Info:
Issue #: 371
Author: kumar.mcmillan
Created On: 2010-10-16T21:34:55.000Z
Closed On: