bpo-25711: Rewrite zipimport in pure Python. by serhiy-storchaka · Pull Request #6809 · python/cpython (original) (raw)

For raising a proper FileNotFoundError you need to specify the corresponding errno.

import errno raise FileNotFoundError(errno.ENOENT, 'No such file or directory', key)

(and maybe using pathname is more proper than key).

I prefer to defer this change to later. It is nontrivial and may need additional discussion and tests.