Skip to content

Replace deprecated pycurl IOCTLFUNCTION callback with SEEKFUNCTION#3617

Merged
bdarnell merged 2 commits into
tornadoweb:masterfrom
takluyver:pycurl-seekfunction
May 7, 2026
Merged

Replace deprecated pycurl IOCTLFUNCTION callback with SEEKFUNCTION#3617
bdarnell merged 2 commits into
tornadoweb:masterfrom
takluyver:pycurl-seekfunction

Conversation

@takluyver
Copy link
Copy Markdown
Contributor

Tests were failing with pycurl 7.46 because of a deprecationwarning with IOCTLFUNCTION. The suggested replacement is SEEKFUNCTION.

@takluyver
Copy link
Copy Markdown
Contributor Author

In the second commit, the recommendation in curl's docs is to replace socket_all() with socket_action(), but I'm guessing a bit as to how exactly that should work; I'm not very familiar with (py)curl.

@bdarnell
Copy link
Copy Markdown
Member

bdarnell commented May 6, 2026

First commit looks good, thanks!

For the second commit, the use of socket_all instead of socket_timeout was originally deliberate. In 2010 there were bugs in which libcurl's internal timeout bookkeeping would lose track of a socket, and so we put in a periodic call to socket_all to force it to check everything again. Calling socket_action(SOCKET_TIMEOUT) is already done in handle_timeout, so doing it again in handle_force_timeout is redundant (assuming this logic in handle_timeout to handle differences between clock implementations is doing its job).

I think at this point I'm comfortable deleting everything related to force_timeout here. In 2010 we were kind of on the cutting edge of async libcurl usage and would run into a lot of bugs. But since then, aside from the general increasing maturity of libcurl, it's also been through a major refactoring (in 2013) so that the synchronous interfaces are implemented in terms of the async ones, so that class of bugs is less likely to go unnoticed.

@takluyver takluyver force-pushed the pycurl-seekfunction branch from 91d4abe to a7f5d6a Compare May 6, 2026 14:28
@takluyver
Copy link
Copy Markdown
Contributor Author

Makes sense, thanks. I've replaced that commit with one removing the force_timeout mechanism.

@bdarnell bdarnell merged commit 8750851 into tornadoweb:master May 7, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants