##// END OF EJS Templates
run-tests: write out scripts in binary mode...
Augie Fackler -
r21916:792ebd7d default
parent child Browse files
Show More
@@ -112,7 +112,7 b' def parselistfiles(files, listtype, warn'
112 for filename in files:
112 for filename in files:
113 try:
113 try:
114 path = os.path.expanduser(os.path.expandvars(filename))
114 path = os.path.expanduser(os.path.expandvars(filename))
115 f = open(path, "r")
115 f = open(path, "rb")
116 except IOError, err:
116 except IOError, err:
117 if err.errno != errno.ENOENT:
117 if err.errno != errno.ENOENT:
118 raise
118 raise
@@ -402,7 +402,7 b' class Test(unittest.TestCase):'
402 if debug:
402 if debug:
403 self._refout = None # to match "out is None"
403 self._refout = None # to match "out is None"
404 elif os.path.exists(self.refpath):
404 elif os.path.exists(self.refpath):
405 f = open(self.refpath, 'r')
405 f = open(self.refpath, 'rb')
406 self._refout = f.read().splitlines(True)
406 self._refout = f.read().splitlines(True)
407 f.close()
407 f.close()
408 else:
408 else:
@@ -644,7 +644,7 b' class Test(unittest.TestCase):'
644
644
645 def _createhgrc(self, path):
645 def _createhgrc(self, path):
646 """Create an hgrc file for this test."""
646 """Create an hgrc file for this test."""
647 hgrc = open(path, 'w')
647 hgrc = open(path, 'wb')
648 hgrc.write('[ui]\n')
648 hgrc.write('[ui]\n')
649 hgrc.write('slash = True\n')
649 hgrc.write('slash = True\n')
650 hgrc.write('interactive = False\n')
650 hgrc.write('interactive = False\n')
@@ -701,7 +701,7 b' class TTest(Test):'
701 return os.path.join(self._testdir, self.name)
701 return os.path.join(self._testdir, self.name)
702
702
703 def _run(self, replacements, env):
703 def _run(self, replacements, env):
704 f = open(self.path)
704 f = open(self.path, 'rb')
705 lines = f.readlines()
705 lines = f.readlines()
706 f.close()
706 f.close()
707
707
@@ -709,7 +709,7 b' class TTest(Test):'
709
709
710 # Write out the generated script.
710 # Write out the generated script.
711 fname = '%s.sh' % self._testtmp
711 fname = '%s.sh' % self._testtmp
712 f = open(fname, 'w')
712 f = open(fname, 'wb')
713 for l in script:
713 for l in script:
714 f.write(l)
714 f.write(l)
715 f.close()
715 f.close()
@@ -1237,7 +1237,7 b' class TestSuite(unittest.TestSuite):'
1237 continue
1237 continue
1238
1238
1239 if self._keywords:
1239 if self._keywords:
1240 f = open(test.path)
1240 f = open(test.path, 'rb')
1241 t = f.read().lower() + test.name.lower()
1241 t = f.read().lower() + test.name.lower()
1242 f.close()
1242 f.close()
1243 ignored = False
1243 ignored = False
@@ -1697,7 +1697,7 b' class TestRunner(object):'
1697 if not self.options.verbose:
1697 if not self.options.verbose:
1698 os.remove(installerrs)
1698 os.remove(installerrs)
1699 else:
1699 else:
1700 f = open(installerrs)
1700 f = open(installerrs, 'rb')
1701 for line in f:
1701 for line in f:
1702 print line,
1702 print line,
1703 f.close()
1703 f.close()
@@ -1708,11 +1708,11 b' class TestRunner(object):'
1708
1708
1709 if self.options.py3k_warnings and not self.options.anycoverage:
1709 if self.options.py3k_warnings and not self.options.anycoverage:
1710 vlog("# Updating hg command to enable Py3k Warnings switch")
1710 vlog("# Updating hg command to enable Py3k Warnings switch")
1711 f = open(os.path.join(self._bindir, 'hg'), 'r')
1711 f = open(os.path.join(self._bindir, 'hg'), 'rb')
1712 lines = [line.rstrip() for line in f]
1712 lines = [line.rstrip() for line in f]
1713 lines[0] += ' -3'
1713 lines[0] += ' -3'
1714 f.close()
1714 f.close()
1715 f = open(os.path.join(self._bindir, 'hg'), 'w')
1715 f = open(os.path.join(self._bindir, 'hg'), 'wb')
1716 for line in lines:
1716 for line in lines:
1717 f.write(line + '\n')
1717 f.write(line + '\n')
1718 f.close()
1718 f.close()
General Comments 0
You need to be logged in to leave comments. Login now