From ceb091759987b0e860bb5e3733bfdb9e22986bc6 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 1 Jul 2026 13:09:47 +0200 Subject: [PATCH] Ensure that IO error messages go to stderr. Closes #11710. --- src/Text/Pandoc/Error.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Error.hs b/src/Text/Pandoc/Error.hs index fa4994cd0..bdfef1e8c 100644 --- a/src/Text/Pandoc/Error.hs +++ b/src/Text/Pandoc/Error.hs @@ -26,7 +26,7 @@ import Data.Text (Text) import qualified Data.Text as T import GHC.Generics (Generic) import System.Exit (ExitCode (..), exitWith) -import System.IO (stderr) +import System.IO (stderr, hPutStrLn) import qualified Text.Pandoc.UTF8 as UTF8 import Text.Printf (printf) import Text.Pandoc.Shared (tshow) @@ -161,7 +161,7 @@ handleError (Right r) = return r handleError (Left e) = case e of PandocIOError _ err' -> do - putStrLn $ displayException err' + hPutStrLn stderr $ displayException err' exitWith (ExitFailure 1) _ -> err exitCode (renderError e) where