[issue40236] datetime.datetime.strptime get day error

2022-01-01 Thread Andrei Kulakov
Andrei Kulakov added the comment: I didn't realize that time.strptime is just using python module _strptime. -- ___ Python tracker ___

[issue40236] datetime.datetime.strptime get day error

2021-12-31 Thread Andrei Kulakov
Change by Andrei Kulakov : -- keywords: +patch pull_requests: +28534 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/30318 ___ Python tracker

[issue40236] datetime.datetime.strptime get day error

2021-12-31 Thread Andrei Kulakov
Andrei Kulakov added the comment: > I am open to discussion about trying to rationalize this behavior - it would > be a bit tricky but if we moved to our own implementation of the algorithm to > calculate %W we could detect this situation and throw an exception. Paul: I'm guessing here

[issue40236] datetime.datetime.strptime get day error

2020-07-28 Thread karl
karl added the comment: Also this. >>> import datetime >>> d0 = datetime.datetime.strptime("2024-0-3 00:00:00", "%Y-%W-%w %H:%M:%S") >>> d0.strftime("%Y-%W-%w %H:%M:%S") '2024-01-3 00:00:00' >>> d1 = datetime.datetime.strptime("2024-1-3 00:00:00", "%Y-%W-%w %H:%M:%S") >>>

[issue40236] datetime.datetime.strptime get day error

2020-07-28 Thread karl
karl added the comment: Same on macOS 10.15.6 (19G73) Python 3.8.3 (v3.8.3:6f8c8320e9, May 13 2020, 16:29:34) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import datetime >>> datetime.datetime.strptime("2024-0-3 00:00:00",

[issue40236] datetime.datetime.strptime get day error

2020-04-16 Thread Paul Ganssle
Change by Paul Ganssle : -- stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40236] datetime.datetime.strptime get day error

2020-04-09 Thread zhanying
zhanying added the comment: i read the source code, in this part def _calc_julian_from_U_or_W(year, week_of_year, day_of_week, week_starts_Mon): """Calculate the Julian day based on the year, week of the year, and day of the week, with week_start_day representing whether the week of the

[issue40236] datetime.datetime.strptime get day error

2020-04-09 Thread zhanying
zhanying added the comment: My platform is this. #python Python 3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 19:07:31) [GCC 7.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. At 2020-04-09 20:45:51, "Eric V. Smith" wrote: > >Eric V. Smith added the

[issue40236] datetime.datetime.strptime get day error

2020-04-09 Thread Eric V. Smith
Eric V. Smith added the comment: I thought that strptime is platform specific (which is why I asked for the platform info). But, looking at the existing docs https://docs.python.org/3.5/library/time.html#time.strptime "But strptime() is independent of any platform and thus does not

[issue40236] datetime.datetime.strptime get day error

2020-04-09 Thread Paul Ganssle
Paul Ganssle added the comment: Likely relevant is bpo-23136, where they dealt with similar issues in the past. I don't see any explicit test for this behavior, but it seems that the solution is to try to be consistent and to not raise a ValueError. Looking at this issue, I think it's a

[issue40236] datetime.datetime.strptime get day error

2020-04-09 Thread Paul Ganssle
Paul Ganssle added the comment: I can reproduce this on Linux with Python 3.8.2. I think this may be a bug, but it may also just be platform-specific weirdness. Either way it's very curious behavior: >>> datetime.strptime("2023-0-0", "%Y-%W-%w")

[issue40236] datetime.datetime.strptime get day error

2020-04-09 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +belopolsky, p-ganssle ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue40236] datetime.datetime.strptime get day error

2020-04-09 Thread Eric V. Smith
Eric V. Smith added the comment: Can you tell us what platform you're on? Also, please include the header that's printed out when you run python from the command line. For example, mine shows: $ python3 Python 3.7.6 (default, Jan 30 2020, 10:29:04) [GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] on

[issue40236] datetime.datetime.strptime get day error

2020-04-09 Thread zhanying
New submission from zhanying : In [7]: datetime.datetime.strptime("2024-0-3 00:00:00", "%Y-%W-%w %H:%M:%S") Out[7]: datetime.datetime(2024, 1, 3, 0, 0) In [8]: datetime.datetime.strptime("2024-1-3 00:00:00", "%Y-%W-%w %H:%M:%S") Out[8]: datetime.datetime(2024, 1, 3, 0, 0) -- messages: