hspec / silently

Prevent or capture output to stdout or other handles in Haskell
Other
21 stars 5 forks source link

Windows error: cannot open NUL #7

Closed snoyberg closed 2 years ago

snoyberg commented 5 years ago

I've only seen this recently, so I think it may be an interaction with newer GHCs. Running the following on Windows and GHC 8.6.5 fails:

#!/usr/bin/env stack
-- stack --resolver lts-13.28 script
import System.IO.Silently

main :: IO ()
main = silence $ pure ()

Error message:

Main.hs: NUL: openFile: does not exist (No such file or directory)

This does not occur with GHC 8.2.2. Still testing on 8.4.4.

By seeming complete happenstance, I merged a PR recently which instead uses \\.\NUL. I can test that out next and open a PR.

snoyberg commented 5 years ago

Confirmed that it does not error on GHC 8.4.4.

andreasabel commented 2 years ago

Presumably fixed by: