From 4b9c78f1ce4c49956dc29cc2eeeadce315ad55fd Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 14 Feb 2024 22:17:26 -0800 Subject: PDF: avoid readFileLazy. My hunch is that this is causing improperly cleaned up temp directory on Windows (#9460), but this will have to be confirmed. --- src/Text/Pandoc/PDF.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Text/Pandoc/PDF.hs b/src/Text/Pandoc/PDF.hs index a684eebd2..ccde52c39 100644 --- a/src/Text/Pandoc/PDF.hs +++ b/src/Text/Pandoc/PDF.hs @@ -58,7 +58,7 @@ import Data.List (intercalate) #endif import Data.List (isPrefixOf, find) import Text.Pandoc.Class (fillMediaBag, getVerbosity, setVerbosity, - readFileLazy, readFileStrict, fileExists, + readFileStrict, fileExists, report, extractMedia, PandocMonad, runIOorExplode) import Text.Pandoc.Logging import Text.DocTemplates ( FromContext(lookupContext) ) @@ -384,7 +384,7 @@ getResultingPDF logFile pdfFile = do Just logFile' -> do logExists <- fileExists logFile' if logExists - then Just <$> readFileLazy logFile' + then Just . BL.fromStrict <$> readFileStrict logFile' else return Nothing Nothing -> return Nothing return (log', pdf) @@ -424,7 +424,7 @@ runTeXProgram program args tmpDir = do let logFile = replaceExtension file ".log" logExists <- fileExists logFile logContents <- if logExists - then readFileLazy logFile + then BL.fromStrict <$> readFileStrict logFile else return mempty let rerunWarnings = checkForRerun logContents tocHash <- do @@ -432,7 +432,7 @@ runTeXProgram program args tmpDir = do tocFileExists <- fileExists tocFile if tocFileExists then do - tocContents <- readFileLazy tocFile + tocContents <- BL.fromStrict <$> readFileStrict tocFile pure $ Just $! sha1 tocContents else pure Nothing -- compare hash of toc to former hash to see if it changed (#9295) -- cgit v1.2.3