open() error ---- what am I missing?

Jim Dennis jimd at vega.starshine.org
Mon Mar 18 02:47:23 EST 2002


In article <avPg8.11102$hK4.4053571 at e420r-atl1.usenetserver.com>, 
 Eric Torstenson wrote:

> OK I figured it out. It was a misleading error message.  For those with
> similar troubles I have listed an explanation (and I was being stupid...I
> sort of figured as much)

> It was a bad path name after all. It is a nested structure, where at one
> point I left off one extra "\" (I'm using windows). I had looked at that
> path a dozen times, somehow missing that single "\" down toward the
> middle....


> "Oleg Broytmann" <phd at phd.pp.ru> wrote in message
> news:mailman.1015263607.7574.python-list at python.org...
>> On Mon, Mar 04, 2002 at 11:31:46AM -0600, Eric Torstenson wrote:
>>>         self.fLog=open(filename, mode='w')
>>>     IOError: invalid argument: w

>> Do you have the os module imported? Especially in the form
>> "from os import *" or "from os import open"?

>> Oleg.

 In other words it was another case of: r"use raw strings for 
 filename literals under Win Python!"




More information about the Python-list mailing list