diff --git a/gitubuntu/git_repository.py b/gitubuntu/git_repository.py
index 82c9434..43e5d0d 100644
--- a/gitubuntu/git_repository.py
+++ b/gitubuntu/git_repository.py
@@ -466,7 +466,8 @@ class GitUbuntuRepository:
except CalledProcessError:
raise GitUbuntuChangelogError('Unable to extract file')
- if '%s missing' % changelog_file in open(outfile).read():
+ outfile.seek(0)
+ if '%s missing' % changelog_file in outfile.read():
raise GitUbuntuChangelogError('debian/changelog not found in '
'%s' % treeish)