You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
trio.wrap_file() undocumented behavior wrt to sync file object #3379
Looking at the code (so actually testing these behaviors may show I'm wrong), I believe this is yes, no, yes.
I think the 1st and 3rd are somewhat implied by the docs talking about this being a wrapper (... it basically just sends sync ops to a thread pool) but we could definitely be more explicit about the implications of that. And also more explicit about where we diverge from standard behavior, like not having a destructor.
changed the title [-]trip.wrap_file() undocumented behavior wrt to sync file object[/-][+]trio.wrap_file() undocumented behavior wrt to sync file object[/+]on Aug 26, 2026
Activity
A5rocks commentedon Jan 18, 2026
Looking at the code (so actually testing these behaviors may show I'm wrong), I believe this is yes, no, yes.
I think the 1st and 3rd are somewhat implied by the docs talking about this being a wrapper (... it basically just sends sync ops to a thread pool) but we could definitely be more explicit about the implications of that. And also more explicit about where we diverge from standard behavior, like not having a destructor.
nightcityblade commentedon Apr 13, 2026
Hi, I'd like to work on this. I'll submit a PR shortly.
Document wrap_file behavior regarding close, GC, and concurrent access
[-]trip.wrap_file() undocumented behavior wrt to sync file object[/-][+]trio.wrap_file() undocumented behavior wrt to sync file object[/+]