Skip to content

Replace Cookie with http.cookies when using Py3 #421

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

Closed
wants to merge 2 commits into from

Conversation

GuillaumeDerval
Copy link

@GuillaumeDerval GuillaumeDerval commented May 16, 2017

A part of web.py still uses Cookie which has been renamed as http.cookies in Py3, leading to an exception when calling this particular part of the code.

From INGInious/INGInious#208 :

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/web/wsgiserver/wsgiserver3.py", line 1089, in communicate
    req.respond()
  File "/usr/local/lib/python3.5/dist-packages/web/wsgiserver/wsgiserver3.py", line 877, in respond
    self.server.gateway(self).respond()
  File "/usr/local/lib/python3.5/dist-packages/web/wsgiserver/wsgiserver3.py", line 1980, in respond
    response = self.req.server.wsgi_app(self.env, self.start_response)
  File "/usr/local/lib/python3.5/dist-packages/inginious/common/log.py", line 47, in __call__
    return self.app(environ, xstart_response)
  File "/usr/local/lib/python3.5/dist-packages/inginious/frontend/common/static_middleware.py", line 64, in __call__
    return self.app(environ, start_response)
  File "/usr/local/lib/python3.5/dist-packages/web/application.py", line 295, in wsgi
    result = self.handle_with_processors()
  File "/usr/local/lib/python3.5/dist-packages/web/application.py", line 267, in handle_with_processors
    return process(self.processors)
  File "/usr/local/lib/python3.5/dist-packages/web/application.py", line 264, in process
    raise self.internalerror()
  File "/usr/local/lib/python3.5/dist-packages/web/application.py", line 545, in internalerror
    return debugerror()
  File "/usr/local/lib/python3.5/dist-packages/web/debugerror.py", line 313, in debugerror
    return web._InternalError(djangoerror())
  File "/usr/local/lib/python3.5/dist-packages/web/debugerror.py", line 303, in djangoerror
    return t(exception_type, exception_value, frames)
  File "/usr/local/lib/python3.5/dist-packages/web/template.py", line 904, in __call__
    return BaseTemplate.__call__(self, *a, **kw)
  File "/usr/local/lib/python3.5/dist-packages/web/template.py", line 831, in __call__
    return self.t(*a, **kw)
  File "/usr/local/lib/python3.5/dist-packages/web/debugerror.py", line 196, in __template__
    </ul>
  File "/usr/local/lib/python3.5/dist-packages/web/webapi.py", line 487, in cookies
    ctx._parsed_cookies = parse_cookies(http_cookie)
  File "/usr/local/lib/python3.5/dist-packages/web/webapi.py", line 447, in parse_cookies
    cookie = Cookie.SimpleCookie()
NameError: name 'Cookie' is not defined

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@GuillaumeDerval
Copy link
Author

Duplicate of #419; sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant