File tree 3 files changed +5
-3
lines changed
3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ def _add_scripts(self):
131
131
entry_points = self .convert_entry_points ()
132
132
133
133
for scripts_path in self ._env .script_dirs :
134
- if is_dir_writable (scripts_path ):
134
+ if is_dir_writable (path = scripts_path , create = True ):
135
135
break
136
136
else :
137
137
self ._io .error_line (
Original file line number Diff line number Diff line change @@ -170,7 +170,7 @@ def writable_candidates(self): # type: () -> List[Path]
170
170
171
171
self ._writable_candidates = []
172
172
for candidate in self ._candidates :
173
- if not is_dir_writable (candidate ):
173
+ if not is_dir_writable (path = candidate , create = True ):
174
174
continue
175
175
self ._writable_candidates .append (candidate )
176
176
Original file line number Diff line number Diff line change 5
5
from poetry .utils .env import SitePackages
6
6
7
7
8
- def test_env_site_simple (tmp_dir ):
8
+ def test_env_site_simple (tmp_dir , mocker ):
9
+ # emulate permission error when creating directory
10
+ mocker .patch ("poetry.utils._compat.Path.mkdir" , side_effect = OSError ())
9
11
site_packages = SitePackages (Path ("/non-existent" ), fallbacks = [Path (tmp_dir )])
10
12
candidates = site_packages .make_candidates (Path ("hello.txt" ), writable_only = True )
11
13
hello = Path (tmp_dir ) / "hello.txt"
You can’t perform that action at this time.
0 commit comments