diff -r e7eea8582afa -r 56df2ca5c032 mercurial/subrepo.py --- a/mercurial/subrepo.py Thu Apr 12 14:26:31 2018 +0530 +++ b/mercurial/subrepo.py Thu Apr 12 14:28:08 2018 +0530 @@ -1637,7 +1637,7 @@ # This should be much faster than manually traversing the trees # and objects with many subprocess calls. tarstream = self._gitcommand(['archive', revision], stream=True) - tar = tarfile.open(fileobj=tarstream, mode='r|') + tar = tarfile.open(fileobj=tarstream, mode=r'r|') relpath = subrelpath(self) self.ui.progress(_('archiving (%s)') % relpath, 0, unit=_('files')) for i, info in enumerate(tar):