Skip to content

Fix API.request_url() with Py3.13 (#208)

Moul requested to merge 208_fix_request_url into main

Since Python 3.13, the IOBase finalizer now logs any errors raised by the close() method https://docs.python.org/3/whatsnew/3.13.html#io

According to https://docs.python.org/3.13/library/io.html#io.IOBase.close if the file (descriptor) is accessed after being close, ValueError is raised.

The fd is copied with copy.copy(). Both gets automatically closed once the function ends, the second can’t close a second time the same fd, that’s why we get this error.

Not sure if there is a use case with the fd copy Fix: remove fd copy

Close #208.

Edited by Moul

Merge request reports