[New-bugs-announce] [issue35066] Inconsistency between dangling '%' handling in time.strftime() and datetime.strftime()

Michael Saah report at bugs.python.org
Thu Oct 25 10:33:30 EDT 2018


New submission from Michael Saah <mike.saah at gmail.com>:

A call to
time.strftime('%')
returns
'%'

A similar call to
datetime.utcfromtimestamp(int(time.time()).strftime('%')
raises
ValueError: strftime format ends with raw %

Similar inputs like '%D %' behave similarly.

I might take a crack at fixing this, but first I wanted to see what the official guidance is. Seems to me like similar error handling behavior between the functions  would be desirable.

----------
components: Library (Lib)
messages: 328443
nosy: mjsaah
priority: normal
severity: normal
status: open
title: Inconsistency between dangling '%' handling in time.strftime() and datetime.strftime()
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35066>
_______________________________________


More information about the New-bugs-announce mailing list