import subprocess # To run this testcase you need to have the two files: 'd:\temp\db\pw.cnf' and # 'D:\\temp\\db\\export.sql'. # d:\temp\db\pw.cnf # [client] # password="xxxxxxxx" # D:\\temp\\db\\export.sql contains a db dump # These are the relevant lines of modules\wb_admin_export.py, class: DumpThread, # method: process_db, (around line 166) logstr = '"C:\\Program Files (x86)\\MySQL\\MySQL Workbench CE 6.1.7\\mysql.exe" --defaults-file="d:\\temp\\db\\pw.cnf --host=localhost --user=root --database=a1 < "D:\\temp\\db\\export.sql"' cmd = logstr info = subprocess.STARTUPINFO() # original line (A) #p1 = subprocess.Popen(cmd,stdout=subprocess.PIPE,stdin=subprocess.PIPE, stderr=subprocess.PIPE,startupinfo=info,shell=logstr[0] != '"') #modified p1 = subprocess.Popen(cmd,stdout=subprocess.PIPE,stdin=subprocess.PIPE, stderr=subprocess.PIPE,startupinfo=info,shell=True) # this line blocks with the original line (A, see above) print(p1.stderr.read())