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

gh-109798: Normalize_datetime anddatetime error messages#127345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
pganssle merged 31 commits intopython:mainfromdonBarbos:issue-109798
Feb 12, 2025
Merged
Changes from1 commit
Commits
Show all changes
31 commits
Select commitHold shift + click to select a range
764eb1b
Update error messages to be the same in datetime
donBarbosNov 27, 2024
2bf419f
Add NEWS.d/next
donBarbosNov 27, 2024
4363e9e
fixed syntax errors
donBarbosNov 27, 2024
9da0dfc
Move Py_DECREF after PyErr_Format
donBarbosNov 29, 2024
179423d
Add more info in message error in _pydatetime impl
donBarbosNov 29, 2024
f691251
Update Modules/_datetimemodule.c
donBarbosNov 29, 2024
d8973cf
Update Modules/_datetimemodule.c
donBarbosNov 29, 2024
5eea62f
Update Modules/_datetimemodule.c
donBarbosNov 29, 2024
79543cc
Update Modules/_datetimemodule.c for optimisation
donBarbosNov 29, 2024
d174497
Revert last update Modules/_datetimemodule.c
donBarbosNov 29, 2024
498c4ba
Update Modules/_datetimemodule.c
donBarbosNov 29, 2024
216d0fe
Update Misc/NEWS.d message
donBarbosNov 29, 2024
c409fec
Update Misc/NEWS.d message
donBarbosNov 29, 2024
3f454f6
Update Misc/NEWS.d message
donBarbosNov 29, 2024
a2b8f7a
Update Misc/NEWS.d message
donBarbosNov 29, 2024
209c338
Update Lib/_pydatetime.py
donBarbosNov 30, 2024
0777aa5
Update Misc/NEWS.d/next/Library/2024-11-27-23-29-05.gh-issue-109798.O…
donBarbosNov 30, 2024
4d31d33
Update Lib/_pydatetime.py
donBarbosNov 30, 2024
f05ebba
Update Lib/_pydatetime.py
donBarbosNov 30, 2024
f840105
Update Lib/_pydatetime.py
donBarbosNov 30, 2024
61c95a5
Update Lib/_pydatetime.py
donBarbosNov 30, 2024
2ab77b3
Update Lib/_pydatetime.py
donBarbosNov 30, 2024
b1e272a
Update Lib/_pydatetime.py
donBarbosNov 30, 2024
7a35bd4
Update Lib/_pydatetime.py
donBarbosNov 30, 2024
cfd18cb
Add tests
donBarbosNov 30, 2024
2827514
Update _pydatetime.py
donBarbosDec 1, 2024
cd3bdc1
Update _pydatetime.py
donBarbosDec 1, 2024
9915dfe
Change but got to not
donBarbosDec 1, 2024
1da5a3a
Correct line break
donBarbosDec 1, 2024
610f067
Update 2024-11-27-23-29-05.gh-issue-109798.OPj1CT.rst
pganssleFeb 12, 2025
410e0ce
Merge branch 'main' into issue-109798
pganssleFeb 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Add more info in message error in _pydatetime impl
  • Loading branch information
@donBarbos
donBarbos committedNov 29, 2024
commit179423d8964e9be4694807afd0cfa4fc04a06de8
10 changes: 7 additions & 3 deletionsLib/_pydatetime.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -545,7 +545,7 @@ def _isoweek_to_gregorian(year, week, day):
def _check_tzname(name):
if name is not None and not isinstance(name, str):
raise TypeError("tzinfo.tzname() must return None or string, "
"not '%s'" % type(name))
"not '%s'" % type(name).__name__)

# name is the offset-producing method, "utcoffset" or "dst".
# offset is what it returned.
Expand All@@ -559,7 +559,8 @@ def _check_utc_offset(name, offset):
return
if not isinstance(offset, timedelta):
raise TypeError("tzinfo.%s() must return None "
"or timedelta, not '%s'" % (name, type(offset)))
"or timedelta, not '%s'"
% (name, type(offset).__name__))
if not -timedelta(1) < offset < timedelta(1):
raise ValueError("offset must be a timedelta "
"strictly between -timedelta(hours=24) and "
Expand DownExpand Up@@ -597,7 +598,10 @@ def _check_time_fields(hour, minute, second, microsecond, fold):

def _check_tzinfo_arg(tz):
if tz is not None and not isinstance(tz, tzinfo):
raise TypeError("tzinfo argument must be None or of a tzinfo subclass")
raise TypeError(
"tzinfo argument must be None or of a tzinfo subclass, "
f"not type '{type(tz).__name__}'"
)

def _divide_and_round(a, b):
"""divide a by b and round result to the nearest integer
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp