8000 When downloading the flow, a KeyError: 'content-disposition' occurs. · Issue #1338 · tableau/server-client-python · GitHub
[go: up one dir, main page]

Skip to content
When downloading the flow, a KeyError: 'content-disposition' occurs. #1338
@bugcity

Description

@bugcity

Describe the bug
When attempting to download the flow, a KeyError: 'content-disposition' occurs.

Versions
Details of your environment, including:

  • Tableau Server 2023.1.7
  • Python version 3.11.3
  • TSC library version 0.29

To Reproduce
server.flows.download('<< flow-id >>')

Results
File "<< project-path >>\flow_test\main.py", line 12, in main
filepath = server.flows.download('50785764-47c6-45f7-8c84-22cba9c345d2')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<< project-path >>.venv\Lib\site-packages\tableauserverclient\server\endpoint\endpoint.py", line 291, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<< project-path >>.venv\Lib\site-packages\tableauserverclient\server\endpoint\flows_endpoint.py", line 124, in download
_, params = cgi.parse_header(server_response.headers["Content-Disposition"])
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "<< project-path >>.venv\Lib\site-packages\requests\structures.py", line 52, in getitem
return self._store[key.lower()][1]
~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'content-disposition'

The value of server_response.headers is as follows.
{'Date': 'Tue, 16 Jan 2024 03:48:14 GMT', 'Content-Type': 'application/octet-stream', 'Content-Length': '14934', 'Connection': 'keep-alive', 'Server': 'Tableau', 'Vary': 'Access-Control-Request-Method,Access-Control-Request-Headers,Accept-Encoding', 'X-Tableau': 'Tableau Server', 'P3P': 'CP="NON", CP="NON"', 'X-UA-Compatible': 'IE=Edge', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block', 'Referrer-Policy': 'no-referrer-when-downgrade', 'Content-Security-Policy-Report-Only': "connect-src * https://*.tiles.mapbox.com https://api.mapbox.com; default-src blob:; font-src * data:; frame-src * data: tableau-desktop:; img-src * data: blob:; object-src data:; report-uri /vizql/csp-report; script-src * blob: wasm-unsafe-eval; style-src * 'unsafe-inline'", 'Last-Modified': 'Sun, 17 Dec 2023 23:44:58 GMT', 5932 'ETag': '"0-gzip"', 'Content-Encoding': 'gzip'}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0