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

Note about %z gotcha #9

Open
asmeurer opened this issue Oct 8, 2014 · 2 comments
Open

Note about %z gotcha #9

asmeurer opened this issue Oct 8, 2014 · 2 comments

Comments

@asmeurer
Copy link

asmeurer commented Oct 8, 2014

This is a good opportunity to improve on the python.org docs. An issue I've seen is that %z does unexpected things on Windows (http://bugs.python.org/issue20010). Instead of returning +HHHH it returns a string name of the time zone (often with Unicode characters). Code that uses it is liable to break when run in Windows.

@mccutchen
Copy link
Owner

@asmeurer I'm not familiar enough with this bug to feel very confident in writing a useful warning, feel like submitting a pull request?

It might be a little tricky, as strftime.org is built by extracting the formatting table from the live Python docs, but it might make sense to have a sort of generic facility for adding extra annotations to any of the entries in that table.

@asmeurer
Copy link
Author

asmeurer commented Oct 9, 2014

The issue is primarily that the output is different. For me, on Windows 8, time.strftime('%z') gives 'Central Daylight Time' (as is %Z).

The bug I'm not as sure about. See conda/conda#651 for an example of it. I think some time zone names have strange unicode characters (in this case, it was a curly quote ).

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

No branches or pull requests

2 participants