Skip to content

Reject trailing newlines in configured job times - #666

Open
xiehuanyi wants to merge 1 commit into
dbader:masterfrom
xiehuanyi:fix-at-time-fullmatch
Open

xiehuanyi wants to merge 1 commit into
dbader:masterfrom
xiehuanyi:fix-at-time-fullmatch

Conversation

@xiehuanyi

Copy link
Copy Markdown

Job.at() currently accepts a terminal newline (for example, every().day.at("12:30\n")). The regex end anchor permits the final newline, and integer conversion then strips it, so malformed daily, weekly, hourly and minutely inputs become valid job times.

Use re.fullmatch() for the three supported time formats. The regression checks all six supported forms with a trailing newline; existing valid-format tests remain unchanged.

Validation on Python 3.12: the new regression fails before the change; the full suite passes afterward (82 tests), mypy passes, and the repository-pinned Black 20.8b1 accepts both changed files. git diff --check passes.

Prepared with AI assistance. Upstream CI status will be reported by GitHub.

Copilot AI balanced review requested due to automatic review settings October 10, 2026 17:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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

Successfully merging this pull request may close these issues.

2 participants