[PATCH 06 of 12 py3] manifest: ensure paths are bytes (not str) in pure parser

Augie Fackler raf at durin42.com
Sun Mar 12 15:49:55 EDT 2017


# HG changeset patch
# User Augie Fackler <augie at google.com>
# Date 1489303914 14400
#      Sun Mar 12 03:31:54 2017 -0400
# Node ID 5a0a53d127726a34013a34156d47ab873f6dc8df
# Parent  9b0c4bba327a1c1809fc5e7da184c695561e272c
manifest: ensure paths are bytes (not str) in pure parser

diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -255,8 +255,8 @@ class _lazymanifest(object):
         return self.data[start:end]
 
     def __getitem__(self, key):
-        if not isinstance(key, str):
-            raise TypeError("getitem: manifest keys must be a string.")
+        if not isinstance(key, bytes):
+            raise TypeError("getitem: manifest keys must be a bytes.")
         needle = self.bsearch(key)
         if needle == -1:
             raise KeyError


More information about the Mercurial-devel mailing list