Skip to content

Commit 05e936a

Browse files
committed
Add permission check before configuration7
1 parent 05fe417 commit 05e936a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pip/_internal/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def iter_config_files(self) -> Iterable[Tuple[Kind, List[str]]]:
345345
# per-user configuration next
346346
should_load_user_config = not self.isolated and not (
347347
config_file and os.path.exists(config_file)
348-
)
348+
) or not os.access(config_file[kinds.SITE], os.W_OK)
349349
if should_load_user_config:
350350
# The legacy config file is overridden by the new config file
351351
yield kinds.USER, config_files[kinds.USER]

0 commit comments

Comments
 (0)