diff --git a/gclient_utils.py b/gclient_utils.py index 78c08b1b6..465395344 100644 --- a/gclient_utils.py +++ b/gclient_utils.py @@ -597,6 +597,7 @@ def CheckCallAndFilter(args, stdout=None, filter_fn=None, if len(in_line): filter_fn(in_line) rv = kid.wait() + kid.stdout.close() # Don't put this in a 'finally,' since the child may still run if we get # an exception. diff --git a/git_cache.py b/git_cache.py index c1166303e..45c63b4e0 100755 --- a/git_cache.py +++ b/git_cache.py @@ -537,6 +537,7 @@ class Mirror(object): [self.git_exe, 'config', '--get-all', 'remote.origin.fetch'], cwd=rundir).strip().splitlines() for spec in fetch_specs: + spec = spec.decode() try: self.print('Fetching %s' % spec) with self.print_duration_of('fetch %s' % spec): @@ -885,4 +886,4 @@ if __name__ == '__main__': sys.exit(main(sys.argv[1:])) except KeyboardInterrupt: sys.stderr.write('interrupted\n') - sys.exit(1) \ No newline at end of file + sys.exit(1) diff --git a/tests/git_cache_test.py b/tests/git_cache_test.py index afa2b4612..399ff0da4 100755 --- a/tests/git_cache_test.py +++ b/tests/git_cache_test.py @@ -52,7 +52,7 @@ class GitCacheTest(unittest.TestCase): mirror = git_cache.Mirror('test://phony.example.biz') for fetch_specs, expected in testData: mirror = git_cache.Mirror('test://phony.example.biz', refs=fetch_specs) - self.assertItemsEqual(mirror.fetch_specs, expected) + self.assertEqual(mirror.fetch_specs, set(expected)) def testPopulate(self): self.git(['init', '-q']) @@ -115,13 +115,13 @@ class GitCacheDirTest(unittest.TestCase): old = git_cache.Mirror._GIT_CONFIG_LOCATION try: try: - os.write(fd, '[cache]\n cachepath="hello world"\n') + os.write(fd, b'[cache]\n cachepath="hello world"\n') finally: os.close(fd) git_cache.Mirror._GIT_CONFIG_LOCATION = ['-f', tmpFile] - self.assertEqual(git_cache.Mirror.GetCachePath(), 'hello world') + self.assertEqual(git_cache.Mirror.GetCachePath(), b'hello world') finally: git_cache.Mirror._GIT_CONFIG_LOCATION = old os.remove(tmpFile)