# HG changeset patch # User Patrick Mezard # Date 1222627238 -7200 # Node ID 9ea5ac3258b6c5549fa53dc94295dde0af192762 # Parent 06b69a53ab0fcbe74f86742cc6b27cdb763c177a get-with-headers: fix stream modes under Windows [ original upstream descripton ] diff -r 06b69a53ab0f -r 9ea5ac3258b6 tests/get-with-headers.py --- a/tests/get-with-headers.py Wed Nov 28 08:38:42 2007 -0800 +++ b/tests/get-with-headers.py Sun Sep 28 20:40:38 2008 +0200 @@ -4,6 +4,14 @@ a subset of the headers plus the body of the result.""" import httplib, sys + +try: + import msvcrt, os + msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) + msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) +except ImportError: + pass + headers = [h.lower() for h in sys.argv[3:]] conn = httplib.HTTPConnection(sys.argv[1]) conn.request("GET", sys.argv[2])