This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients belopolsky, eric.smith, matrixise, mjsaah, p-ganssle, pablogsal, terry.reedy, thatiparthy, vstinner, xtreak
Date 2019-01-09.16:39:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Paul Ganssle asked me to look at PR 10692. This issue is about consistency, so I don't understand this part of the change:

        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 "%".
Date User Action Args
2019-01-09 16:39:07vstinnersetrecipients: + vstinner, terry.reedy, belopolsky, eric.smith, matrixise, thatiparthy, p-ganssle, pablogsal, xtreak, mjsaah
2019-01-09 16:39:06vstinnersetmessageid: <>
2019-01-09 16:39:06vstinnerlinkissue35066 messages
2019-01-09 16:39:05vstinnercreate