datetime.astimezone() returns DST name for negative timestamp on Windows
オープン
まだ誰も着手していません。
interpreter-core
OS-windows
type-bug
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
Bug report
Bug description:
PS C:\Users\yukih\Downloads> .\python-3.15.0a8-embed-amd64\python.exe
WARN: Could not find the platform standard library directory! The Python 'home' directory was set to 'C:\\Users\\yukih\\Downloads\\python-3.15.0a8-embed-amd64', is this correct?
Python 3.15.0a8 (tags/v3.15.0a8:55ea59e, Apr 7 2026, 14:21:25) [MSC v.1950 64 bit (AMD64)] on win32
>>> from datetime import datetime
>>>
>>> datetime.fromtimestamp(-1).astimezone()
datetime.datetime(1970, 1, 1, 8, 59, 59, tzinfo=datetime.timezone(datetime.timedelta(seconds=32400), 'Tokyo Daylight Time'))
>>>
>>> datetime.fromtimestamp(0).astimezone()
datetime.datetime(1970, 1, 1, 9, 0, tzinfo=datetime.timezone(datetime.timedelta(seconds=32400), 'Tokyo Standard Time'))
I expected "Tokyo Standard Time".
CPython versions tested on:
3.15
Operating systems tested on:
Windows
Linked PRs
- gh-148673
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、Windows で datetime.fromtimestamp(...).astimezone() を使って負のタイムスタンプとゼロのタイムスタンプのケースを再現し、その後、エントリーポイント datetime.astimezone と関連付けられた PR gh-148673 を調べます。負のタイムスタンプが期待される名前 "Tokyo Standard Time" を報告し、ゼロのタイムスタンプの動作にリグレッションがないことを確認できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- backend, operating-systems
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 20/100