[Bug 1877104] [NEW] python3 compatibility: AttributeError: 'HTTPMessage' object has no attribute 'getheaders'

Florian Wolff 1877104 at bugs.launchpad.net
Wed May 6 12:15:33 UTC 2020


Public bug reported:

Issue exists on xenial in python3-paste 1.7.5.1-6ubuntu3 which throws
exception:

   File "/usr/lib/python3/dist-packages/paste/httpserver.py", line 1068, in process_request_in_thread
     self.finish_request(request, client_address)
   File "/usr/lib/python3.5/socketserver.py", line 354, in finish_request
     self.RequestHandlerClass(request, client_address, self)
   File "/usr/lib/python3.5/socketserver.py", line 681, in __init__
     self.handle()
   File "/usr/lib/python3/dist-packages/paste/httpserver.py", line 442, in handle
     BaseHTTPRequestHandler.handle(self)
   File "/usr/lib/python3.5/http/server.py", line 422, in handle
     self.handle_one_request()
   File "/usr/lib/python3/dist-packages/paste/httpserver.py", line 437, in handle_one_request
     self.wsgi_execute()
   File "/usr/lib/python3/dist-packages/paste/httpserver.py", line 283, in wsgi_execute
     self.wsgi_setup(environ)
   File "/usr/lib/python3/dist-packages/paste/httpserver.py", line 255, in wsgi_setup
     self.wsgi_environ[key] = ','.join(self.headers.getheaders(k))
 AttributeError: 'HTTPMessage' object has no attribute 'getheaders'
 Exception in thread worker 5:
 Traceback (most recent call last):
   File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
     self.run()
   File "/usr/lib/python3.5/threading.py", line 862, in run
     self._target(*self._args, **self._kwargs)
   File "/usr/lib/python3/dist-packages/paste/httpserver.py", line 895, in worker_thread_callback
     sys.exc_clear()
 AttributeError: module 'sys' has no attribute 'exc_clear'

due to changes in python3 (3.5.2-2ubuntu0~16.04.10):
- exc_clear() call is no longer required (ref https://docs.python.org/3/whatsnew/3.0.html#index-22 )
- getheaders was renamed to get (ref https://bugs.launchpad.net/python-keystoneclient/+bug/1267987 )

** Affects: paste (Ubuntu)
     Importance: Undecided
         Status: New

** Attachment added: "Patch for /usr/lib/python3/dist-packages/paste/httpserver.py"
   https://bugs.launchpad.net/bugs/1877104/+attachment/5367322/+files/paste.patch

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to paste in Ubuntu.
https://bugs.launchpad.net/bugs/1877104

Title:
  python3 compatibility: AttributeError: 'HTTPMessage' object has no
  attribute 'getheaders'

Status in paste package in Ubuntu:
  New

Bug description:
  Issue exists on xenial in python3-paste 1.7.5.1-6ubuntu3 which throws
  exception:

     File "/usr/lib/python3/dist-packages/paste/httpserver.py", line 1068, in process_request_in_thread
       self.finish_request(request, client_address)
     File "/usr/lib/python3.5/socketserver.py", line 354, in finish_request
       self.RequestHandlerClass(request, client_address, self)
     File "/usr/lib/python3.5/socketserver.py", line 681, in __init__
       self.handle()
     File "/usr/lib/python3/dist-packages/paste/httpserver.py", line 442, in handle
       BaseHTTPRequestHandler.handle(self)
     File "/usr/lib/python3.5/http/server.py", line 422, in handle
       self.handle_one_request()
     File "/usr/lib/python3/dist-packages/paste/httpserver.py", line 437, in handle_one_request
       self.wsgi_execute()
     File "/usr/lib/python3/dist-packages/paste/httpserver.py", line 283, in wsgi_execute
       self.wsgi_setup(environ)
     File "/usr/lib/python3/dist-packages/paste/httpserver.py", line 255, in wsgi_setup
       self.wsgi_environ[key] = ','.join(self.headers.getheaders(k))
   AttributeError: 'HTTPMessage' object has no attribute 'getheaders'
   Exception in thread worker 5:
   Traceback (most recent call last):
     File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
       self.run()
     File "/usr/lib/python3.5/threading.py", line 862, in run
       self._target(*self._args, **self._kwargs)
     File "/usr/lib/python3/dist-packages/paste/httpserver.py", line 895, in worker_thread_callback
       sys.exc_clear()
   AttributeError: module 'sys' has no attribute 'exc_clear'

  due to changes in python3 (3.5.2-2ubuntu0~16.04.10):
  - exc_clear() call is no longer required (ref https://docs.python.org/3/whatsnew/3.0.html#index-22 )
  - getheaders was renamed to get (ref https://bugs.launchpad.net/python-keystoneclient/+bug/1267987 )

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/paste/+bug/1877104/+subscriptions



More information about the foundations-bugs mailing list