zip 1.3.1 → 1.3.2
raw patch · 3 files changed
+12/−3 lines, 3 files
Files
- CHANGELOG.md +5/−0
- Codec/Archive/Zip/Internal.hs +6/−2
- zip.cabal +1/−1
CHANGELOG.md view
@@ -1,3 +1,8 @@+## Zip 1.3.2++* Fix a bug where removing a temporary file failed in the prescence of+ async exceptions.+ ## Zip 1.3.1 * The test suite is now faster.
Codec/Archive/Zip/Internal.hs view
@@ -27,7 +27,7 @@ import Codec.Archive.Zip.Type import Conduit (PrimMonad) import Control.Applicative (many, (<|>))-import Control.Exception (bracketOnError)+import Control.Exception (bracketOnError, catchJust) import Control.Monad import Control.Monad.Catch (MonadThrow (..)) import Control.Monad.Trans.Maybe@@ -53,6 +53,7 @@ import System.Directory import System.FilePath import System.IO+import System.IO.Error (isDoesNotExistError) import qualified Data.ByteString as B import qualified Data.Conduit as C #ifdef ENABLE_BZIP2@@ -285,7 +286,10 @@ allocate = openBinaryTempFile (takeDirectory fpath) ".zip" release (path, h) = do hClose h- removeFile path+ -- Despite using `bracketOnError` the file is not guaranteed to exist here+ -- since we could be interrupted with an async exception after the file has+ -- been renamed. Therefore, we silentely ignore `DoesNotExistError`.+ catchJust (guard . isDoesNotExistError) (removeFile path) (const $ pure ()) -- | Determine what comment in new archive will look like given its original -- value and a collection of pending actions.
zip.cabal view
@@ -1,5 +1,5 @@ name: zip-version: 1.3.1+version: 1.3.2 cabal-version: 1.18 tested-with: GHC==8.4.4, GHC==8.6.5, GHC==8.8.3 license: BSD3