Skip to content

Profiling command-line based scripts that change terminal settings results in a termios error #112

Description

@lomnom
Description

Profiling a CLI script results in this error:

Traceback (most recent call last):
  File "/usr/local/bin/vprof", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/vprof/__main__.py", line 83, in main
    program_stats = runner.run_profilers(source, config, verbose=True)
  File "/usr/local/lib/python3.9/site-packages/vprof/runner.py", line 73, in run_profilers
    run_stats[option] = curr_profiler.run()
  File "/usr/local/lib/python3.9/site-packages/vprof/base_profiler.py", line 172, in run
    return self.profile()
  File "/usr/local/lib/python3.9/site-packages/vprof/flame_graph.py", line 167, in profile_module
    return base_profiler.run_in_separate_process(self._profile_module)
  File "/usr/local/lib/python3.9/site-packages/vprof/base_profiler.py", line 79, in run_in_separate_process
    raise exc
termios.error: (19, 'Operation not supported by device')
How to reproduce

run vprof -c ch Test.py inside this folder.

Actual results

This happens after a while

Traceback (most recent call last):
  File "/usr/local/bin/vprof", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/vprof/__main__.py", line 83, in main
    program_stats = runner.run_profilers(source, config, verbose=True)
  File "/usr/local/lib/python3.9/site-packages/vprof/runner.py", line 73, in run_profilers
    run_stats[option] = curr_profiler.run()
  File "/usr/local/lib/python3.9/site-packages/vprof/base_profiler.py", line 172, in run
    return self.profile()
  File "/usr/local/lib/python3.9/site-packages/vprof/flame_graph.py", line 167, in profile_module
    return base_profiler.run_in_separate_process(self._profile_module)
  File "/usr/local/lib/python3.9/site-packages/vprof/base_profiler.py", line 79, in run_in_separate_process
    raise exc
termios.error: (19, 'Operation not supported by device')
Expected results

(without profiler)
Screenshot 2021-11-24 at 10 39 15 AM
(side note: ctrl+z to quit Test.py)

Version and platform

vprof 0.38
MacOs 10.14.6
Screenshot 2021-11-24 at 10 41 48 AM

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions