[PATCH 10 of 10] py3: fix string slicing in util.parsetimezone()

Yuya Nishihara yuya at tcha.org
Thu Mar 1 19:26:29 EST 2018


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1519946158 18000
#      Thu Mar 01 18:15:58 2018 -0500
# Node ID 92dac7bbce17a875c89b9589d1adc14e48e7440e
# Parent  a7eb4c25e04e5be83918ed160dfff78e782165c1
py3: fix string slicing in util.parsetimezone()

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -2353,6 +2353,7 @@ def shortdate(date=None):
 def parsetimezone(s):
     """find a trailing timezone, if any, in string, and return a
        (offset, remainder) pair"""
+    s = pycompat.bytestr(s)
 
     if s.endswith("GMT") or s.endswith("UTC"):
         return 0, s[:-3].rstrip()


More information about the Mercurial-devel mailing list