[issue31498] Default values for zero in time.strftime()

2017-09-20 Thread Denis Osipov
Changes by Denis Osipov : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-b

[issue31498] Default values for zero in time.strftime()

2017-09-19 Thread Denis Osipov
Denis Osipov added the comment: Thank you for your answers. It's what I want to know. It looks like I shouldn't try to fix (to break) something that works well enough. If nobody minds I'll close the issue with not a bug resolution. -- ___ Python tra

[issue31498] Default values for zero in time.strftime()

2017-09-19 Thread R. David Murray
R. David Murray added the comment: Yes, I think we can "fix" some things. I don't know if this falls into the class of things we should fix. I'll leave that decision to people with more experience with time stuff. -- ___ Python tracker

[issue31498] Default values for zero in time.strftime()

2017-09-19 Thread Denis Osipov
Denis Osipov added the comment: Actually now Python time.strftime not always returns the same value as C strftime with the same arguments, because timemodule make some refining of raw argument values to avoid errors. -- ___ Python tracker

[issue31498] Default values for zero in time.strftime()

2017-09-19 Thread Denis Osipov
Denis Osipov added the comment: Yes, C strftime returns the same. Inside of Python time.strftime() in Windows we give struct tm with inconsistent attributes (year, mon, mday and wday,yday) as argument for C strftime(). Before it timemodule does a lot of work to parse arguments of time.strftime

[issue31498] Default values for zero in time.strftime()

2017-09-19 Thread R. David Murray
R. David Murray added the comment: Well, the first question that needs to be answered is: if you call the C strftime with the same arguments, what result do you get? Because if it is the C strftime doing this, then it is not a bug in Python, whether it is correct behavior or not. --

[issue31498] Default values for zero in time.strftime()

2017-09-18 Thread Denis Osipov
Denis Osipov added the comment: It seems strange to me that time.strftime() returns formatted date with wrong day of week and day of year values. So, I think it's probably a bug. But I'm just learning Python and programming and I think that it can be intentional behavior. If it's a bug I'd like

[issue31498] Default values for zero in time.strftime()

2017-09-18 Thread R. David Murray
R. David Murray added the comment: Generally we're just reporting whatever the platform strftime does. Is that what happens in this case? -- nosy: +belopolsky, r.david.murray ___ Python tracker _

[issue31498] Default values for zero in time.strftime()

2017-09-18 Thread Denis Osipov
Denis Osipov added the comment: If it's really a bug I could make PR with changes in timemodule.c (in gettmarg() and checktm() functions). But I'm not sure that it's not intended behavior. -- ___ Python tracker

[issue31498] Default values for zero in time.strftime()

2017-09-17 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> brett.cannon nosy: +brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing

[issue31498] Default values for zero in time.strftime()

2017-09-17 Thread Denis Osipov
New submission from Denis Osipov: Now default values for zero in time.strftime returns string with day of week value 1: >>> time.strftime("%Y %m %d %H %M %S %w %j", (2000,)+(0,)*8) '2000 01 01 00 00 00 1 001' while 2000-01-01 is Saturday (=6th day of week). Now each illegal value (day of mont