dpnishant / appmon

Documentation:
http://dpnishant.github.io/appmon
Apache License 2.0
1.56k stars 276 forks source link

Fix "Invalid format string" in Windows #55

Open raulsiles opened 6 years ago

raulsiles commented 6 years ago

ValueError: Invalid format string

%l is not standard: %l - Hour of the day, 12-hour clock, blank-padded ( 1..12)

The Windows implementations doesn't support it: https://msdn.microsoft.com/en-us/library/fe06s4ak.aspx https://docs.python.org/3/library/time.html

Use %I instead: %I - Hour of the day, 12-hour clock, zero-padded (01..12)

raulsiles commented 6 years ago

I assume this is a Windows only issue, as well as the other Windows-related pull requests I submitted last week. However, I have not tested them specifically in all supported OSes.

For this one, I suggest to use the same code for all OSes (Windows, Linux, macOS...), that is, a date representation that is standard for all them: uppercase i vs. lowercase l.

For the others, if the additional color library and reference does not break the behavior of Linux and macOS, I also suggest to use the same code for them all.