Description
Describe the bug
Error "TypeError: cannot serialize None" in sample login.py.
Versions
Details of your environment, including:
- Tableau Server OnPremise, version: 2021.2.2, CentOS Linux release 7.9.2009, with AD auth and SAML configured.
- Python version: 3.6.8
- TSC library version: ## 0.17.0 (20 October 2021)
To Reproduce
Run the command: "python3 login.py -s http://localhost -u schaffer" without quotes.
Results
[schaffer@tableau-srv samples]$ python3 login.py -s http://localhost -u schaffer
Password:
Signing in...
Server: http://localhost
Site: None
Username: schaffer
Traceback (most recent call last):
File "/usr/lib64/python3.6/xml/etree/ElementTree.py", line 1079, in _escape_attrib
if "&" in text:
TypeError: argument of type 'NoneType' is not iterable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "login.py", line 59, in
main()
File "login.py", line 43, in main
with server.auth.sign_in(tableau_auth):
File "/home/tableauadmin/.local/lib/python3.6/site-packages/tableauserverclient/server/endpoint/endpoint.py", line 163, in wrapper
return func(self, *args, **kwargs)
File "/home/tableauadmin/.local/lib/python3.6/site-packages/tableauserverclient/server/endpoint/auth_endpoint.py", line 28, in sign_in
signin_req = RequestFactory.Auth.signin_req(auth_req)
File "/home/tableauadmin/.local/lib/python3.6/site-packages/tableauserverclient/server/request_factory.py", line 68, in signin_req
return ET.tostring(xml_request)
File "/usr/lib64/python3.6/xml/etree/ElementTree.py", line 1135, in tostring
short_empty_elements=short_empty_elements)
File "/usr/lib64/python3.6/xml/etree/ElementTree.py", line 776, in write
short_empty_elements=short_empty_elements)
File "/usr/lib64/python3.6/xml/etree/ElementTree.py", line 941, in _serialize_xml
short_empty_elements=short_empty_elements)
File "/usr/lib64/python3.6/xml/etree/ElementTree.py", line 941, in _serialize_xml
short_empty_elements=short_empty_elements)
File "/usr/lib64/python3.6/xml/etree/ElementTree.py", line 933, in _serialize_xml
v = _escape_attrib(v)
File "/usr/lib64/python3.6/xml/etree/ElementTree.py", line 1102, in _escape_attrib
_raise_serialization_error(text)
File "/usr/lib64/python3.6/xml/etree/ElementTree.py", line 1057, in _raise_serialization_error
"cannot serialize %r (type %s)" % (text, type(text).name)
TypeError: cannot serialize None (type NoneType)
[schaffer@tableau-srv samples]$