Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lomnom opened this issue Nov 24, 2021 · 0 comments

Comments

@lomnom
Copy link

lomnom commented Nov 24, 2021

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

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

No branches or pull requests

1 participant