hledger-web doesn't work with stdin via -f - #202

simonmichael opened this Issue Sep 5, 2014 · 1 comment


None yet

1 participant


hledger-web -f - probably should work, as with hledger.

@simonmichael simonmichael modified the milestone: 0.24 Sep 14, 2014
@simonmichael simonmichael modified the milestone: 1.0, 0.24 May 19, 2015
@simonmichael simonmichael modified the milestone: 1.0, 0.27 Sep 3, 2015

Here's an example:

$ /Users/simon/src/hledger/.stack-work/install/x86_64-osx/lts-3.0/7.10.2/bin/hledger-web --file=- <sample.journal 
Starting web app on port 5000 with base url http://localhost:5000
Starting web browser if possible
Web app will auto-exit after a few minutes with no browsers (or press ctrl-c)
26/Sep/2015:16:35:57 -1000 [Error#yesod-core] <stdin>: hGetContents: illegal operation (handle is closed) @(yesod_IuLUrNVwUaBI1Ov5JfnWBS:Yesod.Core.Class.Yesod ./Yesod/Core/Class/Yesod.hs:577:5)
26/Sep/2015:16:35:57 -1000 [Error#yesod-core] Error handler errored out: InternalError "<stdin>: hGetContents: illegal operation (handle is closed)" @(yesod_IuLUrNVwUaBI1Ov5JfnWBS:Yesod.Core.Internal.Run ./Yesod/Core/Internal/Run.hs:163:21)
  C-c C-c

I'm guessing the file needs to be read more strictly, before yesod forks off its server thread in Main.hs ? But why does it happen only with stdin ? I dunno, patches welcome.

@simonmichael simonmichael added a commit that closed this issue Sep 27, 2015
@simonmichael web: disallow -f- which doesn't work (fixes #202)
hledger-web -f- gives

[Error#yesod-core] <stdin>: hGetContents: illegal operation (handle is closed)

and I can't see why. Just disallow it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment