# HG changeset patch # User Pierre-Yves David # Date 1693351410 -7200 # Node ID b3174be5e7f79efc0c838d4a2406898e13b1fdbf # Parent d97227f42558c0b51eea2003ffa75446bd95ea83 localrepo: purge filecache attribute using there unicode name This could be better, but that's a good step. diff -r d97227f42558 -r b3174be5e7f7 mercurial/localrepo.py --- a/mercurial/localrepo.py Thu Aug 31 01:21:57 2023 +0200 +++ b/mercurial/localrepo.py Wed Aug 30 01:23:30 2023 +0200 @@ -3028,7 +3028,11 @@ if clearfilecache: del self._filecache[k] try: - delattr(unfiltered, k) + # XXX ideally, the key would be a unicode string to match the + # fact it refers to an attribut name. However changing this was + # a bit a scope creep compared to the series cleaning up + # del/set/getattr so we kept thing simple here. + delattr(unfiltered, pycompat.sysstr(k)) except AttributeError: pass self.invalidatecaches() diff -r d97227f42558 -r b3174be5e7f7 mercurial/scmutil.py --- a/mercurial/scmutil.py Thu Aug 31 01:21:57 2023 +0200 +++ b/mercurial/scmutil.py Wed Aug 30 01:23:30 2023 +0200 @@ -1692,6 +1692,10 @@ def __call__(self, func): self.func = func self.sname = func.__name__ + # XXX We should be using a unicode string instead of bytes for the main + # name (and the _filecache key). The fact we use bytes is a remains + # from Python2, since the name is derived from an attribute name a + # `str` is a better fit now that we support Python3 only self.name = pycompat.sysbytes(self.sname) return self