Commit 0ecb0df
gh-157146: Accept relative archive paths and tighten the lookup
zipimporter does not absolutize its sys.path entry, so a relative entry
gives its modules a relative __file__ and a relative key in
sys.path_importer_cache; the isabs() guard made linecache skip exactly
that case. Build the cache entry once for both the loader and the
archive lookups, and only import importlib.util once there is data to
decode.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016oQeaTzLMBouqehAe3W2EU1 parent 44ede9e commit 0ecb0df
2 files changed
Lines changed: 23 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
| |||
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
169 | 162 | | |
170 | 163 | | |
171 | 164 | | |
| |||
220 | 213 | | |
221 | 214 | | |
222 | 215 | | |
223 | | - | |
224 | 216 | | |
225 | 217 | | |
226 | | - | |
227 | | - | |
228 | 218 | | |
229 | 219 | | |
230 | 220 | | |
| |||
239 | 229 | | |
240 | 230 | | |
241 | 231 | | |
| 232 | + | |
242 | 233 | | |
243 | 234 | | |
244 | 235 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
444 | 444 | | |
445 | 445 | | |
446 | 446 | | |
447 | | - | |
448 | | - | |
449 | 447 | | |
450 | | - | |
451 | | - | |
452 | | - | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
453 | 465 | | |
454 | 466 | | |
455 | 467 | | |
| |||
0 commit comments