Python 3 minor irritation

David Monaghan monaghand.david at gmail.com
Wed Feb 3 19:39:01 EST 2010


I have a small program which reads files from the directory in which it
resides. It's written in Python 3 and when run through IDLE or PythonWin
works fine. If I double-click the file, it works fine in Python 2.6, but in
3 it fails because it looks for the files to load in the Python31 folder,
not the one the script is in.

It's not a big deal, but browsing around I haven't found why the behaviour
has been changed or any comment about it (That might be my poor search
technique, I suppose).

The program fails at:

    try:
        tutdoc = minidom.parse(".//Myfile.xml")
    except IOError:
        <snip>

DaveM



More information about the Python-list mailing list