Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Avoid referencing an uninitialized SMTP server on connect failure

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

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
backend

Research direction

Start in src/restic_compose_backup/alerts/smtp.py at SMTPAlert.send() and trace the SMTP/SMTP_SSL connection and finally block. Exercise a connection-refused or DNS failure, then verify that cleanup does not raise UnboundLocalError and the original connection exception is preserved.

Written by the indexing model from the issue text.

Description

In src/restic_compose_backup/alerts/smtp.py, SMTPAlert.send() references server in its finally block, but server is assigned only after the SMTP/SMTP_SSL constructor succeeds. If the connection attempt raises (for example, connection refused or DNS failure), the finally block raises UnboundLocalError and masks the original connection exception. Please only close an initialized server and preserve the original connection error.

Dominant language
Python
Stars
181
Forks
13
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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 lawndoc/stack-back

All issues in lawndoc/stack-back

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.