Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

datetime error message is different between _pydatetime.py and _datetimemodule.c #109798

Closed
Labels
3.12only security fixes3.13bugs and security fixes3.14bugs and security fixesextension-modulesC modules in the Modules dirstdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error
@mattip

Description

@mattip

Bug report

Bug description:

import_datetime,_pydatetime_datetime.date(1,1,50)Traceback (mostrecentcalllast):File"<stdin>",line1,in<module>ValueError:dayisoutofrangeformonth```_pydatetime.date(1,1,50)Traceback (mostrecentcalllast):File"<stdin>",line1,in<module>File"/usr/lib/python3.12/_pydatetime.py",line960,in__new__year,month,day=_check_date_fields(year,month,day)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/usr/lib/python3.12/_pydatetime.py",line535,in_check_date_fieldsraiseValueError('day must be in 1..%d'%dim,day)ValueError: ('day must be in 1..31',50)

The error message differs between the two implementations of datetime. This came up when testing PyPy, which uses the pure-python datetime implementation. xrefconda-forge/rtoml-feedstock#1 (comment)

CPython versions tested on:

3.12

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixes3.13bugs and security fixes3.14bugs and security fixesextension-modulesC modules in the Modules dirstdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp