Skip to content

Conversation

FriedrichFroebel
Copy link
Collaborator

This fixes some date formatting issues on some systems as reported in #130. It seems like Windows does not like the - flag for date formatting which is stated as platform-dependent inside the Python docs.

This should close #130.

@tomasbedrich
Copy link
Owner

This seems to solve the #130. 👍

The alternative solution may be to replace - with # for Windows (as noted on https://strftime.org/). Simple detection could look like this:

import platform
eat_zero_prefix = "#" if platform.system() == "Windows" else "-"
format = {
    "d": r'%{}d'.format(eat_zero_prefix),
    ...
}

Feel free to use whichever solution you like more.

Also, I don't know if it's possible, but we should probably add Windows to test matrix, to prevent this kind of problems.

@FriedrichFroebel
Copy link
Collaborator Author

Oh, must have missed the part regarding #. As this would be the cleaner solution, I am going to replace my current workaround with it.

@FriedrichFroebel
Copy link
Collaborator Author

I currently do not have enough time to investigate CI stuff, but it seems that Windows tests should be available in theory, as in this example.

@tomasbedrich tomasbedrich merged commit 88a4268 into tomasbedrich:master Jan 17, 2020
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.

Error raise while log a TB

2 participants