Commit 28b1ba2
gh-131484: Document that a directory or zipfile script stays on sys.path
-P, -I and PYTHONSAFEPATH drop the implicit sys.path[0] entries (current
directory, script directory, empty string), but a directory or zipfile named
as the script argument is still prepended: that entry is used to locate
__main__.py and makes other modules stored in the target importable. The -P
section currently enumerates only the -m, script and -c/REPL cases.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 8b048eb commit 28b1ba2
2 files changed
Lines changed: 14 additions & 4 deletions
File tree
- Doc/using
- Misc/NEWS.d/next/Documentation
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| |||
362 | 363 | | |
363 | 364 | | |
364 | 365 | | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
365 | 373 | | |
366 | 374 | | |
367 | 375 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments