ish-app / ish

Linux shell for iOS
https://ish.app
Other
17.08k stars 907 forks source link

Python can’t access /dev/null #1349

Open econcz opened 3 years ago

econcz commented 3 years ago

Any ideas what goes wrong? I can see /dev/null in the /dev folder. The problem appears in imported Docker containers only (consult the Wiki).

from IPython.utils import io
File "/usr/lib/python3.8/site-packages/IPython/utils/io.py", line 87, in <module>
devnull = open(os.devnull, 'w')
OSError: [Errno 6] No such device or address: '/dev/null'
econcz commented 3 years ago

I found a surprising but working solution, hopefully it doesn’t damage anything:

rm /dev/null
62f commented 3 years ago

That crazy workaround is an extremely shocking discovery! I wonder where python decided is the new backup function to handle things needing input to/from a black hole? Deletion might break /dev/location > to keep iSH alive, but /dev/null can easily be recreated with a command (not as easy as a deceptively-simple touch /dev/null).

gitdev-bash commented 3 years ago

/dev/null is a device that Manny Programs and the OS use as a dependency. I wouldn't remove it since it could make the system unstable. But it is strange that Python can't find /dev/null. But you can try to remove and then recreate /dev/null.

sdhoward commented 3 years ago

The problem appears in imported Docker containers only

Would you please supply the Dockerfile or the docker registry link so that we can follow the same steps?

Also, please show ls -l /dev/null of the node, prior to running rm /dev/null.