Python3 reports an error [errno 5] input / output error. Print is used when there is no stdout

Process description
Shortly after, I wrote a project with Tornado that was supposed to be deployed on Nginx, but for some reason the company didn’t use Nginx and started it directly from the command line
When I boot from the command line, it is normally accessible

python start.py &

However, when I close the remote SSH connection, the program is out of order, nothing happens, but the process is sitting in the process pool waiting for the CPU to call. By try catch the exception [Errno 5] Input/output error
After checking, the problem was found, because I had print statement in the program. When I quit the remote SSH, it was equivalent to closing its shell. Without shell process print, there was no place to output characters and could not “write” to the screen, so I would report a I/O error
The solution

    does not use the command line to start, put the program into crontab to start regularly or delete the program where there are print statements in the program, use nohup to run the command permanently, it has nothing to do with the user terminal, disconnection of SSH will not affect the program to run

 

Read More: