Web2py with python 3.8.0

628 views
Skip to first unread message

Константин Комков

unread,
Oct 30, 2019, 9:10:05 PM10/30/19
to web2py-users
Hello! I can't start web2py with python 3.8.0. Are somebody have the same problem? Web2py with python 3.7.3 and 3.7.5 work good. Thank you.

martel berends

unread,
Oct 31, 2019, 9:52:19 PM10/31/19
to web2py-users
I had the same problem..I was curious to see if it should work out of the box, but that was not the case. Currently I'm using python 3.7.4 

Op woensdag 30 oktober 2019 22:10:05 UTC+1 schreef Константин Комков:

Donald McClymont

unread,
Nov 2, 2019, 8:46:41 PM11/2/19
to web2py-users
So this seems to be because cgi.escape which was deprecated has now been removed.  I think there may have been a fix submitted for this - however if not it should be fairly simple to include - looks like we just need to use html.escape which will work for all reasonable versions of python 3.

DOnald

Massimo Di Pierro

unread,
Nov 3, 2019, 3:10:19 AM11/3/19
to web2py-users
Should be fixed. Funny anough that import was not used.

Woody

unread,
Nov 22, 2019, 3:07:18 PM11/22/19
to web2py-users
I updated to Python 3.8 on Arch Linux today and I had the same problem with 'escape'. I patched the languages.py file and got web2py to start, but then hit another error:

Traceback (most recent call last):
 
File "/home/www/web2py/gluon/restricted.py", line 219, in restricted
   
exec(ccode, environment)
 
File "/home/www/web2py/applications/x10_security/models/db.py", line 55, in <module>
   
auth.define_tables(username=False, signature=False)
 
File "/home/www/web2py/gluon/tools.py", line 2092, in define_tables
   
super(Auth, self).define_tables(username, signature, migrate, fake_migrate)._table_signature_list
 
File "/home/www/web2py/gluon/authapi.py", line 322, in define_tables
    db
.define_table(
 
File "/home/www/web2py/gluon/packages/dal/pydal/base.py", line 592, in define_table
    table
= self.lazy_define_table(tablename, *fields, **kwargs)
 
File "/home/www/web2py/gluon/packages/dal/pydal/base.py", line 623, in lazy_define_table
   
self._adapter.create_table(
 
File "/home/www/web2py/gluon/packages/dal/pydal/adapters/base.py", line 798, in create_table
   
return self.migrator.create_table(*args, **kwargs)
 
File "/home/www/web2py/gluon/packages/dal/pydal/migrator.py", line 299, in create_table
    sql_fields_old
= pickle.load(tfile)
TypeError: file must have 'read', 'readinto' and 'readline' attributes

I looked for a discussion or patch for this, but I didn't find one. Can anybody tell me how to fix this?

Massimo Di Pierro

unread,
Nov 28, 2019, 9:49:02 PM11/28/19
to web2py-users
At this time we do not support python 3.8. It seems to have broken both web2py and py4web in different ways. I think 3.8 should be fixed, not web2py,

Woody

unread,
Nov 29, 2019, 1:10:55 PM11/29/19
to web2py-users
What is causing the problem with Python 3.8? Is it causing problems with other applications? Is it an undocumented bug in Python? Is it likely that Python will be changed to fix the problem or will web2py have to conform to the Python changes?

Kevin Keller

unread,
Nov 29, 2019, 7:31:10 PM11/29/19
to web2py-users
Some deprecated functions have been removed in 3.8 finally.


Hence py4web and web2py have to adapt to the new situation.

Django went through the same process already. 



On Fri, 29 Nov 2019, 14:11 Woody, <myl...@woodring.us> wrote:
What is causing the problem with Python 3.8? Is it causing problems with other applications? Is it an undocumented bug in Python? Is it likely that Python will be changed to fix the problem or will web2py have to conform to the Python changes?

--
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+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/e3321a7d-b518-49ec-8d57-9fcdc8886022%40googlegroups.com.

Woody

unread,
Nov 29, 2019, 7:44:02 PM11/29/19
to web2py-users
Shouldn't that be done before the release rather than afterward?

Kevin Keller

unread,
Nov 29, 2019, 8:20:38 PM11/29/19
to web2py-users
Maybe, it wasn't on the radar of the django developers either and had to be fixed in the framework after python3 was released.

Happens sometimes I suppose, hard to keep up with depreciation of functions and the impact on a framework. 

Anyways, I suppose we juar have to file the bug reports and fix each function step by step until all deprecated functions are removed and replaced with the ones that need to be used for python 3.8 and forward.





On Fri, 29 Nov 2019, 20:44 Woody, <myl...@woodring.us> wrote:
Shouldn't that be done before the release rather than afterward?

--
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+un...@googlegroups.com.

Serge Bourgeois

unread,
Jan 3, 2021, 9:20:45 AM1/3/21
to web2py-users
Hello,
I'm trying to convert my web2py apps to Ubuntu 20.4 / apache2/wsgi using python 3.8.5, and as I'm not an IT expert, the only way I found was to change the import instructions in a series of modules. I am aware I shouldn't do this, but I couldn't find any alternative...
I would apreciate getting any feedback with another solution, and/or corrections of my 'durty coding'.

Action 1:
- usr/lib/python3/dist-packages/yaml___init.py - line 399:
 replace def class YAMLObject(metaclass=YAMLObjectMetaclass):
by
def class YAMLObject:
    __metaclass__=YAMLObjectMetaclass
Action 2:
create /etc/securetty file (there was an example of content of this file in /usr/share/doc/util-linux/examples/securetty)

Action 3:
add following line in /homr/www-data/web2py/gulon/packages/dal/pydal/adapters/base.py, line 16:
if not '/usr/lib/python3/dist-packages' in sys.path:
    sys.path.append(''/usr/lib/python3/dist-packages')

Action 4:
This 'import' instrunction of python is incompatible with the previous version. In each module (for instance gluon), the import of 'brother modules' (modules in the same folder than gluon) are done with the following type of instruction: 'from gluon import xxx'
This doesn't work in my configuration, because import instructions starting with a 'from' are supposed to refer to the relative path of the module, and not the absolute path (which scans sys.path).
=> this instrunction must be changed (for instance by 'from .gluon import xxx')

I am still working to get my system running, but at least, I can start web2py...

I do not want to enter into phylosophical discussion about what I am authorized to do or not, and I hope that in early 2021, the evolution of ubuntu, python, web2py and other usefull packages will take care to keep harmony in the strategy of their evolution.

jimka...@yahoo.com

unread,
Jan 3, 2021, 8:26:52 PM1/3/21
to web2py-users
While investigating 3.8 issues, should also be aware of the following - "3.9.1 is the first version of Python to support macOS 11 Big Sur."  as per https://www.python.org/downloads/release/python-391/

Joe Barnhart

unread,
Jan 14, 2021, 6:24:24 PM1/14/21
to web2py-users
Just for the record, because it's not clear from this thread, the Python 3,8 problem seems to have been taken care of.  I've been running web2py on Python 3.8 for the last couple of weeks at least and never noticed a problem.
Reply all
Reply to author
Forward
0 new messages