GithubHelp home page GithubHelp logo

Comments (8)

malthe avatar malthe commented on June 25, 2024

It might be that you've got the same template which is being rendered from different call sites such that the stack depth could vary between runs.

What happens if you use the environment variable CHAMELEON_EAGER=1 – ?

from chameleon.

mikeckennedy avatar mikeckennedy commented on June 25, 2024

Thanks @malthe Here's what I get:

pyramid.httpexceptions.HTTPNotFound: The resource could not be found.

During handling of the above exception, another exception occurred:
    d['__loader'] = self._loader
AttributeError: 'PyramidPageTemplateFile' object has no attribute '_loader'

Does that tell you what's happening? I don't know what to make of this. Obviously, without this setting there is no HTTPNotFound error.

This code has been mostly unchanged for a long time and this error only started appearing on Python 3.11 (though it may have been hiding in there somewhere before).

from chameleon.

malthe avatar malthe commented on June 25, 2024

@mikeckennedy I have fixed this issue; are you able to apply this patch to see if we're getting any result out of CHAMELEON_EAGER=1 now?

from chameleon.

mikeckennedy avatar mikeckennedy commented on June 25, 2024

H @malthe i. I tried it out. I think it fixes it. Certainly no more errors that I could find. Thank you very much!

from chameleon.

malthe avatar malthe commented on June 25, 2024

I'm closing this one out because I think the root cause is that the stack is too deep which is out of our control. Eager parsing is a remedy in this case (which has now been fixed).

from chameleon.

mikeckennedy avatar mikeckennedy commented on June 25, 2024

Awesome, thanks. Do I need to set CHAMELEON_EAGER=1 on my servers? It sounds like I should.

from chameleon.

malthe avatar malthe commented on June 25, 2024

@mikeckennedy released now as https://pypi.org/project/Chameleon/3.10.2/.

Yes – you would have to use that environment variables on your servers, simply because of how your app apparently works. Well, that's our "working theory" about it at least ...

from chameleon.

mikeckennedy avatar mikeckennedy commented on June 25, 2024

Great, thanks for the info. That’s fine by me. Just want to make sure I’m “doing it right.” :)

from chameleon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.