Skip to content

io.UnsupportedOperation: can't do nonzero cur-relative seeks #122

@dbergamin

Description

@dbergamin

When doing PUT/POST this seems to run into an issue on Python 3 where streams are functioning slightly differently.

File "/home/db/development/test/lib/python3.8/site-packages/requests/sessions.py", line 512, in request
    resp = self.send(prep, **send_kwargs)
File "/home/db/development/test/lib/python3.8/site-packages/requests/sessions.py", line 629, in send
    r = dispatch_hook('response', hooks, r, **kwargs)
File "/home/db/development/test/lib/python3.8/site-packages/requests/hooks.py", line 31, in dispatch_hook
    _hook_data = hook(hook_data, **kwargs)
File "/home/db/development/pydev/mav_requests_ntlm/requests_ntlm.py", line 149, in response_hook
    return self.retry_using_http_NTLM_auth(
File "/home/db/development/pydev/mav_requests_ntlm/requests_ntlm.py", line 65, in retry_using_http_NTLM_auth
    response.request.body.seek(-content_length, 1)
io.UnsupportedOperation: can't do nonzero cur-relative seeks

Tested with 3.6 and 3.8, using requests_ntlm module to send a PUT or POST request:

        url = http://mysite.example.com/creatething"
        data = open('data.json')
        response = requests.put(url, headers=headers, data=data, auth=HttpNtlmAuth('DOMAIN\\" + self._username,self._password))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions