make test -> ValueError: flush of closed file
Output of make test on my side:
Running tests...
python3 -m tests.all
test_buffer_big (tests.channel.TestChannel.test_buffer_big) ...
Exception ignored in: <_io.BufferedWriter>
Traceback (most recent call last):
File "/usr/lib/python3.13/unittest/case.py", line 606, in _callTestMethod
if method() is not None:
ValueError: flush of closed file
ok
test_buffer_small_bidirectional (tests.channel.TestChannel.test_buffer_small_bidirectional) ...
[2025-10-15 09:23:59] [Error] Retry count exceeded on <RNS.Channel.Channel object at 0x7f4b0428b4d0>, t
earing down Link.
Exception ignored in: <_io.BufferedWriter>
Traceback (most recent call last):
File "/usr/lib/python3.13/unittest/case.py", line 606, in _callTestMethod
if method() is not None:
ValueError: flush of closed file
Is this intended?
This doesn't appear to be an issue with Reticulum, it appears to be an issue with unittest. I've not been able to locate a relevant issue for it upstream. Tests ran on versions previous to 3.13 did not fail in this fashion.
Yes, something changed in 3.13 that introduced this. It's related to exit cleanup handling, and threads trying to write to buffers after the main process has been terminated, but not sure exactly what is going on.
Probably related to freethreading (No GIL).
CPython Issue: https://github.com/python/cpython/issues/138720
Fixed here: https://github.com/python/cpython/pull/138724/files