##// END OF EJS Templates
tests: test-archive.t use sys.stdout.buffer for binary output in py3
timeless -
r29182:6c0b1d96 default
parent child Browse files
Show More
@@ -86,9 +86,13 b' invalid arch type should give 404'
86 > node, archive, file = sys.argv[1:]
86 > node, archive, file = sys.argv[1:]
87 > requeststr = 'cmd=archive;node=%s;type=%s;file=%s' % (node, archive, file)
87 > requeststr = 'cmd=archive;node=%s;type=%s;file=%s' % (node, archive, file)
88 > try:
88 > try:
89 > stdout = sys.stdout.buffer
90 > except AttributeError:
91 > stdout = sys.stdout
92 > try:
89 > f = urllib2.urlopen('http://127.0.0.1:%s/?%s'
93 > f = urllib2.urlopen('http://127.0.0.1:%s/?%s'
90 > % (os.environ['HGPORT'], requeststr))
94 > % (os.environ['HGPORT'], requeststr))
91 > sys.stdout.write(f.read())
95 > stdout.write(f.read())
92 > except urllib2.HTTPError, e:
96 > except urllib2.HTTPError, e:
93 > sys.stderr.write(str(e) + '\n')
97 > sys.stderr.write(str(e) + '\n')
94 > EOF
98 > EOF
General Comments 0
You need to be logged in to leave comments. Login now