STINNER Victor <[email protected]> added the comment:
Paul Ganssle asked me to look at PR 10692. This issue is about consistency, so
I don't understand this part of the change:
try:
_time.strftime('%')
except ValueError:
self.skipTest('time module does not support trailing %')
Would why datetime have the same behavior on all platforms, but
time.strftime('%') may or may not raise an exception depending on the libc?
Can't we get the same behavior on all platforms and the same behavior in time
and datetime module. Honestly, I have no preference between always raising an
exception or always success (just copy trailing "%").
This issue reminds me the old bpo-16322: time.strftime("%z") fails to format
properly the timezone name. I would suggest to "preprocess" the input string
passed to the C function strftime() / wcsftime() to replace %z or %Z with the
timezone name, but only pass format substrings?
Something similar can be done for the trailing "%": pass a substring (without
the trailing %) to strftime() / wcsftime(), and later append "%".
----------
nosy: +vstinner
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue35066>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com