Report a busy port instead of a traceback when the web UI starts

Open Beginner friendly
#47 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
cli

Research direction

Read easyedit/web.py, focusing on the import-time PORT assignment and main() where ThreadingHTTPServer binds. Check how startup failures are handled and run the relevant unit tests; the issue asks for actionable SystemExit messages for a busy port and a non-numeric EASYEDIT_PORT. Done when both messages identify the problem and explain how to choose another port.

Written by the indexing model from the issue text.

Description

enhancement good first issue

main() in easyedit/web.py binds the server with no error handling:

server = ThreadingHTTPServer(("127.0.0.1", PORT), Handler)

If the port is already taken — which happens whenever someone double-clicks easyedit-web.cmd twice, or has another app on 4331 — the user gets a raw OSError traceback from inside socketserver, with nothing pointing at easyedit or at the EASYEDIT_PORT environment variable that would fix it. The same module already handles the other startup failure nicely (raise SystemExit(f"missing {WEB / 'index.html'}")), so this one is just inconsistent.

There's a related rough edge one line of config away: PORT = int(os.environ.get("EASYEDIT_PORT", "4331")) runs at import time, so a non-numeric EASYEDIT_PORT fails with a bare ValueError during import rather than a message naming the variable.

Both should end up as a short, actionable message — which port was tried, and how to pick another one. Keep using SystemExit so the exit status stays non-zero for scripts.

Where to look: easyedit/web.py — main()


Getting started: Python 3.10+, Node 22+, FFmpeg on PATH. npm install, pip install -r requirements.txt, then python -m easyedit.doctor. Run python -m unittest discover before opening a PR. Passing --llm none skips the model entirely, which is the fastest way to test. Comment here to claim it. Questions → Discord.

Dominant language
Python
Stars
168
Forks
24
Avg merge
2d 10h
Merged PRs (30d)
14

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from blixvip/easyedit

All issues in blixvip/easyedit

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.