#2129: runInteractiveCommand/Process docs don't mention if handles are text or
binary
-----------------------+----------------------------------------------------
    Reporter:  duncan  |       Owner:                   
        Type:  bug     |      Status:  new              
    Priority:  normal  |   Component:  libraries/process
     Version:  6.8.2   |    Severity:  normal           
    Keywords:          |    Testcase:                   
Architecture:  x86     |          Os:  Windows          
-----------------------+----------------------------------------------------
 `runInteractiveCommand` and `runInteractiveProcess` return newly created
 `Handle`s. The haddock documentation for these actions does not specify if
 the `Handle`s are opened in text or binary mode.

 This caused at least one real-world bug where Cabal reads the output of
 `ghc-pkg describe *`, parsing it by splitting into lines. The standard
 haskell `lines` function splits on '\n' characters so we ended up with
 trailing '\r' characters. This was almost certainly because `ghc-pkg` was
 writing to stdout in text mode but Cabal was reading from the pipe in
 binary mode, presumably because currently `runInteractiveCommand` uses
 binary mode.

 We probably don't want to have two versions of the functions so perhaps
 the documentation should specify what it does now and mention
 `hSetBinaryMode` for people who want to use that.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2129>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to