File tree Expand file tree Collapse file tree
tableauserverclient/server/endpoint Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import cgi
1+ from email . message import Message
22import copy
33import json
44import io
@@ -437,14 +437,16 @@ def download_revision(
437437 url += "?includeExtract=False"
438438
439439 with closing (self .get_request (url , parameters = {"stream" : True })) as server_response :
440- _ , params = cgi .parse_header (server_response .headers ["Content-Disposition" ])
440+ m = Message ()
441+ m ['Content-Disposition' ] = server_response .headers ["Content-Disposition" ]
442+ params = m .get_filename ()
441443 if isinstance (filepath , io_types_w ):
442444 for chunk in server_response .iter_content (1024 ): # 1KB
443445 filepath .write (chunk )
444446 return_path = filepath
445447 else :
446448 params = fix_filename (params )
447- filename = to_filename (os .path .basename (params [ "filename" ] ))
449+ filename = to_filename (os .path .basename (params ))
448450 download_path = make_download_path (filepath , filename )
449451 with open (download_path , "wb" ) as f :
450452 for chunk in server_response .iter_content (1024 ): # 1KB
You can’t perform that action at this time.
0 commit comments