This is my file $ python -c "print open('x.py').read().encode('base64')" IiIiCj4+PiBkdW1teSA9ICcnJwpzb21ldGhpbmcKaGVyZQonJycKIiIiCmltcG9ydCBkb2N0ZXN0 OyBkb2N0ZXN0LnRlc3Rtb2QoKQo=
but anyway I think Peter Otten is right, the problem is with the missing dots. It makes sense, actually, but for some reason I would never have thought of it (I did not expect doctest to be so smart to strip the dots even inside a string). Thanks for the feeback and the quick solution, Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list