Tokens([id] name - lastAccess):
[Wf2-C4zSru-BDP5JGf7sUyYEkYgf_MPPmg_0xJW_GNs] test_api_token - 2021-08-10 21:00:26
[ppjoo1wlS283tolPkwDzRCbPA72vuKs3MZc1xGoe7rQ] test_api_token - Never
Traceback (most recent call last):
File "/usr/local/bin/ckan", line 11, in <module>
load_entry_point('ckan', 'console_scripts', 'ckan')()
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/ckan/venv/local/lib/python2.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/ckan_repo_code/src/ckan-core/ckan/cli/user.py", line 233, in list_tokens
).isoformat(u" ", u"seconds")
TypeError: isoformat() takes at most 1 argument (2 given)
CKAN version
2.9
Describe the bug
When running on Python 2, if one of the API tokens has been used then calling
ckan user token list [USERNAME]results in a traceback (seen below). This is caused by differences in theisoformatoption ofdatetimeobjects between Python 2 and Python 3.Steps to reproduce
Steps to reproduce the behavior:
ckan user token list [USERNAME]Expected behavior
Should list the tokens and their last access time as follows:
Additional details