Kiln’s kilnauth.py crashes under python 2.4

We recently switched to using Mercurial hosted at Joel Spolsky’s Kiln. So far I love it. I think distributed source control is the way of the future and I’m all for it.

Anyway, Kiln provides a number of useful Mercurial plugins, one of which is called ‘kilnauth’ and helps by caching your http authentication cookies so you don’t have to enter your password a bunch of times. I was setting this up on our linux box, which only has python 2.4, and kilnauth was causing a crash when it tried to do an md5 hash. The fix is pretty easy. Near the top where they import the md5 library, change this line:

try:
    from hashlib import md5
except:
    # Python 2.4
    import md5

To this:
try:
    from hashlib import md5
except:
    # Python 2.4
    from md5 import md5

That’s it. Simple little typo that they probably just didn’t test.

And on the subject of passwords, if you are bothered that capistrano outputs your inline http authentication passwords to the console, you can install this gem I wrote, cap_password_filter, to fix that.

Read the rest of this entry »


Follow

Get every new post delivered to your Inbox.