From a953217740674287564d45837c4b26a7850df0d7 Mon Sep 17 00:00:00 2001 From: bfis Date: Thu, 18 Nov 2021 01:18:09 +0100 Subject: [PATCH] Set errno on NotWritableError (#9789) The `NotWritableError` exception does accept the `errno` argument, but does not pass it to `OSError` (its 2nd parent class). This causes the `errno` attribute to be unset (defaults to `None`). Co-authored-by: Michael C. Grant --- conda/exceptions.py | 1 + 1 file changed, 1 insertion(+) diff --git a/conda/exceptions.py b/conda/exceptions.py index 5ece2830619..af030ab30c8 100644 --- a/conda/exceptions.py +++ b/conda/exceptions.py @@ -892,6 +892,7 @@ def __init__(self, path, errno, **kwargs): 'gid': os.getegid(), }) super(NotWritableError, self).__init__(message, **kwargs) + self.errno = errno class NoWritableEnvsDirError(CondaError):