IronLanguages / IronLanguages/ironpython3
Console.SetOut does not output print statement output
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.8k
- Forks
- 316
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 1
Description
Prerequisites
The issue tracker is used to report bugs and request new features, NOT to ask questions.
Questions should be posted to the users mailing list which can be accessed at
https://ironpython.groups.io/g/users.
- [ X ] Are you running the latest version?
- Are you reporting to the correct repository?
- Did you perform a cursory search?
Description
Am using IronPython 3.4.0-alpha on c# Visual Studio project. Was previously using 2.7.9 and using RedirectToConsole() to and then setting Console.SetOut to a text writer. This used to print the output of a print statment. That now print nothing at all but no errors are generated.
Steps to Reproduce
- Redirect output to console with Engine.Runtime.IO.RedirectToConsole
- Set console output to text writer with Console.SetOut(TextWriter.Synchronized(writer [writer is a TextWriter instance])
- Send the python string print("Hello").
- Nothing appears in the TextWriter object.
Expected behavior:
Hello should have been printed in the TextWriter.
Actual behavior:
Nothing appeared in the TextWriter. This exact same code works correctly in 2.7.9.
Versions
3.4.0-alpha
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
Start with the interaction between Engine.Runtime.IO.RedirectToConsole, Console.SetOut, and the TextWriter used in the reproduction. Run the stated print("Hello") sequence on IronPython 3.4.0-alpha and compare it with 2.7.9. Done means Python print output reaches the configured TextWriter without errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100