I am facing perhaps a similar issue when I try to get my web2py (Version 
2.5.1-stable+timestamp.2013.06.06.15.39.19) application running on a tablet 
with Android 4.3 and sl4a (python 2.6). GETs seems to be okay but POSTs 
(e.g. login as user) result in tickets. As any attempt to login results in 
tickets and is unsuccessful finally the content of tickets is not displayed 
in the browser but I manged to extract the complain:

"(self=FieldStorage(None, None, ''))"
'read_lines_to_outerboundary'
'Python 2.6.2: 
/data/user/0/com.googlecode.pythonforandroid/files/python/bin/python 
(prefix: /data/user/0/com.googlecode.pythonforandroid/files/python)'
"<type 'exceptions.IOError'>"
'Tue Sep 10 08:25:09 2013'
'delim'
"''"
"FieldStorage(None, None, '')"
"'-----------------------------53628658412953322821182323057--'"
'True'
"'-----------------------------53628658412953322821182323057'"
'Traceback (most recent call last):
  File "/storage/emulated/legacy/sl4a/scripts/web2py/gluon/main.py", line 
533, in wsgibase
    parse_get_post_vars(request, environ)
  File "/storage/emulated/legacy/sl4a/scripts/web2py/gluon/main.py", line 
348, in parse_get_post_vars
    dpost = cgi.FieldStorage(fp=body, environ=environ, keep_blank_values=1)
  File "/storage/emulated/legacy/sl4a/scripts/web2py/cgi.py", line 508, in 
__init__
    self.read_multi(environ, keep_blank_values, strict_parsing)
  File "/storage/emulated/legacy/sl4a/scripts/web2py/cgi.py", line 632, in 
read_multi
    environ, keep_blank_values, strict_parsing)
  File "/storage/emulated/legacy/sl4a/scripts/web2py/cgi.py", line 510, in 
__init__
    self.read_single()
  File "/storage/emulated/legacy/sl4a/scripts/web2py/cgi.py", line 647, in 
read_single
    self.read_lines()
  File "/storage/emulated/legacy/sl4a/scripts/web2py/cgi.py", line 669, in 
read_lines
    self.read_lines_to_outerboundary()
  File "/storage/emulated/legacy/sl4a/scripts/web2py/cgi.py", line 698, in 
read_lines_to_outerboundary
    line = self.fp.readline(1<<16)
IOError: [Errno 2] No such file or directory

When I add some python code to the cgi module function ' 
read_lines_to_outerboundary' to inspect self.fp ...

       while 1:
            print 'DBG: fp -> %s' % str(self.fp)
            line = self.fp.readline(1<<16)
            if not line:
                self.done = -1
                break

 ... I get the following:

DBG: fp -> <open file '<fdopen>', mode 'w+b' at 0x40b41ed0>

Any help or hints how to track down the root cause of this issue are 
appreciated very much.

Regards,
Michael



Am Sonntag, 14. Juli 2013 12:11:22 UTC+2 schrieb Massimo Di Pierro:
>
> Can you try wrap (in main.py)
>
> parse_get_post_vars(request, environ)
>
> in try: ...  except IOError: pass and see what happens.
>
> Web2py copies the input stream into a temp file in order to be able to 
> parse it but also pass a copy to the app. I suspect something happens to 
> the original stream and it gets closed twice (not sure why, not by web2py, 
> but by the wsgi adapter). If we isolate the problem we can find a work 
> around.
>
> On Sunday, 14 July 2013 03:16:09 UTC-5, Fernando Pacheco wrote:
>>
>> I'm trying to run a minimal version of web2py (git version) on Android 
>> (Samsung Galaxy Tab 2 10 ") with kivy (as a service, latest python 
>> version 2.7) and / or from the launcher SL4A (pythn 2.6).
>>
>> Everything works fine when I use GET, but when I submit a form (POST) I 
>> get the following error: 
>>
>> *close failed in file object destructor: **
>> **IOError: [Errno 5] I/O error
>> *
>> The admin application also has this problem (password submit with the 
>> same error).
>>
>> Full web2py version (from git) has the same problem. 
>>
>> I have tried to detect the source of error with no luck. Has anyone run 
>> applications -on Android- that contain forms (POST) successfully?.Any 
>> thoughts on this?. 
>>
>> Thank you very much. Greetings. Fernando.
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to