# HG changeset patch # User Yuya Nishihara # Date 1506506672 -32400 # Node ID 8cbcee0b923d78d93776eddc0740631931fb7f68 # Parent c41444a39de25167cb965b8c3591a4e4910c4300 py3: remove use of str() in hgwebdir '%d' can't be used here since port may be either integer or byte string. diff -r c41444a39de2 -r 8cbcee0b923d mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py Wed Sep 27 18:07:48 2017 -0700 +++ b/mercurial/hgweb/hgwebdir_mod.py Wed Sep 27 19:04:32 2017 +0900 @@ -34,6 +34,7 @@ error, hg, profiling, + pycompat, scmutil, templater, ui as uimod, @@ -106,7 +107,7 @@ if not path.startswith('/'): path = '/' + path - return name, str(port), path + return name, pycompat.bytestr(port), path class hgwebdir(object): """HTTP server for multiple repositories. @@ -293,7 +294,7 @@ msg = encoding.strtolocal(inst.strerror) raise ErrorResponse(HTTP_SERVER_ERROR, msg) except error.RepoError as inst: - raise ErrorResponse(HTTP_SERVER_ERROR, str(inst)) + raise ErrorResponse(HTTP_SERVER_ERROR, bytes(inst)) # browse subdirectories subdir = virtual + '/' diff -r c41444a39de2 -r 8cbcee0b923d tests/test-doctest.py --- a/tests/test-doctest.py Wed Sep 27 18:07:48 2017 -0700 +++ b/tests/test-doctest.py Wed Sep 27 19:04:32 2017 +0900 @@ -53,7 +53,7 @@ testmod('mercurial.encoding') testmod('mercurial.formatter') testmod('mercurial.hg') -testmod('mercurial.hgweb.hgwebdir_mod', py3=False) # py3: repr(bytes) ? +testmod('mercurial.hgweb.hgwebdir_mod') testmod('mercurial.match') testmod('mercurial.mdiff') testmod('mercurial.minirst')