py4web experimental release

91 views
Skip to first unread message

Massimo DiPierro

unread,
May 10, 2026, 1:47:57 AMMay 10
to py4web
I made a number of changes to py4web with the help of Claude. I will be making more.
It is still backward compatible. I built a manual from the docs, see below.

Please help me check nothing is broken.

Massimo


py4web.pdf

Massimiliano

unread,
May 29, 2026, 5:48:55 AMMay 29
to Massimo DiPierro, py4web
With this version I got this kind of errors:
                                                                                                                                                        
app  | Fixture cleanup failed for <DAL uri="pgsql://******@xxx.xxx.xx.xx/xxxxx">: '_thread._local' object has no attribute 'request_ctx' > Thread-9 > 11:20:28.761                      
  
It is an app that don't use neither flash nor sessions

claude found that:

 Root cause

  Fixture._local.request_ctx (a per-thread dict) is created lazily, and only by Session.on_request (core.py:974) and Flash.on_request (core.py:601) via Fixture.local_initialize(). The DAL
  fixture's on_request (core.py:520-524) never calls it, and DAL doesn't use the thread-local at all.

  The drivers app actions use only @action.uses(db) — no session, no flash. So on any worker thread that has never served a Session/Flash request, Fixture._local has no request_ctx attribute
  at all.

  Then the request-teardown loop runs Fixture.local_delete(db) for every fixture (core.py:1198), which does del Fixture._local.request_ctx[obj]:

  @staticmethod
  def local_delete(obj):
      del Fixture._local.request_ctx[obj]   # core.py:483

  With no request_ctx attribute, this raises AttributeError: '_thread._local' object has no attribute 'request_ctx'. The loop catches KeyError (dict exists, key missing) but not
  AttributeError (dict never created), so it falls through to the generic handler and logs Fixture cleanup failed (core.py:1201-1206).

  It's harmless: the DB connection is already committed and recycled in DAL.on_success (which ran fine — that's why you still get 200). Nothing leaks, because DAL never created a
  thread-local entry to begin with. It's pure log noise, introduced in commit 1e0494d1 ("Log unexpected fixture cleanup failures").

  The fix

  The loop's own comment says KeyError is expected when a fixture "never ran (or never initialised a thread-local)". AttributeError is exactly that second case — the dict-level version of
  the same benign condition. One-line fix at core.py:1199:

  except (KeyError, AttributeError):
      pass



Thank you

--
You received this message because you are subscribed to the Google Groups "py4web" group.
To unsubscribe from this group and stop receiving emails from it, send an email to py4web+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/py4web/922705eb-d583-458c-991c-4c0a6ec7bffbn%40googlegroups.com.


--
Massimiliano

Massimo DiPierro

unread,
May 29, 2026, 9:20:55 AMMay 29
to Massimiliano, py4web
I think this a serious bug and Claude is wrong. Tina may cause information leakage across sessions. I will take a closer look later today and fix it.

Thanks for testing and reporting this.

Christian Varas

unread,
May 29, 2026, 9:32:40 AMMay 29
to Massimo DiPierro, Massimiliano, py4web
just a public utility notice: 

To avoid claude usage wait time or avoid to spend 100 usd for more “unlimited use”
In claude code (terminal) you can change the anthropic endpoint to use another model which speak anthropic format, this is done by modifying .claude/settings.json 

I use claude code pro via desktop app and minimax 2.7M with claude code terminal
Minimax is really good as claude but pay-per use and way more cheaper.

give it a try if you don’t want to wait or spend 100+
Greetings.

Massimo DiPierro

unread,
May 30, 2026, 1:03:17 PMMay 30
to py4web
What do you know! I was wrong. You and Claude are right. :-) Thanks for the fix
Reply all
Reply to author
Forward
0 new messages