Patchwork D7944: localrepo: handle ValueError during repository opening

login
register
mail settings
Submitter phabricator
Date June 9, 2020, 11:51 a.m.
Message ID <77adf855798452a9a19ccc286ba85f83@localhost.localdomain>
Download mbox | patch
Permalink /patch/46487/
State Not Applicable
Headers show

Comments

phabricator - June 9, 2020, 11:51 a.m.
Closed by commit rHG9e5b4dbe8ff2: localrepo: handle ValueError during repository opening (authored by indygreg).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Revision".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7944?vs=19448&id=21586

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7944/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7944

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS




To: indygreg, #hg-reviewers, marmoute, baymax, pulkit
Cc: mercurial-patches, marmoute, mercurial-devel

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -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)