Skip to content

Fix base/System.IO.withFile to only annotate own exceptions

Sebastian Nagel requested to merge ch1bo/ghc:fix-base-with-file into master

This MR fixes #20886 by making withFile and withFileBlocking in base not annotate IOExceptions raised by the enclosing code.

  • Not sure if this change would break any user code. If it does, they have been relying on withFile obfuscating errors.

  • Added a changelog entry to libraries/base/changelog.md, but not on any GHC release notes yet as I don't know what releases are planned.

  • I'd be happy to backport this to any version to be released next.


Checklist:

  • if your MR may break existing programs (e.g. touches base or causes the compiler to reject programs), please describe the expected breakage and add the user-facing label. This will run ghc/head.hackage> to characterise the effect of your change on Hackage.
  • ensure that your commits are either individually buildable or squashed
  • ensure that your commit messages describe what they do (referring to tickets using #NNNN syntax when appropriate)
  • have added source comments describing your change
  • add a [testcase to the testsuite][adding test].
  • updates the users guide if applicable
  • mentions new features in the release notes for the next release

Merge request reports