python-trio / python-trio/trio

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

Open Beginner friendly
#3,379 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

docs
Dominant language
Python
Stars
7.3k
Forks
431
Avg merge
2d 17h
Merged PRs (30d)
6

Description

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!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the reference-io documentation entry for trio.wrap_file. Check the wrap_file behavior and document what happens when the returned async file is closed or garbage-collected, and whether the original synchronous file can still be used. Done means the three questions in the issue are answered clearly in that reference entry.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.