AREPL-vscode icon indicating copy to clipboard operation
AREPL-vscode copied to clipboard

different error when opening output than in python

Open Almenon opened this issue 5 years ago • 3 comments
trafficstars

Describe the bug In arepl v1.0.24 it gets the following error:

Traceback (most recent call last):
  line 1, in <module>
io.UnsupportedOperation: not writable

To Reproduce

print('hi', file=open(2))

Expected behavior

Traceback (most recent call last):
  line 1, in <module>
ValueError: Cannot open console output buffer for reading

Screenshots If applicable, add screenshots to help explain your problem.

Other Information (please complete the following information):

  • OS: Windows 10
  • Python Version: 3.8.1

Additional context Same error with file 1. Using sys.stdout will result in a error matching vanilla python as expected.

Almenon avatar May 23 '20 17:05 Almenon

If you run into this problem please comment to let me know.

Almenon avatar May 23 '20 17:05 Almenon

I have run into this in the same case; I am trying to open the stdout as a file for reading in binary mode, but I cannot using this method because of this error.

AlbieMorrison avatar Feb 28 '22 23:02 AlbieMorrison

Do you mean you're trying to open stdout as a file for writing? Stdout is for output only, it should not be read from.

Almenon avatar Mar 03 '22 16:03 Almenon