Patchwork [5,of,5] node: use byte literals to construct nullid and wdirid

login
register
mail settings
Submitter Gregory Szorc
Date March 12, 2016, 10:11 p.m.
Message ID <940317310320cb10e213.1457820696@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/13837/
State Superseded
Headers show

Comments

Gregory Szorc - March 12, 2016, 10:11 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1457820297 28800
#      Sat Mar 12 14:04:57 2016 -0800
# Node ID 940317310320cb10e213ed4b86ffa48e613ad1e3
# Parent  aef0dc67d0a122bccb66e1ba4ecec4c4ff2324ee
node: use byte literals to construct nullid and wdirid

Python 3's hex() insists on operating on bytes. This patch gives
it what it wants.

'' and b'' in Python 2 are equivalent, so this has no impact on
Python 2.
Pierre-Yves David - March 14, 2016, 2:09 p.m.
On 03/12/2016 10:11 PM, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc@gmail.com>
> # Date 1457820297 28800
> #      Sat Mar 12 14:04:57 2016 -0800
> # Node ID 940317310320cb10e213ed4b86ffa48e613ad1e3
> # Parent  aef0dc67d0a122bccb66e1ba4ecec4c4ff2324ee
> node: use byte literals to construct nullid and wdirid
>
> Python 3's hex() insists on operating on bytes. This patch gives
> it what it wants.
>
> '' and b'' in Python 2 are equivalent, so this has no impact on
> Python 2.

The rest of the series looks good to me, but I would like patch 2 
updated to mention the fact the new flag is temporary on site.

Patch

diff --git a/mercurial/node.py b/mercurial/node.py
--- a/mercurial/node.py
+++ b/mercurial/node.py
@@ -9,18 +9,18 @@  from __future__ import absolute_import
 
 import binascii
 
 # This ugly style has a noticeable effect in manifest parsing
 hex = binascii.hexlify
 bin = binascii.unhexlify
 
 nullrev = -1
-nullid = "\0" * 20
+nullid = b"\0" * 20
 nullhex = hex(nullid)
 
 # pseudo identifiers for working directory
 # (they are experimental, so don't add too many dependencies on them)
 wdirrev = 0x7fffffff
-wdirid = "\xff" * 20
+wdirid = b"\xff" * 20
 
 def short(node):
     return hex(node[:6])
diff --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t
--- a/tests/test-check-py3-compat.t
+++ b/tests/test-check-py3-compat.t
@@ -132,171 +132,164 @@ 
 #if py3exe
   $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs $PYTHON3 contrib/check-py3-compat.py
   contrib/check-code.py: invalid syntax: invalid syntax (<unknown>, line 446)
   contrib/import-checker.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line 569)
   contrib/revsetbenchmarks.py: invalid syntax: invalid syntax (<unknown>, line 186)
   doc/hgmanpage.py: invalid syntax: invalid syntax (<unknown>, line 286)
   hgext/acl.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   hgext/automv.py: error importing module: <SyntaxError> invalid syntax (commands.py, line 3324) (line 29)
-  hgext/blackbox.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  hgext/blackbox.py: error importing: <ImportError> No module named 'cStringIO' (error at cmdutil.py:10)
   hgext/bugzilla.py: error importing module: <ImportError> No module named 'urlparse' (line 284)
-  hgext/censor.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  hgext/censor.py: error importing: <ImportError> No module named 'cStringIO' (error at cmdutil.py:10)
   hgext/chgserver.py: error importing module: <ImportError> No module named 'SocketServer' (line 43)
   hgext/children.py: error importing: <ImportError> No module named 'cStringIO' (error at cmdutil.py:10)
   hgext/churn.py: error importing: <ImportError> No module named 'cStringIO' (error at cmdutil.py:10)
   hgext/clonebundles.py: error importing: <ImportError> No module named 'cStringIO' (error at cmdutil.py:10)
   hgext/color.py: invalid syntax: invalid syntax (<unknown>, line 551)
   hgext/convert/bzr.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line 18)
   hgext/convert/common.py: error importing module: <ImportError> No module named 'cPickle' (line 10)
