File open problem?

Remco Gerlich scarblac at pino.selwerd.nl
Tue Jun 12 00:42:44 CEST 2001


William Dandreta <wjdandreta at worldnet.att.net> wrote in comp.lang.python:
> I am getting an error I do not understand.
> 
> 1st line in script (/mnt/floppy/setup.py) is:
> 
> myfile = open('/etc/rc.d/rc.sysinit','r')
> 
> error is:
> 
> Traceback (innermost last):
>   File "/mnt/floppy/setup.py", line 5, in ?
>     myfile = open('/etc/rc.d/rc.sysinit','r')
> TypeError: illegal argument type for built-in operation

Here it says line 5, not line 1.

Wild guess: did you do "from os import *" ?

The os module contains its own, different open() function.

-- 
Remco Gerlich



More information about the Python-list mailing list