Same environ cannot be used twice for WikkidApp

Bug #1014939 reported by Sam Bailey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Wikkid Wiki
New
Undecided
Unassigned

Bug Description

After an environ has already had its path_info shifted in WikkidApp.preprocess_environ, it will get stuck inside the while loop if that same environ is then sent back into preprocess_environ.
For example, calling

app.get_view(environ)
app(environ, self.start_response)

will result in an infinite loop.

Revision history for this message
Tim Penhey (thumper) wrote : Re: [Bug 1014939] [NEW] Same environ cannot be used twice for WikkidApp

On Tue 19 Jun 2012 15:37:31 NZST, Sam Bailey wrote:
> Public bug reported:
>
> After an environ has already had its path_info shifted in WikkidApp.preprocess_environ, it will get stuck inside the while loop if that same environ is then sent back into preprocess_environ.
> For example, calling
>
> app.get_view(environ)
> app(environ, self.start_response)
>
> will result in an infinite loop.

Yes...

I'm wondering if the wsgi spec allows copying of the environ.

Why are you doing this anyway?

Revision history for this message
Sam Bailey (yeliabmas) wrote :

I'm no longer using that specific example.

I am still calling preprocess_environ on the environ though in order to get a path, which is then used to determine if I send the request to the WikkidApp or carry on and get a view for it, both of which end up using that environ again.

As a temporary fix, yes I was copying the environ. It seems there should be a nicer way though

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.