Stdout = outfile in subprocess.run funktioniert nicht mit der Shell pg_restorePython

Python-Programme
Anonymous
 Stdout = outfile in subprocess.run funktioniert nicht mit der Shell pg_restore

Post by Anonymous »

Ich bin gespannt, warum die Option stdout = outfile in subprocess.run nicht mit der Shell pg_resotre funktioniert. Die Ausgabe des Shell PSQL wird jedoch tatsächlich in die von mir angegebene Ausgabedatei umgeleitet. Was habe ich verpasst?

Code: Select all

with open("stdout.log", "w") as outfile:
subprocess.run(['/usr/bin/pg_restore', '-w', '-v', '-U', user, '-h', host, '-F', 'd', '-j', '3', '-d', db, directory], stdout=outfile, text=True, env={'PGPASSFILE': pgpassfile})

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post