encodeWith and decodeWith use try @SomeException to catch all exceptions that may arise while dealing with C buffers.
See for instance
|
r <- try @SomeException $ GHC.withCStringLen enc str $ \cstr -> WindowsString <$> BS8.packCStringLen cstr |
This is incorrect, as asynchronous exceptions thrown to such code (for instance using killThread or ^C) should not result in a EncodingException.
The simplest way to fix it is to see if the exception is SomeAsyncException and if so reraise it.
See also https://gitlab.haskell.org/ghc/ghc/-/issues/25479
encodeWithanddecodeWithusetry @SomeExceptionto catch all exceptions that may arise while dealing with C buffers.See for instance
os-string/System/OsString/Common.hs
Line 239 in 06a9edc
This is incorrect, as asynchronous exceptions thrown to such code (for instance using
killThreador^C) should not result in aEncodingException.The simplest way to fix it is to see if the exception is
SomeAsyncExceptionand if so reraise it.See also https://gitlab.haskell.org/ghc/ghc/-/issues/25479