ImportError: No module pstats in revno 5035

5 views
Skip to first unread message

vitalije

unread,
Feb 28, 2012, 4:19:47 AM2/28/12
to leo-e...@googlegroups.com
On one of my machines [Ubuntu 11.04] was not installed python-profiler package. When I updated Leo's installation to revision 5035, I got trace-back in terminal complaining that pstats module is missing and Leo exited. After installing python-profiler package everything is working fine. I suppose that this is not really required but was left after some testing phase.

Vitalije

Edward K. Ream

unread,
Feb 28, 2012, 5:52:28 AM2/28/12
to leo-e...@googlegroups.com

Thanks for this report. The fix, or rather workaround, is on the
trunk at rev 5036.

Apparently, this is a distribution bug on Ubuntu:
https://bugs.launchpad.net/ubuntu/+source/python-defaults/+bug/123755
pstats is part of the standard distribution, so importing pstats
should never fail.

The workaround was simply to move imports of pstats away from the
module level. Leo now issues an informative message about this bug if
the import fails. This will happen only if the user is actually
running profiling code, which would happen rarely.

All usual tests pass, but I haven't actually tested the failure condition.

Edward

Reply all
Reply to author
Forward
0 new messages