[issue45485] datetime.strptime issues message attribute of type 'NoneType' is not callableTraceback

Freek de Kruijf report at bugs.python.org
Fri Oct 15 09:59:25 EDT 2021


New submission from Freek de Kruijf <f.de.kruijf at gmail.com>:

In a piece of code I have
pT = datetime.strptime(a[0],"%Y-%m-%dT%H:%M:%S.%f")
When I check type(a[0]) I got type(a[0]): <class 'str'> not <type 'str'>
In this case I get: message attribute of type 'NoneType' is not callableTraceback
When I use str(a[0]) instead of a[0], the issue is gone.
a[0] behaves elsewhere as a string without the surrounding str().
This piece of code is rather local in a larger program.

----------
components: Interpreter Core
messages: 404018
nosy: f.de.kruijf
priority: normal
severity: normal
status: open
title: datetime.strptime issues message attribute of type 'NoneType' is not callableTraceback
type: behavior

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


More information about the Python-bugs-list mailing list