wev2py 2.22.1 is out

237 views
Skip to first unread message

Massimo Di Pierro

unread,
Jan 31, 2022, 10:59:33 PM1/31/22
to web2py-users
Hello Everybody,

web2py 2.22.1 is out.

Includes a few bug fixes and some changes including:
- support for mail.sent(reply_to=...), thanks Ofa
- fix a bug to enable redis with python3, thanks Leonel
- upgraded to latest pydal and yatl

Please report any breakages or issues.

Massimo

cdbaron

unread,
Feb 1, 2022, 5:34:34 PM2/1/22
to web2py-users
Hello,

I have downloaded this latest version and the web2py/gluon/packages/dal directory is empty.
Message has been deleted
Message has been deleted

cdbaron

unread,
Feb 9, 2022, 10:21:40 AM2/9/22
to web2py-users
Now from github I can successfully download web2py.

But I have a problem with a form with a field of type upload.

With web2py 2.21.1 it works fine, but with version 2.22.1 it doesn't work. I have tested with python 3.7 and 3.8

I already posted a query a few days ago, but I haven't had any response, I apologize for posting the same thing again.

When I upload any image with a form, for example the one below, when downloading the image I get a 400 bad request error

def upload_img():
    record = db(db.t_upload).select().first()
    form = SQLFORM(
        db.t_upload,
        record,
        upload=URL('default', 'download')
    )


I think it is some modification in web2py after publishing version 2.21.1

I have tried to attach a .w2p file with the myapp application but it does not allow me to upload this type of file.

The application works perfectly if I do NOT use a routes.py file in the web2py root directory.

http://127.0.0.1:8000/myapp/upload/upload_img (Works fine)

But with the file routers.py with this content:

routers = dict(
    BASE=dict(
        default_application='myapp',
    ),
)

The application does not work well, there is a 400 error when downloading the
image uploaded with the form

http://127.0.0.1:8000/upload/upload_img (Doesn't work right)

This 400 error also occurs whenever the image is used, not just on the form.

I am doing something wrong?

Dragan Matic

unread,
Feb 12, 2022, 3:02:48 PM2/12/22
to web2py-users
Hi Massimo,

As already pointed out, when I try to download source code from this addres https://mdipierro.pythonanywhere.com/examples/static/web2py_src.zip the dal directory is empty and it breaks web2py.

Massimo Di Pierro

unread,
Feb 13, 2022, 4:32:03 PM2/13/22
to web2py-users
I rerun the build script. Can you please confirm it is fixed for you?

Massimo Di Pierro

unread,
Feb 13, 2022, 4:44:19 PM2/13/22
to web2py-users
I am very confused by this. I cannot find any change that could cause this change of behavior. Let me summarize to make sure I am understanding.

You observed a change of behavior between 2.21.1 and 2.22 1.
The change of behavior only manifests when you declare a default app in routers.py
The change of behavior consists of the fact that, if you upload a file using a form, the link to download the file does not work.
You can confirm that the file is there and the link works if no default app in routers is provided.

Is this all correct? If yes. I will debug more. If you could provide a minimalist app to reproduce it would save me some time.

Massimo
Message has been deleted

cdbaron

unread,
Feb 14, 2022, 12:39:21 PM2/14/22
to web2py-users
Hi Massimo,

Thanks for replying, this issue is driving me a little crazy...

* I noticed the change in behavior when updating from Version 2.19.1-stable to the github version of the end of December 2021 (before version 2.22.1)
* After this, I downloaded version 2.21.1 from web2py.com and it worked fine.
* Then with version 2.22.1 I continue with this problem.
* Yes, this behavior change was only detected when I declared a default application in routes.py in the root directory of web2py.
* Yes, if I upload a file the download link doesn't work, and the form itself can't display the image.
* The file is uploaded correctly and is in the correct directory.
* If I delete the routes.py file everything works fine and the file that I uploaded when I had declared the default application can be downloaded without problems, the link (with the name of the application in the url) works fine.
* one more thing, when I have the default application declared, if I upload an image with a.jpeg filename everything works fine, with any other aa.jpeg filename for example the download link gives me a 400 error.

I'm going to try to attach a zip file to a simple example application. A single table with a single field and a controller with a single function that creates a form.

Leonel Câmara

unread,
Feb 16, 2022, 4:18:48 PM2/16/22
to web2py-users
@cdbaron this was a sneaky one, but I've found it. I actually think this one is a very old bug from 2016 and I think it might be affecting my applications as well.

Leonel Câmara

unread,
Feb 16, 2022, 4:19:21 PM2/16/22
to web2py-users
Link for the potential fix

cdbaron

unread,
Feb 17, 2022, 10:54:21 AM2/17/22
to web2py-users
Hello,

Now it's working fine!

Thank you very much, you are doing an amazing job.
Reply all
Reply to author
Forward
0 new messages