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