Ticket #194 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

Cascade and environ['wsgi.input'] issue

Reported by: w31rd0 Owned by: ianb
Priority: normal Milestone: 1.5
Component: paste Version: svn-trunk
Severity: normal Keywords:
Cc:

Description

When cascading apps environ is copied but environwsgi.input? points at the same place. Hence once read, environwsgi.input? remains empty for the rest of apps in a cascade. I found this when was trying to cascade multiple Pylons apps. This probably could be solved by replacing environwsgi.input? with sort of StringIO and seek(0)-ing it before each try.

Attachments

cascade.py.diff Download (448 bytes) - added by w31rd0 4 years ago.
cascade.py.2.diff Download (385 bytes) - added by w31rd0 4 years ago.

Change History

follow-up: ↓ 2   Changed 4 years ago by ianb

  • status changed from new to closed
  • resolution set to fixed

Fixed in r7020; but there aren't any tests for paste.cascade so I'm not too confident of the fix yet :(

in reply to: ↑ 1   Changed 4 years ago by w31rd0

  • status changed from closed to reopened
  • version changed from svn-trunk to released-version
  • resolution fixed deleted
  • milestone changed from 1.4.1 to 1.5

Replying to ianb:

Fixed in r7020; but there aren't any tests for paste.cascade so I'm not too confident of the fix yet :(

Sometimes crashes with

ValueError: invalid literal for int()

at this line

length = int(environ.get('CONTENT_LENGTH', '0'))

(CONTENT_LENGTH is present in environ, but equals an empty string).

Changed 4 years ago by w31rd0

  Changed 4 years ago by w31rd0

I've attached the diff, which avoids the ValueError?.

  Changed 4 years ago by ianb

  • status changed from reopened to closed
  • resolution set to fixed

This actually was fixed a couple days ago in trunk

  Changed 4 years ago by w31rd0

  • status changed from closed to reopened
  • version changed from released-version to svn-trunk
  • resolution fixed deleted

Sorry for being so obtrusive :) But there is still a problem: environwsgi.input? doesn't get seek(0)-ed before the last app in cascade. So you probably need the following fix (I'll attach the diff).

Changed 4 years ago by w31rd0

  Changed 4 years ago by ianb

Applied in r7058

  Changed 4 years ago by ianb

  • status changed from reopened to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.