`ValueError: I/O operation on closed file` when I exit REPL
See original GitHub issue$ python -V
Python 3.8.8
$ ptpython --version
3.0.18
$ ptpython
>>> exit()
Traceback (most recent call last):
File "/home/eggplants/.pyenv/versions/3.8.8/bin/ptpython", line 8, in <module>
sys.exit(run())
File "/home/eggplants/.pyenv/versions/3.8.8/lib/python3.8/site-packages/ptpython/entry_points/run_ptpython.py", line 207, in run
embed(
File "/home/eggplants/.pyenv/versions/3.8.8/lib/python3.8/site-packages/ptpython/repl.py", line 720, in embed
repl.run()
File "/home/eggplants/.pyenv/versions/3.8.8/lib/python3.8/site-packages/ptpython/repl.py", line 135, in run
text = self.read()
File "/home/eggplants/.pyenv/versions/3.8.8/lib/python3.8/site-packages/ptpython/python_input.py", line 1045, in read
result = self.app.run(pre_run=pre_run, in_thread=True)
File "/home/eggplants/.pyenv/versions/3.8.8/lib/python3.8/site-packages/prompt_toolkit/application/application.py", line 874, in run
raise exception
File "/home/eggplants/.pyenv/versions/3.8.8/lib/python3.8/site-packages/prompt_toolkit/application/application.py", line 855, in run_in_thread
result = self.run(
File "/home/eggplants/.pyenv/versions/3.8.8/lib/python3.8/site-packages/prompt_toolkit/application/application.py", line 891, in run
return loop.run_until_complete(
File "/home/eggplants/.pyenv/versions/3.8.8/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/home/eggplants/.pyenv/versions/3.8.8/lib/python3.8/site-packages/prompt_toolkit/application/application.py", line 816, in run_async
return await _run_async2()
File "/home/eggplants/.pyenv/versions/3.8.8/lib/python3.8/site-packages/prompt_toolkit/application/application.py", line 792, in _run_async2
result = await _run_async()
File "/home/eggplants/.pyenv/versions/3.8.8/lib/python3.8/site-packages/prompt_toolkit/application/application.py", line 721, in _run_async
with self.input.raw_mode(), self.input.attach(
File "/home/eggplants/.pyenv/versions/3.8.8/lib/python3.8/site-packages/prompt_toolkit/input/vt100.py", line 129, in raw_mode
return raw_mode(self.stdin.fileno())
ValueError: I/O operation on closed file
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Using exit(), I get "ValueError: I/O operation on closed file."
I am learning Python and while trying to build an authenticator (login), I came upon this error. credentials = { "Peter" : "123",...
Read more >ValueError: I/O operation on closed file in Python | bobbyhadz
The Python "ValueError: I/O operation on closed file" occurs when we try to perform an operation on a closed file. To solve the...
Read more >Python ValueError: I/O operation on closed file Solution
The “ValueError : I/O operation on closed file” error is raised when you try to read from or write to a file that...
Read more >Pexpect 3.3 documentation - Read the Docs
'''Pexpect is a Python module for spawning child applications and controlling them automatically. Pexpect can be used for automating interactive ...
Read more >Digging Simulator - Replit
ValueError : I/O operation on closed file. During handling of the above exception, another exception occurred: Traceback (most recent call last):
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I pushed a new release to PyPI, so you should also be able to get it from there. Thanks for testing!
@jonathanslenders It seems to work well. Thank you so much…!