Visitar URL original
GH-70647: Deprecate strptime day of month parsing without a year present to avoid leap-year bugs by gpshead · Pull Request #117107 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
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
Prev Previous commit
Use skip_file_prefixes for the warning
  • Loading branch information
encukou committed Apr 3, 2024
commit f1bd314ce7dc430775365838376b44da27e100c3
3 changes: 2 additions & 1 deletion Lib/_strptime.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
strptime -- Calculates the time struct represented by the passed-in string

"""
import os
import time
import locale
import calendar
Expand Down Expand Up @@ -273,7 +274,7 @@ def pattern(self, format):
To avoid trouble, add a specific year to the input & format.
See https://github.com/python/cpython/issues/70647.""",
DeprecationWarning,
stacklevel=5)
skip_file_prefixes=(os.path.dirname(__file__),))
return "%s%s" % (processed_format, format)

def compile(self, format):
Expand Down