> As you can see, IOError covers many issues > > >>> try: > ... fd = open('/home/shoon/xinitrc') > ... except IOError, e: > ... print e[0], e[1] > ... > 13 Permission denied > > I am sure there is a wrapper for errno somewhere in python. Here you go: http://www.python.org/doc/lib/module-errno.html Hope this helps!