-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
test_strptime
raises a DeprecationWarning
#117655
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
So, we just need to do this? Can I make a pull request for that? -_strptime._strptime_time("10", "%d")
+_strptime._strptime_time("10 2004", "%d %Y") |
Yes, that's looks good to me. I'm dislike the approach of catching |
However, there's also a similar warning in the ./python.exe -m test -q test_datetime
Using random seed: 2525252452
0:00:00 load avg: 41.62 Run 1 test sequentially
sys:1: DeprecationWarning: Parsing dates involving a day of month without a year specified is ambiguious
and fails to parse leap day. The default behavior will change in Python 3.15
to either always raise an exception or to use a different default year (TBD).
To avoid trouble, add a specific year to the input & format.
See https://github.com/python/cpython/issues/70647.
sys:1: DeprecationWarning: Parsing dates involving a day of month without a year specified is ambiguious
and fails to parse leap day. The default behavior will change in Python 3.15
to either always raise an exception or to use a different default year (TBD).
To avoid trouble, add a specific year to the input & format.
See https://github.com/python/cpython/issues/70647.
sys:1: DeprecationWarning: Parsing dates involving a day of month without a year specified is ambiguious
and fails to parse leap day. The default behavior will change in Python 3.15
to either always raise an exception or to use a different default year (TBD).
To avoid trouble, add a specific year to the input & format.
See https://github.com/python/cpython/issues/70647.
sys:1: DeprecationWarning: Parsing dates involving a day of month without a year specified is ambiguious
and fails to parse leap day. The default behavior will change in Python 3.15
to either always raise an exception or to use a different default year (TBD).
To avoid trouble, add a specific year to the input & format.
See https://github.com/python/cpython/issues/70647.
sys:1: DeprecationWarning: Parsing dates involving a day of month without a year specified is ambiguious
and fails to parse leap day. The default behavior will change in Python 3.15
to either always raise an exception or to use a different default year (TBD).
To avoid trouble, add a specific year to the input & format.
See https://github.com/python/cpython/issues/70647.
sys:1: DeprecationWarning: Parsing dates involving a day of month without a year specified is ambiguious
and fails to parse leap day. The default behavior will change in Python 3.15
to either always raise an exception or to use a different default year (TBD).
To avoid trouble, add a specific year to the input & format.
See https://github.com/python/cpython/issues/70647.
== Tests result: SUCCESS ==
Total duration: 3.6 sec
Total tests: run=1,012 skipped=28
Total test files: run=1/1
Result: SUCCESS |
cpython/Lib/test/datetimetester.py Lines 2796 to 2807 in 22b25d1
|
cpython/Lib/test/test_strptime.py Lines 500 to 506 in 22b25d1
Those will have to be removed in 3.15. |
Yeah, |
Could someone review my pull request? I've waited exactly one month. In a week I'll ask on Discourse. |
@Eclips4 can you review this, or should I ask on Discourse right away? erlend-aasland said he's not going to review this. |
Will do it later today. Please note that before merging, we should also get a review from Greg or Paul. |
Even after waiting one month? But if they decide to review it now, that would be appreciated. |
thanks for the PR & pings. merged! =) cpython workflow wise... IIRC we don't have anything in our CI or buildbots treating warnings emitted by the test suite as a hard error so it they can be easily overlooked. I should've tried to do this with my original PR. There could be an argument made that test coverage of some code paths without the year specified is important to retain, but I believe we've got enough other explicit intentional tests for that behavior already so this issues PR change still the best way forward. |
…rning (pythonGH-117668) * Fix `test_strptime` raises a DeprecationWarning * Ignore deprecation warnings where appropriate. * Update Lib/test/datetimetester.py This is follow on work to silence unnecessary warnings from the test suite that changes for python#70647 added. (cherry picked from commit abead54) Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
…arning (GH-117668) (GH-118956) gh-117655: Prevent `test_strptime` from raising a DeprecationWarning (GH-117668) * Fix `test_strptime` raises a DeprecationWarning * Ignore deprecation warnings where appropriate. * Update Lib/test/datetimetester.py This is follow on work to silence unnecessary warnings from the test suite that changes for #70647 added. (cherry picked from commit abead54) Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
…rning (pythonGH-117668) * Fix `test_strptime` raises a DeprecationWarning * Ignore deprecation warnings where appropriate. * Update Lib/test/datetimetester.py This is follow on work to silence unnecessary warnings from the test suite that changes for python#70647 added.
Bug report
Bug description:
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
test_strptime
raises a DeprecationWarning #117668test_strptime
from raising a DeprecationWarning (GH-117668) #118956The text was updated successfully, but these errors were encountered: