From: Thomas Kluyver Date: Wed, 6 May 2026 10:16:36 +0000 (+0100) Subject: Replace deprecated pycurl IOCTLFUNCTION callback with SEEKFUNCTION X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5723fc54a765caf6dd601fdbcea1c36cd107158b;p=thirdparty%2Ftornado.git Replace deprecated pycurl IOCTLFUNCTION callback with SEEKFUNCTION --- diff --git a/tornado/curl_httpclient.py b/tornado/curl_httpclient.py index ecaf1379..82f739b5 100644 --- a/tornado/curl_httpclient.py +++ b/tornado/curl_httpclient.py @@ -487,12 +487,12 @@ class CurlAsyncHTTPClient(AsyncHTTPClient): raise ValueError("Body must be None for GET request") request_buffer = BytesIO(utf8(request.body or "")) - def ioctl(cmd: int) -> None: - if cmd == curl.IOCMD_RESTARTREAD: # type: ignore - request_buffer.seek(0) + def seek(offset: int, origin: int) -> int: + request_buffer.seek(offset, origin) + return pycurl.SEEKFUNC_OK curl.setopt(pycurl.READFUNCTION, request_buffer.read) - curl.setopt(pycurl.IOCTLFUNCTION, ioctl) + curl.setopt(pycurl.SEEKFUNCTION, seek) if request.method == "POST": curl.setopt(pycurl.POSTFIELDSIZE, len(request.body or "")) else: