a blog by Marius Gedminas

Posts tagged Python

Stuff I've been doing recently

objgraph got shiny documentation built with Sphinx. Python 3.x support, thanks to Stefano Rivera. Python 2.4 and 2.5 support, thanks to Daniel Blackburn. assorted smaller improvements. zodbbrowser got support for all ZODB databases, not just those with a Zope 3/Bluebream-style root folder/local site. the ability to cope better with broken objects (due to the way ZODB works, not having some of your modules on the Python pack can break unpickling; zodbbrowser now handles this kind of situation better).

Profiling with Dozer

Dozer is mostly known for its memory profiling capabilities, but the as-yet unreleased version has more. I've talked about log capturing, now it's time for Profiling This WSGI middleware profiles every request with the cProfile module. To see the profiles, visit a hidden URL /_profiler/showall: What you see here is heavily tweaked in my fork branch of Dozer; upstream version had no Cost column and didn't vary the background of Time by age (that last bit helps me see clumps of requests).

ImportError: No module named _md5

If you're using virtualenv, and after a system upgrade you get errors like ... File "...", line ... from hashlib import md5 File "/usr/lib/python2.6/hashlib.py", line 63, in __get_builtin_constructor import _md5 ImportError: No module named _md5 this means that the copy of the python executable in your virtualenv/bin directory is outdated and you should update it: $ cp /usr/bin/python2.6 /path/to/venv/bin/python or, better yet, recreate the virtualenv.