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

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Stdout = outfile in subprocess.run funktioniert nicht mit der Shell pg_restore

by Anonymous » 06 Feb 2025, 08:56

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})

Top