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

curses.error when running as a service, main.py seems fail when it can't output to a terminal #20

Open
emilyboda opened this issue Sep 15, 2023 · 0 comments

Comments

@emilyboda
Copy link

I'm using this handy guide to have main.py run as a service. I want main.py to run when the Mac is booted. One quick thing to note, to make this work I had to go into the Security and Privacy settings on Mac and give Python full disk access.

When I try to run main.py as a service, I get this error:

Traceback (most recent call last):
  File "/Users/boda/Documents/FindMyHistory/main.py", line 125, in <module>
    curses.wrapper(partial(main, args=args))
  File "/usr/local/Cellar/[email protected]/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11/curses/__init__.py", line 73, in wrapper
    stdscr = initscr()
             ^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11/curses/__init__.py", line 29, in initscr
    setupterm(term=_os.environ.get("TERM", "unknown"),
_curses.error: setupterm: could not find terminal

When I run main.py directly from the terminal I don't get this error. I can't figure out what's going on. When I run echo $TERM I get xterm-256color.

I think this might be an issue with the curses package, but I'm not familiar with how it works. Is it possible to modify the last line of main.py curses.wrapper(partial(main, args=args)) so that it doesn't fail if it can't output the result to a terminal?

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