← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1795425] [NEW] create server api sends location header as bytestring in py3

 

Public bug reported:

PEP 3333 points out that request and response headers, inside a WSGI
application, should be native strings. That is: whatever `str` is in the
version of Python being used:
https://www.python.org/dev/peps/pep-3333/#a-note-on-string-types

The create server api returns a location header which is encoded to
UTF-8 in python, making it a bytestring in python3. This violates the
spec but also leads to issues when testing nova under wsgi-intercept
(which removes whatever normalisation most WSGI servers helpfully do for
"bad" applications). The issues show up when concatenating the response
header with other values, such as base URLs.

** Affects: nova
     Importance: Undecided
     Assignee: Chris Dent (cdent)
         Status: In Progress


** Tags: api

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1795425

Title:
  create server api sends location header as bytestring in py3

Status in OpenStack Compute (nova):
  In Progress

Bug description:
  PEP 3333 points out that request and response headers, inside a WSGI
  application, should be native strings. That is: whatever `str` is in
  the version of Python being used:
  https://www.python.org/dev/peps/pep-3333/#a-note-on-string-types

  The create server api returns a location header which is encoded to
  UTF-8 in python, making it a bytestring in python3. This violates the
  spec but also leads to issues when testing nova under wsgi-intercept
  (which removes whatever normalisation most WSGI servers helpfully do
  for "bad" applications). The issues show up when concatenating the
  response header with other values, such as base URLs.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1795425/+subscriptions


Follow ups