Skip to content
This repository has been archived by the owner on Jun 16, 2020. It is now read-only.

I/O Error on every invocation on Mac #18

Closed
alecthomas opened this issue Jul 4, 2018 · 5 comments
Closed

I/O Error on every invocation on Mac #18

alecthomas opened this issue Jul 4, 2018 · 5 comments

Comments

@alecthomas
Copy link

Not sure what's going on...

[aat@cavern:~/Projects/kong]termtosvg foo.svg
Recording started, enter "exit" command or Control-D to end
[aat@cavern:~/Projects/kong]ls
README.md            guesswidth.go        kong_test.go         resolver_test.go
_examples/           guesswidth_unix.go   levenshtein.go       scanner.go
build.go             help.go              mapper.go            scanner_test.go
camelcase.go         help_test.go         mapper_test.go       tag.go
context.go           interpolate.go       model.go             tag_test.go
doc.go               interpolate_test.go  model_test.go        tokentype_string.go
error.go             kong.go              options.go
global.go            kong.png             options_test.go
global_test.go       kong.sketch          resolver.go
[aat@cavern:~/Projects/kong]
Traceback (most recent call last):
  File "/usr/local/bin/termtosvg", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/termtosvg/__main__.py", line 199, in main
    anim.render_animation(replayed_records, svg_filename, font)
  File "/usr/local/lib/python3.6/site-packages/termtosvg/anim.py", line 213, in render_animation
    for event_record in record_group:
  File "/usr/local/lib/python3.6/site-packages/termtosvg/term.py", line 248, in replay
    for event_record in _group_by_time(records, min_frame_duration, last_frame_duration):
  File "/usr/local/lib/python3.6/site-packages/termtosvg/term.py", line 163, in _group_by_time
    for event_record in event_records:
  File "/usr/local/lib/python3.6/site-packages/termtosvg/term.py", line 53, in record
    for data, time in _record(columns, lines, input_fileno, output_fileno):
  File "/usr/local/lib/python3.6/site-packages/termtosvg/term.py", line 101, in _record
    for data, time in _capture_data(input_fileno, output_fileno, master_fd):
  File "/usr/local/lib/python3.6/site-packages/termtosvg/term.py", line 144, in _capture_data
    n = os.write(write_fileno, data)
OSError: [Errno 5] Input/output error
@ushroo
Copy link

ushroo commented Jul 8, 2018

Experiencing the same issue on OpenBSD 6.3, Python 3.6.4:

user@tina ~
$ termtosvg --verbose
Logging to /tmp/termtosvg_1bmg2ibl.log
Recording started, enter "exit" command or Control-D to end

user@tina ~
$ echo foo
foo

user@tina ~
$ ^D
Traceback (most recent call last):
  File "./.local/bin/termtosvg", line 11, in <module>
    sys.exit(main())
  File "/home/user/.local/lib/python3.6/site-packages/termtosvg/__main__.py", line 194, in main
    anim.render_animation(replayed_records, svg_filename, font)
  File "/home/user/.local/lib/python3.6/site-packages/termtosvg/anim.py", line 213, in render_animation
    for event_record in record_group:
  File "/home/user/.local/lib/python3.6/site-packages/termtosvg/term.py", line 248, in replay
    for event_record in _group_by_time(records, min_frame_duration, last_frame_duration):
  File "/home/user/.local/lib/python3.6/site-packages/termtosvg/term.py", line 163, in _group_by_time
    for event_record in event_records:
  File "/home/user/.local/lib/python3.6/site-packages/termtosvg/term.py", line 53, in record
    for data, time in _record(columns, lines, input_fileno, output_fileno):
  File "/home/user/.local/lib/python3.6/site-packages/termtosvg/term.py", line 101, in _record
    for data, time in _capture_data(input_fileno, output_fileno, master_fd):
  File "/home/user/.local/lib/python3.6/site-packages/termtosvg/term.py", line 144, in _capture_data
    n = os.write(write_fileno, data)
OSError: [Errno 5] Input/output error

user@tina ~
$ cat /tmp/termtosvg_1bmg2ibl.log
2018-07-08 10:08:04,741 - termtosvg - INFO - Logging to /tmp/termtosvg_1bmg2ibl.log
2018-07-08 10:08:04,741 - termtosvg - INFO - Recording started, enter "exit" command or Control-D to end

user@tina ~
$ ls *.svg /tmp/*.svg
ls: *.svg: No such file or directory
-rw-------  1 user  wheel  -    0B Jul  8 10:08 /tmp/termtosvg_nbbjvjjl.svg

user@tina ~
$ id
uid=1000(user) gid=1000(user) groups=1000(user), 0(wheel), 9(wsrc), 117(dialer)

user@tina ~
$ sysctl kern.version
kern.version=OpenBSD 6.3 (GENERIC.MP) #4: Sun Jun 17 11:22:20 CEST 2018
    [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP

@nbedos
Copy link
Owner

nbedos commented Jul 8, 2018

@ushroo Thanks for reporting the issue. I don't have a machine with MacOS but I do have a machine running OpenBSD 6.2 so I should be able to fix this. :) I did some testing and it seems termtosvg is stuck forever on a select call. For now I have no idea why but I'll investigate in the next few days.

@nbedos
Copy link
Owner

nbedos commented Jul 10, 2018

@ushroo @alecthomas @wwj718 @jseed
I've committed a fix just now: 3a459cc
I've tested it on OpenBSD 6.3 and Mac OS 10.12 so it should fix the problem on both OSes.

I'll make a new release including the fix later this week when I have more time.

@alecthomas
Copy link
Author

It works!

Thanks very much.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@alecthomas @ushroo @nbedos and others