Code

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#14755 closed (invalid)

Wsgi Error

Reported by: tolano Owned by: nobody
Component: HTTP handling Version: master
Severity: Keywords: wsgi input keyerror
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I'm testing a site with latest django trunk and latest development version of django-page-cms.

When I try to add a new page, I get this error:

File "path/env/src/django-page-cms/pages/http.py", line 21, in get_request_mock
    'HTTP_HOST': 'testhost',

File "path/env/lib/python2.5/site-packages/django/core/handlers/wsgi.py", line 137, in __init__
    if type(socket._fileobject) is type and isinstance(self.environ['wsgi.input'], socket._fileobject):

KeyError: 'wsgi.input'

Attachments (0)

Change History (7)

comment:1 Changed 3 years ago by Keryn Knight <keryn@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Possibly related to ticket #14602 which resulted in changeset [14453], looking at the erro raised and the lines involved.

comment:2 Changed 3 years ago by tolano

I'm in [14677] and still not working.

comment:3 follow-up: Changed 3 years ago by Keryn Knight <keryn@…>

In an effort to rule in or out certain configurations:

  • What environment is this being run under: runserver/apache/nginx/appengine etc?
  • Are you able to replicate the problem outside of django-page-cms?
  • Have you tried rolling back to an older django revision (or stable release) to see if the problem persists?

I apologise if these seem like trite questions, or obvious things to check, but the original ticket seems to have enough unknown variables to make testing the problem onerous.

comment:4 in reply to: ↑ 3 Changed 3 years ago by tolano

Replying to Keryn Knight <keryn@kerynknight.com>:

In an effort to rule in or out certain configurations:

  • What environment is this being run under: runserver/apache/nginx/appengine etc?
  • Are you able to replicate the problem outside of django-page-cms?
  • Have you tried rolling back to an older django revision (or stable release) to see if the problem persists?

I apologise if these seem like trite questions, or obvious things to check, but the original ticket seems to have enough unknown variables to make testing the problem onerous.

I'm using Apache + modwsgi 2.5, and I wasn't able to replicate the problem outside django-page-cms.

It was working with the previous version, but I don't remember the revision.

I can't find the problem here. The enviroment says it's running in test mode using port 8000.

parth/env/src/django-page-cms/pages/http.py in get_request_mock
'HTTP_HOST': 'testhost', 

environ: {'HTTP_HOST': 'testhost', 'PATH_INFO': u'/', 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': u'', 'SERVER_NAME': 'test', 'SERVER_PORT': '8000'}

comment:5 Changed 3 years ago by Keryn Knight <keryn@…>

  • Keywords wsgi keyerror added; wski key removed

According to the svn log, beyond the change-set previously mentioned there's also [14494] & [14493]. Looking at them briefly, it seems like the regression tests in [14494] specifically provide the wsgi.input key in the environ dictionary, which is notably absent from the django-page-cms mock WSGIRequest I can see on github.

I'm not familiar enough with the WSGI code (or indeed the spec) to speak any further on the subject, but it may be well intentionally required now, in which case django-page-cms will need to catch up, and possibly the change needs to be documented (providing a note on backwards compatibility, if such is the case?)

Hopefully someone with more knowledge on the internals (russellm recently, by the looks of things) will get the opportunity to look at this.

comment:6 Changed 3 years ago by russellm

  • Resolution set to invalid
  • Status changed from new to closed

If django-page-cms is providing a mock of WSGIRequest and it doesn't provide wsgi.input, then it isn't a complete mock. PEP333 specifies that WSGI requests *must* provide a number of wsgi. environment variables, one of which is wsgi.input. Django's own test client demonstrates the minimum required set.

Closing this invalid, on the basis that it appears to be a problem in the django-page-cms test framework. If you can provide evidence to the contrary, feel free to reopen.

comment:7 Changed 3 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.