-  hgext/convert/convcmd.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  hgext/convert/convcmd.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   hgext/convert/cvs.py: error importing module: <ImportError> No module named 'cStringIO' (line 9)
   hgext/convert/cvsps.py: error importing module: <ImportError> No module named 'cPickle' (line 9)
   hgext/convert/darcs.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   hgext/convert/filemap.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line 14)
   hgext/convert/git.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   hgext/convert/gnuarch.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   hgext/convert/hg.py: error importing module: <ImportError> No module named 'cStringIO' (line 21)
   hgext/convert/monotone.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   hgext/convert/p4.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   hgext/convert/subversion.py: error importing module: <ImportError> No module named 'cPickle' (line 6)
   hgext/convert/transport.py: error importing module: <ImportError> No module named 'svn.client' (line 21)
   hgext/eol.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
-  hgext/extdiff.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  hgext/extdiff.py: error importing: <ImportError> No module named 'cStringIO' (error at cmdutil.py:10)
   hgext/factotum.py: error importing: <ImportError> No module named 'cStringIO' (error at url.py:13)
-  hgext/fetch.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  hgext/fetch.py: error importing module: <SyntaxError> invalid syntax (commands.py, line 3324) (line 12)
   hgext/fsmonitor/state.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   hgext/fsmonitor/watchmanclient.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   hgext/gpg.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   hgext/graphlog.py: error importing: <ImportError> No module named 'cStringIO' (error at cmdutil.py:10)
-  hgext/hgcia.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  hgext/hgcia.py: error importing: <ImportError> No module named 'cStringIO' (error at cmdutil.py:10)
   hgext/hgk.py: error importing: <ImportError> No module named 'cStringIO' (error at cmdutil.py:10)
   hgext/highlight/highlight.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   hgext/histedit.py: error importing module: <SyntaxError> invalid syntax (bundle2.py, line 977) (line 177)
   hgext/keyword.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   hgext/largefiles/basestore.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   hgext/largefiles/lfcommands.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
-  hgext/largefiles/lfutil.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  hgext/largefiles/lfutil.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   hgext/largefiles/localstore.py: error importing module: <ImportError> No module named 'lfutil' (line 13)
-  hgext/largefiles/overrides.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  hgext/largefiles/overrides.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   hgext/largefiles/proto.py: error importing module: <ImportError> No module named 'urllib2' (line 7)
   hgext/largefiles/remotestore.py: error importing module: <ImportError> No module named 'urllib2' (line 9)
   hgext/largefiles/reposetup.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   hgext/largefiles/uisetup.py: error importing module: <SyntaxError> invalid syntax (archival.py, line 234) (line 11)
   hgext/largefiles/wirestore.py: error importing module: <ImportError> No module named 'lfutil' (line 8)
-  hgext/mq.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  hgext/mq.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   hgext/notify.py: error importing: <ImportError> No module named 'cStringIO' (error at cmdutil.py:10)
   hgext/pager.py: error importing: <ImportError> No module named 'cStringIO' (error at cmdutil.py:10)
   hgext/patchbomb.py: error importing module: <ImportError> No module named 'cStringIO' (line 68)
   hgext/purge.py: error importing: <ImportError> No module named 'cStringIO' (error at cmdutil.py:10)
-  hgext/rebase.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  hgext/rebase.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   hgext/record.py: error importing: <ImportError> No module named 'cStringIO' (error at cmdutil.py:10)
   hgext/relink.py: error importing: <ImportError> No module named 'cStringIO' (error at cmdutil.py:10)
   hgext/schemes.py: error importing: <ImportError> No module named 'cStringIO' (error at cmdutil.py:10)
   hgext/share.py: error importing: <ImportError> No module named 'cStringIO' (error at cmdutil.py:10)
   hgext/shelve.py: error importing module: <SyntaxError> invalid syntax (bundle2.py, line 977) (line 28)
-  hgext/strip.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
-  hgext/transplant.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
-  hgext/win32text.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
-  mercurial/ancestor.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  hgext/strip.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
+  hgext/transplant.py: error importing: <SyntaxError> invalid syntax (bundle2.py, line 977) (error at bundlerepo.py:23)
+  hgext/win32text.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   mercurial/archival.py: invalid syntax: invalid syntax (<unknown>, line 234)
-  mercurial/bookmarks.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
-  mercurial/branchmap.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  mercurial/bookmarks.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
+  mercurial/branchmap.py: error importing: <ImportError> No module named 'Queue' (error at scmutil.py:10)
   mercurial/bundle2.py: invalid syntax: invalid syntax (<unknown>, line 977)
