Skip to content
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

Fix "Invalid format string" in Windows #55

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

raulsiles
Copy link
Contributor

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)

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)
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)
Copy link
Owner

@dpnishant dpnishant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this is a Windows only issue? Because the current format string works good on Linux and macOS. It would be better if you can first detect OS and the use the correct format.

@raulsiles
Copy link
Contributor Author

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.

@ghost ghost mentioned this pull request Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants