#3379·trio

trio.wrap_file() undocumented behavior wrt to sync file object

Author: NikratioCreated Jan 18, 2026Updated Aug 26, 2026
Labelsdocs

Hello,

Looking at https://trio.readthedocs.io/en/stable/reference-io.html#trio.wrap_file, it is not clear to me if:

  • Closing the returned async file object will also close the sync file object that I passed in
  • Whether this will happen automatically when the async file object is garbage collected
  • If I can continue to use the sync file object at the same time.

It'd be great if that could be clarified!