This fails on python 3 and doesn't look too good.