Hey there! I'm experiencing the same error after migrating to python3 and web2py version 2.23.1-stable+timestamp.2023.01.31.08.01.46 The traceback is the same, the error is originated when I try to access request.vars:
Traceback (most recent call last): File "/home/limon/medios/gluon/restricted.py", line 219, in restricted exec(ccode, environment) File "/home/limon/medios/applications/webmedios/controllers/ws.py", line 1423, in <module> File "/home/limon/medios/gluon/globals.py", line 430, in <lambda> self._caller = lambda f: f() File "/home/limon/medios/applications/webmedios/controllers/ws.py", line 13, in call if not request.vars.token or not db(db.sitios.token == request.vars.token). count(): File "/home/limon/medios/gluon/globals.py", line 325, in vars self.parse_all_vars() File "/home/limon/medios/gluon/globals.py", line 296, in parse_all_vars for key, value in iteritems(self.post_vars): File "/home/limon/medios/gluon/globals.py", line 317, in post_vars self.parse_post_vars() File "/home/limon/medios/gluon/globals.py", line 253, in parse_post_vars dpost = cgi.FieldStorage(fp=body, environ=env, headers=headers, keep_blank_values=1) File "/usr/lib64/python3.6/cgi.py", line 569, in __init__ self.read_single() File "/usr/lib64/python3.6/cgi.py", line 761, in read_single self.read_binary() File "/usr/lib64/python3.6/cgi.py", line 783, in read_binary self.file.write(data) TypeError: write() argument must be str, not bytes I've found that this was related to a python bug <https://bugs.python.org/issue27777> that is still opened, but at the same time I've seen that web2py received a workaround fix <https://github.com/web2py/web2py/pull/2309/commits/5490480906cf48360629baa68b55e517ff3621b6> . I'm running the last web2py stable version. And just in case I checked the source code and it is running with the workaround fix. But the error still remains. What should I try? I'm a bit lost :/ El lunes, 7 de octubre de 2019 a la(s) 18:08:12 UTC-3, Mark escribió: > I submitted the bug report to the github. > > Thank you very much. > > > On Sunday, October 6, 2019 at 5:29:31 PM UTC-4, Dave S wrote: >> >> >> >> On Friday, September 27, 2019 at 6:39:00 AM UTC-7, Mark wrote: >>> >>> I am using either Rocket or Azure, and get the same error. >>> >>> Yes, there is a ticket, which I didn't realize before: >>> >>> Traceback (most recent call last): >>> File "R:\web2py\gluon\restricted.py", line 219, in restricted >>> exec(ccode, environment) >>> File "R:\web2py\applications\myapp\models\db.py", line 321, in <module> >>> 'aaaaaaaaaaaaaaaaaaaaaaaaaaaa') >>> File "R:\web2py\gluon\tools.py", line 884, in __init__ >>> self.request_vars = request and request.vars or current.request.vars >>> File "R:\web2py\gluon\globals.py", line 316, in vars >>> self.parse_all_vars() >>> File "R:\web2py\gluon\globals.py", line 287, in parse_all_vars >>> for key, value in iteritems(self.post_vars): >>> File "R:\web2py\gluon\globals.py", line 308, in post_vars >>> self.parse_post_vars() >>> File "R:\web2py\gluon\globals.py", line 244, in parse_post_vars >>> dpost = cgi.FieldStorage(fp=body, environ=env, keep_blank_values=1) >>> File "c:\python37\lib\cgi.py", line 491, in __init__ >>> self.read_single() >>> File "c:\python37\lib\cgi.py", line 682, in read_single >>> self.read_binary() >>> File "c:\python37\lib\cgi.py", line 704, in read_binary >>> self.file.write(data) >>> File "c:\python37\lib\tempfile.py", line 481, in func_wrapper >>> return func(*args, **kwargs) >>> TypeError: write() argument must be str, not bytes >>> >>> >>> Thanks! >>> >> >> This looks like a place where something got missed in the Py3 work. I >> suspect in cgi.py, maybe because testing used a uwsgi setup. But I'm not >> ready to go into to it at this time. Try filing a bug report at < >> https://github.com/web2py> >> >> Also, make sure we know what the front-end and middle-ware parts of the >> configuration are. >> >> /dps >> >> >> > -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/3fcfb97d-139b-491d-b799-b7e43c8e8500n%40googlegroups.com.