behaviour change in getDirectoryContents in GHC 7.2?

Max Bolingbroke batterseapower at
Tue Nov 1 19:43:53 CET 2011

Hi John,

On 1 November 2011 17:14, John Millikin <jmillikin at> wrote:
> GHC 7.2 assumes Linux/BSD paths are text, which 1) silently breaks all
> existing code and 2) makes it impossible to fix within the given API.

Please can you give an example of code that is broken with the new
behaviour? The PEP 383 mechanism will unavoidably break *some* code
but I don't expect there to be much of it. One thing that most likely
*will* be broken is code that attempts to reinterpret a String as a
"byte string" - i.e. assuming that it was decoded using latin1, but I
expect that such code can just be deleted when you upgrade to 7.2.

As I pointed out earlier in the thread you can recover the old
behaviour if you really want it by manually reencoding the strings, so
I would dispute the claim that it is "impossible to fix within the
given API".


More information about the Glasgow-haskell-users mailing list