[Tutor] TypeError when io.open is used

Alan Gauld alan.gauld at btinternet.com
Thu Jun 24 09:11:52 CEST 2010

<petkovas at dir.bg> wrote

> The error:
> Traceback <most recent call last>:
>   File "insert_into_db_v9.py", line 55, in <module>
> TypeError: an integer is required

Can you send the full error text please? I'm not sure which 
is line 55 and Python normally displays the faulty line as 
part of the error trace.

As it is I can't see any reason for it to fail but I'd like to 
be sure I'm looking at the right place!

Also is there any reason why you explicitly call io.open() 
instead of just using the built-in open() directly? I know 
they are the same function but its quite unusual to use 
the io version explicitly...

Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list