Re: [pylons-discuss] Creating a request copy?

2019-01-15 Thread Michael Merickel
There is no supported way to deep copy a general request object. Instead I would suggest copying the headers/body directly and replaying the request through the router as part of your simulations. On Tue, Jan 15, 2019 at 4:09 AM Thierry Florac wrote: > Hi, > Simple question: I have a use case

Re: [pylons-discuss] Creating a request copy?

2019-01-15 Thread Mike Orr
I don't have a complete answer to this, but the Request docstring says that 'root', 'registry', and a few other attributes are added by the router. (Commit 7bd9da, lines 160-166). The Router source assigns it in line 122. ('attrs["root"])' is "request.__dict__["root"]').

[pylons-discuss] Creating a request copy?

2019-01-15 Thread Thierry Florac
Hi, Simple question: I have a use case where I need to create an exact copy (a clone) of a request, to update it's properties and make "simulations" (actually by providing custom marker interfaces) without modifying the original request. Is there a good way to do this? Actually I just tried to do