Really, really annoying problem

Greg Landrum glandrum at
Thu Sep 21 01:21:42 CEST 2000

In article <BW8y5.7965$g12.449621 at>,
  "Brett Lempereur" <a.lempereur[remove this|@|remove this]> wrote:
> > - how do you know that the backslashes are doubled?
> >   (in other words, how did you print the filename?)
> Because I do this:
> filename = tools.addroot("ppdump.cfg")
> file = open(filename, "w")
> The error occurs at the "open(filename, 'w')" stage, where it raises
> double backslash error
> The error message from python is....
> Traceback (most recent call last):
>   File "D:\Python\Pythonwin\pywin\framework\", line
301, in
> RunScript
>     exec codeObject in __main__.__dict__
>   File "C:\My Documents\Python\Backup Program\Lib\",
line 17,
> in ?
>     out_file = open(out_filename)
> IOError: [Errno 2] No such file or directory: 'C:\\ppdump.txt'

Fredrik already said this, but you didn't appear to read it, so I'll
say it too.
Look at the second to last line of your traceback.  The command being
executed is:
     out_file = open(out_filename)
what you probably meant to have there was:
     out_file = open(out_filename,"w")

The problem most likely has nothing to do with mysterious backslash


Sent via
Before you buy.

More information about the Python-list mailing list