Skip to content

runMigrationSilent stomps on the encoding of stderr handle #474

@joeyh

Description

@joeyh

This transcript shows a really strange side effect, and surely it's a bug this happens:

*Database.Fsck Database.Handle> hSetEncoding stderr utf16
*Database.Fsck Database.Handle> hGetEncoding stderr
Just UTF-16
*Database.Fsck Database.Handle> initDb "/tmp/testdb" $ void $ runMigrationSilent  migrateFsck 
*Database.Fsck Database.Handle> hGetEncoding stderr
Just UTF-8

stdout's encoding is not effected, only stderr.

I'm using persistent-2.1.6 and persistent-sqlite-2.1.4.2, with ghc 7.8.4.

In case it matters somehow, here's the TH code that generated the migration:

share [mkPersist sqlSettings, mkMigrate "migrateFsck"] [persistLowerCase|
  Fscked
    key SKey
    UniqueKey key
  |]
newtype SKey = SKey String
    deriving (Show, Read)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions