diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
index 4f1f024353aed07506eb26dd0d4a57a3654b0c3d_Y29udHJpYi9weXRob24zLXdoaXRlbGlzdA==..d4d2c567bb721633acc1d96db89cc46978381c9b_Y29udHJpYi9weXRob24zLXdoaXRlbGlzdA== 100644
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -405,6 +405,7 @@
 test-pager-legacy.t
 test-pager.t
 test-parents.t
+test-parse-date.t
 test-parseindex2.py
 test-patch-offset.t
 test-patch.t
diff --git a/mercurial/utils/dateutil.py b/mercurial/utils/dateutil.py
index 4f1f024353aed07506eb26dd0d4a57a3654b0c3d_bWVyY3VyaWFsL3V0aWxzL2RhdGV1dGlsLnB5..d4d2c567bb721633acc1d96db89cc46978381c9b_bWVyY3VyaWFsL3V0aWxzL2RhdGV1dGlsLnB5 100644
--- a/mercurial/utils/dateutil.py
+++ b/mercurial/utils/dateutil.py
@@ -303,8 +303,8 @@
 
     if not date:
         raise error.Abort(_("dates cannot consist entirely of whitespace"))
-    elif date[0] == "<":
+    elif date[0:1] == b"<":
         if not date[1:]:
             raise error.Abort(_("invalid day spec, use '<DATE'"))
         when = upper(date[1:])
         return lambda x: x <= when
@@ -307,9 +307,9 @@
         if not date[1:]:
             raise error.Abort(_("invalid day spec, use '<DATE'"))
         when = upper(date[1:])
         return lambda x: x <= when
-    elif date[0] == ">":
+    elif date[0:1] == b">":
         if not date[1:]:
             raise error.Abort(_("invalid day spec, use '>DATE'"))
         when = lower(date[1:])
         return lambda x: x >= when
@@ -312,8 +312,8 @@
         if not date[1:]:
             raise error.Abort(_("invalid day spec, use '>DATE'"))
         when = lower(date[1:])
         return lambda x: x >= when
-    elif date[0] == "-":
+    elif date[0:1] == b"-":
         try:
             days = int(date[1:])
         except ValueError:
@@ -323,8 +323,8 @@
                 % date[1:])
         when = makedate()[0] - days * 3600 * 24
         return lambda x: x >= when
-    elif " to " in date:
-        a, b = date.split(" to ")
+    elif b" to " in date:
+        a, b = date.split(b" to ")
         start, stop = lower(a), upper(b)
         return lambda x: x >= start and x <= stop
     else: