Without seeing more of your code, I'm not sure what you are doing wrong. This works: vvvvvvvv ex.py vvvvvvvvvvvvvv def xopen(path): try: return open(path) except IOError, e: print 'Error:', e.args[1]
xopen('xyzzy') ^^^^^^^^^^^^^^^^^^^^^^^^^^ $ python ex.py Error: No such file or directory Could you give us the traceback? -- http://mail.python.org/mailman/listinfo/python-list