Skip to content

[flake8-datetimez] Reject tzinfo=None for datetime bounds (DTZ901) - #28022

Merged
ntBre merged 1 commit into
astral-sh:mainfrom
jelle-openai:jelle/codex/dtz901-none-timezone
Aug 27, 2026
Merged

ntBre merged 1 commit into
astral-sh:mainfrom
jelle-openai:jelle/codex/dtz901-none-timezone

Conversation

@jelle-openai

Copy link
Copy Markdown
Contributor

Only exempt replace calls with a non-None timezone argument, since passing None leaves datetime.min and datetime.max naive.

Fixes #28013.

Only exempt replace calls with a non-None timezone argument, since passing
None leaves datetime.min and datetime.max naive.

Fixes astral-sh#28013.
@astral-sh-bot
astral-sh-bot Bot requested a review from ntBre August 25, 2026 03:37
@astral-sh-bot

astral-sh-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@ntBre ntBre added the bug Something isn't working label Aug 27, 2026

@ntBre ntBre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

@ntBre
ntBre merged commit 88b8c7a into astral-sh:main Aug 27, 2026
48 checks passed
sharkdp pushed a commit that referenced this pull request Aug 31, 2026
…1`) (#28022)

Only exempt replace calls with a non-None timezone argument, since
passing None leaves datetime.min and datetime.max naive.

Fixes #28013.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

datetime-min-max (DTZ901) is fooled by tzinfo=None

2 participants