← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2031635] Re: Unit tests fail due to unsupported .removeprefix() in python 3.7

 

** Also affects: nova/yoga
   Importance: Undecided
       Status: New

** Also affects: nova/zed
   Importance: Undecided
       Status: New

-- 
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/2031635

Title:
  Unit tests fail due to unsupported .removeprefix() in python 3.7

Status in OpenStack Compute (nova):
  Confirmed
Status in OpenStack Compute (nova) yoga series:
  New
Status in OpenStack Compute (nova) zed series:
  New

Bug description:
  Description
  ===========
  When running unit tests on python3.7 two tests fail:
  nova.tests.unit.console.test_websocketproxy.NovaProxyRequestHandlerBaseTestCase.test_reject_open_redirect
  nova.tests.unit.console.test_websocketproxy.NovaProxyRequestHandlerBaseTestCase.test_reject_open_redirect_3_slashes

  
  Steps to reproduce
  ==================
  Checkout to latest stable/train as of 17.08.2023
  $ tox -e py37 

  
  Expected result
  =============
  All unit tests pass

  
  Actual result
  =============
  `Captured traceback:
  ~~~~~~~~~~~~~~~~~~~
      b'Traceback (most recent call last):'
      b'  File "/builds/nfv-platform/nova/nova/tests/unit/console/test_websocketproxy.py", line 678, in test_reject_open_redirect'
      b"    location = location.removeprefix('Location: ').rstrip('\\r\\n')"
      b"AttributeError: 'str' object has no attribute 'removeprefix'"
      b''`

  `Captured traceback:
  ~~~~~~~~~~~~~~~~~~~
      b'Traceback (most recent call last):'
      b'  File "/builds/nfv-platform/nova/nova/tests/unit/console/test_websocketproxy.py", line 685, in test_reject_open_redirect_3_slashes'
      b"    self.test_reject_open_redirect(url='///example.com/%2F..')"
      b'  File "/builds/nfv-platform/nova/nova/tests/unit/console/test_websocketproxy.py", line 678, in test_reject_open_redirect'
      b"    location = location.removeprefix('Location: ').rstrip('\\r\\n')"
      b"AttributeError: 'str' object has no attribute 'removeprefix'"
      b''`

  Environment
  ===========
  Python version 3.7.17

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