web2py 3.0.8 is OUT

200 views
Skip to first unread message

Massimo Di Pierro

unread,
Dec 2, 2024, 7:29:45 AM12/2/24
to web2py-users
Found a lot of bugs introduced in the port from 2.7 to 3.9+.

All known bugs introduced in porting from Python 2.7 to 3.9 have been fixed but one. The window binary (based on python 3.12) does not include Tk and therefore only provides a console, not a GUI.

I could use more help in testing existing apps. Please report anything that seems broken.
Many thanks to everybody how has already helped and pushed for this overdue work.

Massimo


simon...@gmail.com

unread,
Dec 2, 2024, 10:52:24 AM12/2/24
to web2py-users
Hi Massimo,

I am testing with Python 3.11 and so far, I found one bug in the admin-application: the view on todolist.load uses reduce() which is undefined:
<class 'NameError'> name 'reduce' is not defined
Version
web2py™ Version 3.0.8-stable+timestamp.2024.12.01.23.08.05
Python Python 3.11.2: /home/web2py/myappenv/bin/uwsgi (prefix: /home/web2py/myappenv)
Traceback (most recent call last):
  File "/home/web2py/myapp/gluon/restricted.py", line 214, in restricted
    exec(ccode, environment)
  File "/home/web2py/myapp/applications/admin/views/default/todolist.load", line 2, in <module>
    <!--div class="page-header"-->
           ^^^^^^
NameError: name 'reduce' is not defined

jimka...@yahoo.com

unread,
Dec 3, 2024, 6:48:25 PM12/3/24
to web2py-users
Hi Massimo,

Started moving to 3.08 literally a few minutes ago. The only change so far in what I downloaded from the web2py site is that I added my application to the application list. I'm trying Python3.12 on macOS Sequoia.
When I try to run my app, the following error appears immediately - 
File ".../web2py/applications/admin/controllers/default.py", line 1774, in make_link
return to_native(A('"' + tryFile + '"',
^^^^^^^^^
NameError: name 'to_native' is not defined


If I try to go to  "list by exceptions", the list of exceptions comes up, but if I try to click on one, web2py raises another exception and seems to hang

Does that give you enough info at this point?

Horst Horst

unread,
Dec 12, 2024, 1:32:25 PM12/12/24
to web2py-users
I've downloaded the latest source release (3.0.9) and installed it on macos. When I run it with Python 3.13.0, I get the ModuleNotFoundError below. Apparently cgi was removed in Py 3.8. 

When I run it with Python 3.7, the error does not occur, and my app (that I've just ported from Python 2) seems to work by and large, although the local webserver at times stalls for up to half a minute (no errors; have not yet spent much time investigating).

However, the website says "Future versions of web2py will require 3.9 or greater.". Which Python version am I supposed to use for the time being?

Traceback (most recent call last):
  File "/Users/sfx/dev/mdb/web2py-3.0.9/web2py.py", line 58, in <module>
    main()
    ~~~~^^
  File "/Users/sfx/dev/mdb/web2py-3.0.9/web2py.py", line 41, in main
    import gluon.widget
  File "/Users/sfx/dev/mdb/web2py-3.0.9/gluon/__init__.py", line 150, in <module>
    from .compileapp import LOAD
  File "/Users/sfx/dev/mdb/web2py-3.0.9/gluon/compileapp.py", line 35, in <module>
    from gluon.dal import DAL, Field
  File "/Users/sfx/dev/mdb/web2py-3.0.9/gluon/dal.py", line 17, in <module>
    from gluon import sqlhtml
  File "/Users/sfx/dev/mdb/web2py-3.0.9/gluon/sqlhtml.py", line 36, in <module>
    from gluon.globals import current
  File "/Users/sfx/dev/mdb/web2py-3.0.9/gluon/globals.py", line 15, in <module>
    import cgi
ModuleNotFoundError: No module named 'cgi'

simon...@gmail.com

unread,
Dec 13, 2024, 2:12:47 PM12/13/24
to web2py-users
cgi is removed in python 3.13. Web2Py was only tested in python 3.12, as fas as I know.

There is a legacy-cgi package on pypy that might help you:
https://stackoverflow.com/questions/78635741/drop-in-replacement-for-the-cgi-module

Horst Horst

unread,
Dec 16, 2024, 5:00:19 PM12/16/24
to web2py-users
Thanks Simon! Py 3.12 indeed works.

Nico Zanferrari

unread,
Dec 17, 2024, 10:12:13 PM12/17/24
to web...@googlegroups.com, Massimo DiPierro
Hi,

I've just release the new binaries (based on web2py 3.0.9 and python 3.12.7 + the latest pyinstaller) on https://github.com/nicozanf/web2py-pyinstaller.

But be careful because the 3.x version of web2py is quite unstable on all O.S. - it hangs frequently, at least the admin app. There are a couple of issues already issued on https://github.com/web2py/web2py/issues .

Cheers,
Nico


--
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 visit https://groups.google.com/d/msgid/web2py/e929036e-5592-4546-81df-a178540259d1n%40googlegroups.com.

Nico Zanferrari

unread,
Dec 20, 2024, 5:15:44 PM12/20/24
to web...@googlegroups.com, Massimo DiPierro
I think I've found the reason for the random hangs, after a whole afternoon downgrading and testing.

It should be due to this PR, that changed rocket with rocket3 . I'm attaching a fix (with the latest web2py, just overwrite the existing files under gluon) - it could be really helpful if someone could confirm it on a test environment. 
If confirmed, we could focus on the rocket/rocket3 changes ;-)

Nico
fix_web2py.zip

Nico Zanferrari

unread,
Dec 20, 2024, 5:28:16 PM12/20/24
to web...@googlegroups.com, Massimo DiPierro
Sorry, the previous attachment was wrong. Please use this one (v2).
If you prefer, you can easily make the changes by yourself on the sources, see the rocket3 PR.

nico
fix_web2py_v2.zip

Nico Zanferrari

unread,
Dec 21, 2024, 5:46:57 PM12/21/24
to web...@googlegroups.com, Massimo DiPierro
It took me another afternoon, but finally I've nailed down this nasty bug!

It's just a wrong indentation on three lines of Rocket3,  see https://github.com/web2py/rocket3/pull/5. You can easily apply it by yourself on your web2py/gluon/packages/rocket3/rocket3/__init__.py file.

image.png

Please test it and report the result!

Cheers,
Nico

Massimo DiPierro

unread,
Dec 21, 2024, 5:57:16 PM12/21/24
to Nico Zanferrari, web...@googlegroups.com

Thank you. Great work. Surprised I did not see the effects of this in py4web.

Reply all
Reply to author
Forward
0 new messages