From f38336a795dd9ae1a11de8ead0e9d00e4151c889 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Sat, 18 Jun 2022 21:05:22 +0300 Subject: [PATCH] [~] Refactor --- d1/f2.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/d1/f2.py b/d1/f2.py index 4fd4c75..c132441 100644 --- a/d1/f2.py +++ b/d1/f2.py @@ -35,6 +35,9 @@ def application(environ, start_response): protocol=environ['SERVER_PROTOCOL'], ) try: + with io.open('2.dat', 'wb') as f: + f.write(t3) + t17 = [ 'curl', 'http://127.0.0.1:9050%s' % t7['uri'], @@ -43,7 +46,7 @@ def application(environ, start_response): for k, v in t2.items() ], []), '-X', t7['method'], - '-d', '@-', + '--data-binary', '@2.dat', '--max-filesize', '%d' % (60 * 1024 * 1024), '-o', '1.dat', '-v', @@ -54,9 +57,6 @@ def application(environ, start_response): with subprocess.Popen( t17, stderr=subprocess.PIPE, stdout=subprocess.PIPE, stdin=subprocess.PIPE ) as p: - p.stdin.write(t3) - p.stdin.flush() - p.stdin.close() try: p.wait(20) response_headers = [