We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5190ef7 commit f746507Copy full SHA for f746507
src/pip/_internal/configuration.py
@@ -210,8 +210,16 @@ def save(self) -> None:
210
# Ensure directory exists.
211
ensure_dir(os.path.dirname(fname))
212
213
- with open(fname, "w") as f:
214
- parser.write(f)
+ # Ensure directory's permission(need to be writeable)
+ if os.access(fname, os.W_OK):
215
+ with open(fname, "w") as f:
216
+ parser.write(f)
217
+ else:
218
+ raise ConfigurationError(
219
+ "Configuation file not writeable".format(
220
+ ": ".join(fname)
221
+ )
222
223
224
#
225
# Private routines
0 commit comments