-  mercurial/bundlerepo.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  mercurial/bundlerepo.py: error importing module: <SyntaxError> invalid syntax (bundle2.py, line 977) (line 23)
   mercurial/byterange.py: error importing module: <ImportError> No module named 'urllib2' (line 30)
-  mercurial/changegroup.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
-  mercurial/changelog.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  mercurial/changegroup.py: error importing: <ImportError> No module named 'Queue' (error at scmutil.py:10)
+  mercurial/changelog.py: error importing: <ImportError> No module named 'cStringIO' (error at mpatch.py:10)
   mercurial/cmdutil.py: error importing module: <ImportError> No module named 'cStringIO' (line 10)
   mercurial/commands.py: invalid syntax: invalid syntax (<unknown>, line 3324)
   mercurial/commandserver.py: error importing module: <ImportError> No module named 'SocketServer' (line 10)
   mercurial/config.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
-  mercurial/context.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
-  mercurial/copies.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  mercurial/context.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
+  mercurial/copies.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   mercurial/crecord.py: error importing module: <ImportError> No module named 'cStringIO' (line 13)
-  mercurial/dagutil.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
-  mercurial/destutil.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
-  mercurial/dirstate.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
-  mercurial/discovery.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  mercurial/destutil.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
+  mercurial/dirstate.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
+  mercurial/discovery.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   mercurial/dispatch.py: error importing: <ImportError> No module named 'cStringIO' (error at cmdutil.py:10)
   mercurial/exchange.py: error importing module: <ImportError> No module named 'urllib2' (line 12)
   mercurial/extensions.py: error importing: <ImportError> No module named 'cStringIO' (error at cmdutil.py:10)
   mercurial/filelog.py: error importing: <ImportError> No module named 'cStringIO' (error at mpatch.py:10)
-  mercurial/filemerge.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
-  mercurial/fileset.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  mercurial/filemerge.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
+  mercurial/fileset.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   mercurial/formatter.py: error importing module: <ImportError> No module named 'cPickle' (line 10)
-  mercurial/graphmod.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
-  mercurial/hbisect.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  mercurial/graphmod.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   mercurial/help.py: error importing: <ImportError> No module named 'cStringIO' (error at cmdutil.py:10)
-  mercurial/hg.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  mercurial/hg.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   mercurial/hgweb/common.py: error importing module: <ImportError> No module named 'BaseHTTPServer' (line 11)
   mercurial/hgweb/hgweb_mod.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line 14)
   mercurial/hgweb/hgwebdir_mod.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line 15)
   mercurial/hgweb/protocol.py: error importing module: <ImportError> No module named 'cStringIO' (line 10)
   mercurial/hgweb/request.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line 15)
   mercurial/hgweb/server.py: error importing module: <ImportError> No module named 'BaseHTTPServer' (line 11)
   mercurial/hgweb/webcommands.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line 16)
   mercurial/hgweb/webutil.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line 16)
   mercurial/hgweb/wsgicgi.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line 16)
   mercurial/hook.py: error importing: <ImportError> No module named 'cStringIO' (error at cmdutil.py:10)
   mercurial/httpclient/_readers.py: error importing module: <ImportError> No module named 'httplib' (line 36)
   mercurial/httpconnection.py: error importing module: <ImportError> No module named 'urllib2' (line 17)
   mercurial/httppeer.py: error importing module: <ImportError> No module named 'httplib' (line 12)
   mercurial/keepalive.py: error importing module: <ImportError> No module named 'httplib' (line 113)
-  mercurial/localrepo.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  mercurial/localrepo.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   mercurial/lock.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   mercurial/mail.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   mercurial/manifest.py: error importing: <ImportError> No module named 'cStringIO' (error at mpatch.py:10)
   mercurial/match.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   mercurial/mdiff.py: error importing: <ImportError> No module named 'cStringIO' (error at mpatch.py:10)
