File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ dependencies:
19
19
- bytestring
20
20
- process >=1.2
21
21
- stm
22
+ - text
22
23
- transformers
23
24
- unliftio-core
24
25
Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ import qualified Data.ByteString.Lazy as L
26
26
import qualified Data.ByteString.Lazy.Char8 as L8
27
27
import Data.String (IsString (fromString ))
28
28
import Control.Monad.IO.Unlift
29
+ import qualified Data.Text.Encoding.Error as TEE
30
+ import qualified Data.Text.Lazy as TL
31
+ import qualified Data.Text.Lazy.Encoding as TLE
29
32
30
33
#if MIN_VERSION_process(1, 4, 0) && !WINDOWS
31
34
import System.Posix.Types (GroupID , UserID )
@@ -620,11 +623,13 @@ instance Show ExitCodeException where
620
623
, show (eceProcessConfig ece) { pcEnv = Nothing }
621
624
, if L. null (eceStdout ece)
622
625
then " "
623
- else " Standard output:\n\n " ++ L8. unpack (eceStdout ece)
626
+ else " Standard output:\n\n " ++ unpack (eceStdout ece)
624
627
, if L. null (eceStderr ece)
625
628
then " "
626
- else " Standard error:\n\n " ++ L8. unpack (eceStderr ece)
629
+ else " Standard error:\n\n " ++ unpack (eceStderr ece)
627
630
]
631
+ where
632
+ unpack = TL. unpack . TLE. decodeUtf8With TEE. lenientDecode
628
633
629
634
-- | Wrapper for when an exception is thrown when reading from a child
630
635
-- process, used by 'byteStringOutput'.
You can’t perform that action at this time.
0 commit comments