IronLanguages / IronLanguages/ironpython3
FileIO, BufferedWriter left unflushed when ipy exits
Open
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.8k
- Forks
- 316
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 1
Description
- Running the following code with
ipy, will get an empty filetest.txt, while with CPython, the file will have one byte 'a'
import io
out = io.FileIO('test.txt', 'w')
out.write(b'a')
- Similar case but using
BufferedWriter:
import io
out = io.TextIOWrapper(io.BufferedWriter(io.FileIO('test.txt', 'w')))
out.write('a')
- Case involving stdio:
The following powershell command output nothing,
PS C:\Users\james\proj\ironpython3> .\bin\Debug\netcoreapp3.1\ipy.exe -c "import sys;sys.stdout.write('text')"
PS C:\Users\james\proj\ironpython3>
and the following powershell command could output the "text"
PS C:\Users\james\proj\ironpython3> .\bin\Debug\netcoreapp3.1\ipy.exe -c "import sys;sys.stdout.write('text\n')"
text
PS C:\Users\james\proj\ironpython3>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the FileIO, BufferedWriter/TextIOWrapper, and stdout examples with ipy and compare their behavior with CPython. Trace the process-exit handling for these streams; done means pending file and standard-output data is emitted when ipy exits, including data without a trailing newline.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, python
- Domain
- backend, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100