# HG changeset patch # User Gregory Szorc # Date 1579370827 28800 # Node ID 9e5b4dbe8ff2469315e7ea01a34aedf4137b5481 # Parent 25512a65cefdf84a4960561c145ccbd14d253a02 localrepo: handle ValueError during repository opening Python 3.8 can raise ValueError on attempt of an I/O operation against an illegal path. This was causing test-remotefilelog-gc.t to fail on Python 3.8. This commit teaches repository opening to handle ValueError and re-raise an Abort on failure. An arguably better solution would be to implement this logic in the vfs layer. But that seems like a bag of worms and I don't want to go down that rabbit hole. Until users report uncaught ValueError exceptions in the wild, I think it is fine to patch this at the only occurrence our test harness is finding it. Differential Revision: https://phab.mercurial-scm.org/D7944 diff -r 25512a65cefd -r 9e5b4dbe8ff2 mercurial/localrepo.py --- a/mercurial/localrepo.py Wed May 27 12:56:13 2020 +0200 +++ b/mercurial/localrepo.py Sat Jan 18 10:07:07 2020 -0800 @@ -509,6 +509,11 @@ except OSError as e: if e.errno != errno.ENOENT: raise + except ValueError as e: + # Can be raised on Python 3.8 when path is invalid. + raise error.Abort( + _(b'invalid path %s: %s') % (path, pycompat.bytestr(e)) + ) raise error.RepoError(_(b'repository %s not found') % path)