Skip to content

fix(web): Last-Modified serializer uses datetime.timezone.utc instead of undeclared pytz - #340

Merged
mofr merged 1 commit into
masterfrom
fix-pytz-dependency
Oct 13, 2026
Merged

mofr merged 1 commit into
masterfrom
fix-pytz-dependency

Conversation

@mofr

@mofr mofr commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

winter.web.setup() imports winter.web.response_header_serializers, which imported pytz. pytz is only a dev dependency, and Django stopped depending on it in 4.0. A clean pip install winter therefore fails at setup:

winter/web/response_header_serializers.py:5: in <module>
    import pytz
E   ModuleNotFoundError: No module named 'pytz'

The bug exists since 30.0, when the minimum Django became 4.2. Projects that get pytz from another dependency do not notice it. Found while upgrading winter-getting-started to 33.0.

The serializer now uses datetime.timezone.utc, which gives the same result. pytz stays a dev dependency because tests use it. No other third-party import in winter/ is missing from the runtime dependencies.

🤖 Generated with Claude Code

… of undeclared pytz

winter.web.setup() imported pytz, which is only a dev dependency. Django stopped
depending on pytz in 4.0, so a clean install of winter failed at setup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mofr
mofr merged commit 599b072 into master Oct 13, 2026
8 checks passed
@mofr
mofr deleted the fix-pytz-dependency branch October 13, 2026 11:31
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