Closed schmir closed 4 years ago
OK this one, was not a thing I knew you could even do. i guess, I have to put whatever python io.Buffered thing aroudn the file handle.
OK it would help if you could check my work on this one, then I can release 0.2.2. I don't see any obvious way of unit testing this one without pulling out a whole bunch of IO mechanics. feel free to propose writing some kind of test here but otherwise just make sure on your end it works and I'll just comment the code why it's needed.
That fix works for me. I've opened PR #18 as an enhancement for this one. It makes 'zimports -' read from stdin and write to stdout. Using '-' as a filename is more or less a standard way on unix to read input from stdin (e.g. /usr/bin/cat supports it)
When calling zimports with /dev/stdin as input file, zimports 0.2.1 crashes with OSError: [Errno 29] Illegal seek This is a regression from 0.2.0.
I'm using this in my zimports.el emacs package