New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NewEvent is not triggered by pyramid.scripting #520
Comments
This is a symptom of a larger issue with how Is your root_factory puking before entering your script? A traceback would be nice regardless. |
Oof. Nice to know that it's a "deep" problem, and not just me being stupid. Still, it seems to me that this particular part of problem is easily fixed. I'm a bit out of my depth though, so I could be wrong. Sorry, it is
|
Thanks for the traceback, it confirms my suspicions that the error occurs not in your script but rather in the setup. Placing a NewRequest event in bootstrap makes me hesitant, but maybe the Pyramid logic for adding request properties can be modified to happen more automatically, without requiring the event be emitted. |
That is pretty straight-forward, I think. Here is a patch which does that: Note that the above patch does not set the custom properties on any request instances explicitly passed in to |
Looks good to me, how about you @mmerickel |
…rty`` or ``config.add_request_method`` are now available to tweens. - Request properties and methods added via ``config.set_request_property`` or ``config.add_request_method`` are now available in the request object returned from ``pyramid.paster.bootstrap``. Related partially to issue #520 and issue #538 and issue #596, although it doesn't actually allow us to close any of them, because we still don't issue a newrequest event when bootstrap is used.
This has been fixed in 7359873 and released in 1.4a1. The solution does not emit a |
This adapter allows PasteDeploy-based tools to load a baseplate application. In a baseplate-style config file, adding the line "use = egg:baseplate" is all that's necessary. Note: a root span is not automatically created in scripting context (e.g. pshell) see Pylons/pyramid#520.
I have a
root_factory
which depends on a custom request property (viaconfig.set_request_property
).When the code in
pyramid.scripting
generates a request, it does not emit aNewRequest
. This means that (when I try to runpshell
, for example) my custom request property does not get set. Consequently, my root_factory pukes.Is this all my fault, or is it a bug?
(If it is deemed a bug, I'd be happy to formulate a pull request. My hunch is that
pyramid.scripting._make_request
should emit aNewRequest
event when it constructs a new request.)Edited: I'm having trouble with
pshell
notpscript
.The text was updated successfully, but these errors were encountered: