Thanks for replying. Sorry, Massimo, I am reluctant to upgrade on my server. I experience a major bug on my local web2py with 2.18 series, re: Logger message <https://groups.google.com/forum/#!topic/web2py/XHaWBQqe9Bs> error.
I have decided to stay with 2.17.2 for now, on both local and server. On Thursday, March 14, 2019 at 8:51:04 PM UTC-7, Massimo Di Pierro wrote: > > can you please try 2.18.4? > > On Monday, 11 March 2019 18:16:25 UTC-7, Yi Liu wrote: >> >> I think this is a python 3 bug: >> >> I have >> >> request.requires_https() >> >> in a model file 1_server.py >> >> Then after I switch to Py3 recently, I start to collect these errors: >> >> Ticket ID >> >> 221.2.44.75.2019-03-10.23-16-34.b272289e-a41d-4c91-a730-2346995d4bdb >> >> <class 'TypeError'> write() argument must be str, not bytes >> Version >> web2py™ Version 2.17.2-stable+timestamp.2018.10.06.18.54.02 >> Python Python 3.7.1: /usr/local/pyenv/versions/miniconda3-latest/bin/uwsgi >> (prefix: /usr/local/pyenv/versions/miniconda3-latest) >> >> Traceback >> >> 1. >> 2. >> 3. >> 4. >> 5. >> 6. >> 7. >> 8. >> 9. >> 10. >> 11. >> 12. >> 13. >> 14. >> 15. >> 16. >> 17. >> 18. >> 19. >> 20. >> 21. >> 22. >> >> Traceback (most recent call last): >> File "/home/www-data/web2py/gluon/restricted.py", line 219, in restricted >> exec(ccode, environment) >> File >> "/home/www-data/web2py/applications/trialert/compiled/models.1_server.py", >> line 2, in <module> >> File "/home/www-data/web2py/gluon/globals.py", line 366, in requires_https >> redirect(URL(scheme='https', args=self.args, vars=self.vars)) >> File "/home/www-data/web2py/gluon/globals.py", line 316, in vars >> self.parse_all_vars() >> File "/home/www-data/web2py/gluon/globals.py", line 287, in parse_all_vars >> for key, value in iteritems(self.post_vars): >> File "/home/www-data/web2py/gluon/globals.py", line 308, in post_vars >> self.parse_post_vars() >> File "/home/www-data/web2py/gluon/globals.py", line 244, in parse_post_vars >> dpost = cgi.FieldStorage(fp=body, environ=env, keep_blank_values=1) >> File "/usr/local/pyenv/versions/miniconda3-latest/lib/python3.7/cgi.py", >> line 486, in __init__ >> self.read_single() >> File "/usr/local/pyenv/versions/miniconda3-latest/lib/python3.7/cgi.py", >> line 665, in read_single >> self.read_binary() >> File "/usr/local/pyenv/versions/miniconda3-latest/lib/python3.7/cgi.py", >> line 687, in read_binary >> self.file.write(data) >> TypeError: write() argument must be str, not bytes >> >> >> TypeError(write() argument must be str, not bytes) >> >> >> >> -- 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/d/optout.