Skip to content

urllib new version v2.6.0 breaks the RESTResponse #16

@ogeber-pass

Description

@ogeber-pass

Hello,

in the latest version of urllib (v.2.6.0) the getheaders() method has been replaced with headers() (see here)

This dependency update breaks the following lines

I guess the fix would be something like

class RESTResponse(io.IOBase):

    def __init__(self, resp):
        self.urllib3_response = resp
        self.status = resp.status
        self.reason = resp.reason
        self.data = resp.data

    def getheaders(self):
        """Returns a dictionary of the response headers."""
        return self.urllib3_response.headers()

    def getheader(self, name, default=None):
        """Returns a given response header."""
        return self.urllib3_response.headers.get(name, default)

I would be glad to contribute but i didn't manage to run tests locally to check it didn't break other part of the code, so I didn't push my branch

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions