What the heck? open() requires an integer?

Henrik Motakef henrik.motakef at web.de
Fri Sep 20 06:07:51 EDT 2002


"Fausto Arinos de A. Barbuto" <fbarbuto at telusplanet.net> writes:

>     The open() function is returning me a strange error.
>     An attempt to create an output file with
> 
>             f = open("output.txt","w")
> 
>     yields the following error:
> 
>     Traceback (most recent call last):
>     File "<interactive input>", line 1, in ?
>     TypeError: an integer is required

Did you by chance import * from os? Looks as if you get os.open, that
indeed wants an integer.

hth
Henrik



More information about the Python-list mailing list