Skip to content

NUL (/dev/null) not always enabled on Windows #9023

Description

@codewarrior0

Python 2.7.9, IPython 4.0.0

I got an error report from a user that indicates a File Not Found when opening the null device:

  File "[virtualenv]\lib\site-packages\IPython\__init__.py", line 47, in <module>  
  File "[virtualenv]\lib\site-packages\IPython\core\application.py", line 24, in <module>
  File "[virtualenv]\lib\site-packages\IPython\core\crashhandler.py", line 28, in <module>
  File "[virtualenv]\lib\site-packages\IPython\core\ultratb.py", line 110, in <module>
  File "[virtualenv]\lib\site-packages\IPython\core\debugger.py", line 37, in <module>
  File "[virtualenv]\lib\site-packages\IPython\utils\io.py", line 75, in <module>
IOError: [Errno 2] No such file or directory: 'nul'

The faulting line is devnull = open(os.devnull, 'w') where os.devnull == "nul"

Some googling turns up the fact that nul, which is the MS-DOS era null device, is a Windows virtual device that can be disabled via Device Manager.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions