web.input() IOError No such file or directory

45 views
Skip to first unread message

David

unread,
Oct 19, 2012, 10:26:38 AM10/19/12
to we...@googlegroups.com
whenever i try to get a file with web.input().myfile i get a IOError.

IOErorr: [Errno 2] No such file or directory

i could get the file with web.data() but this way i have the problem that i can't read the file with the xlrd module cause of the header in web.data()

what could be the problem? is there maybe a way to cut the header form web.data()

thanks for help
david

Jason Macgowan

unread,
Oct 20, 2012, 8:18:37 AM10/20/12
to we...@googlegroups.com
Can you post more of the code? It's hard to see what's going on from just this
> --
> You received this message because you are subscribed to the Google Groups
> "web.py" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/webpy/-/iGrSgg__iEUJ.
> To post to this group, send email to we...@googlegroups.com.
> To unsubscribe from this group, send email to
> webpy+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/webpy?hl=en.

David

unread,
Oct 23, 2012, 4:35:54 AM10/23/12
to we...@googlegroups.com
i found out the problem. it was a poblem with my fileystem. the filesystem isn't able to craete unnamed tempfiles (tempfile.TemporaryFile()).
but this feature is used by the FieldStorage class in the cgi module.

i have solved the problem like that:

class MyFieldStorage(cgi.FieldStorage):
    def make_file(self, binary=None):
        return tempfile.NamedTemporaryFile()

then i have used the FieldStorage Class native and not throug web.py.
thanks anyway.
Reply all
Reply to author
Forward
0 new messages