a blog by Marius Gedminas

Posts tagged Python

Local changes to buildout.cfg

Most of Python packages in the Zope world use Buildout: svn co svn+ssh://svn.zope.org/repos/main/plone.z3cform/trunk plone.z3cform cd plone.z3cform python2.4 bootstrap.py bin/buildout bin/test -pvc Now suppose you want to change the buildout environment somehow, e.g. use the current development version of zope.testing instead of whatever is specified in buildout.cfg. Don't edit the existing buildout.cfg (you might accidentally commit your local debug changes), instead create a new cfg file, e.g. test.cfg: [buildout] extends = buildout.

Python-related updates for the last couple of months

Went to EuroPython, met new people, had a great time. Updated gtkeggdeps, the interactive Python package dependency browser. Collaborated with Thomas Lotze, who maintains the engine (tl.eggdeps) that gtkeggdeps wraps, to resolve API mismatches. Moved the sources to launchpad.net, added a test suite, made it use zc.buildout for convenient development. Moved the source repository of gtimelog, the simple desktop time tracker, to launchpad.net. Failed to do anything else with it.

Surprising old-style class behaviour

Some anonymous Planet Python poster (at least I couldn't find the author's name on the blog) Christian Wyglendowski asks about a surprising difference between old-style and new-style classes. Since the comments on their blog are closed (which you find out only after pressing Submit), I'll answer here. The question, slightly paraphrased: given a class class LameContainerOld: def __init__(self): self._items = {'bar':'test'} def __getitem__(self, name): return self._items[name] def __getattr__(self, attr): return getattr(self.

Buildbot issues on Ubuntu Hardy

Update: The story continues, but solution is not in sight yet. I upgraded a buildbot slave to Ubuntu 8.04 (Hardy) recently and now I'm getting a strange intermittent failure: sometimes cp -r /local/dir /nfs/mounted/dir fails ("process killed by signal 1", i.e. SIGHUP). I wonder if NFS is relevant or incidental to the issue? Google finds an old thread from 2005, with a workaround (usepty=False), but I'd like to understand the problem before applying random fixes.

Expert Python Programming

It's been a while since the last Expert Python Programming review on Planet Python. Y'all might've forgotten about this book by now. Time for a reminder? (Actually, I'm just lazy busy, and this is why this review hasn't appeared sooner.) I received a free PDF copy of this book from Packt Publishing, with the understanding that I'll post a review on my blog. This is it. Short summary: it is a good book marred by a lot of mostly inconsequential little mistakes.