-  mercurial/merge.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  mercurial/merge.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   mercurial/minirst.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
-  mercurial/namespaces.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
-  mercurial/node.py: error importing module: <TypeError> a bytes-like object is required, not 'str' (line 18)
-  mercurial/obsolete.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  mercurial/namespaces.py: error importing: <ImportError> No module named 'cStringIO' (error at patch.py:11)
+  mercurial/obsolete.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   mercurial/patch.py: error importing module: <ImportError> No module named 'cStringIO' (line 11)
   mercurial/pathutil.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   mercurial/peer.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
-  mercurial/phases.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
   mercurial/pure/mpatch.py: error importing module: <ImportError> No module named 'cStringIO' (line 10)
   mercurial/pure/parsers.py: error importing module: <ImportError> No module named 'cStringIO' (line 10)
-  mercurial/pushkey.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
-  mercurial/pvec.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  mercurial/pushkey.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
+  mercurial/pvec.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   mercurial/registrar.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
-  mercurial/repair.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
-  mercurial/repoview.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
-  mercurial/revlog.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
-  mercurial/revset.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  mercurial/repair.py: error importing module: <SyntaxError> invalid syntax (bundle2.py, line 977) (line 15)
+  mercurial/repoview.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
+  mercurial/revlog.py: error importing: <ImportError> No module named 'cStringIO' (error at mpatch.py:10)
+  mercurial/revset.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   mercurial/scmutil.py: error importing module: <ImportError> No module named 'Queue' (line 10)
   mercurial/scmwindows.py: error importing module: <ImportError> No module named '_winreg' (line 3)
-  mercurial/setdiscovery.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
   mercurial/similar.py: error importing: <ImportError> No module named 'cStringIO' (error at mpatch.py:10)
   mercurial/simplemerge.py: error importing: <ImportError> No module named 'cStringIO' (error at mpatch.py:10)
   mercurial/sshpeer.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   mercurial/sshserver.py: error importing: <ImportError> No module named 'cStringIO' (error at cmdutil.py:10)
   mercurial/sslutil.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   mercurial/statichttprepo.py: error importing module: <ImportError> No module named 'urllib2' (line 15)
   mercurial/store.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
-  mercurial/streamclone.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  mercurial/streamclone.py: error importing: <ImportError> No module named 'Queue' (error at scmutil.py:10)
   mercurial/subrepo.py: error importing: <ImportError> No module named 'cStringIO' (error at cmdutil.py:10)
-  mercurial/tagmerge.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
-  mercurial/tags.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
-  mercurial/templatefilters.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
-  mercurial/templatekw.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  mercurial/tagmerge.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
+  mercurial/tags.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
+  mercurial/templatefilters.py: error importing: <ImportError> No module named 'cStringIO' (error at patch.py:11)
+  mercurial/templatekw.py: error importing: <ImportError> No module named 'cStringIO' (error at patch.py:11)
   mercurial/templater.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
   mercurial/transaction.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
-  mercurial/treediscovery.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
-  mercurial/ui.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
-  mercurial/unionrepo.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  mercurial/ui.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
+  mercurial/unionrepo.py: error importing: <ImportError> No module named 'cStringIO' (error at mpatch.py:10)
   mercurial/url.py: error importing module: <ImportError> No module named 'cStringIO' (line 13)
   mercurial/util.py: error importing: <ImportError> No module named 'cStringIO' (error at parsers.py:10)
-  mercurial/verify.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  mercurial/verify.py: error importing: <ImportError> No module named 'cStringIO' (error at mpatch.py:10)
   mercurial/win32.py: error importing module: <ImportError> No module named 'msvcrt' (line 12)
   mercurial/windows.py: error importing module: <ImportError> No module named '_winreg' (line 10)
-  mercurial/wireproto.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at node.py:18)
+  mercurial/wireproto.py: error importing module: <SyntaxError> invalid syntax (bundle2.py, line 977) (line 22)
   tests/filterpyflakes.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line 61)
   tests/generate-working-copy-states.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line 69)
   tests/get-with-headers.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line 44)
   tests/readlink.py: invalid syntax: invalid syntax (<unknown>, line 7)
   tests/seq.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line 23)
   tests/silenttestrunner.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line 11)
   tests/test-ancestor.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line 187)
   tests/test-batching.py: invalid syntax: invalid syntax (<unknown>, line 34)