Skip to content

Commit 5ebca14

Browse files
authored
PEP 810: Clarify security implications (#4660)
1 parent 5d71d76 commit 5ebca14

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

peps/pep-0810.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -924,11 +924,15 @@ display lazy proxies before first use and the real objects thereafter.
924924
Security Implications
925925
=====================
926926

927-
There are no known security vulnerabilities introduced by lazy imports.
928-
Security-sensitive tools that need to ensure all imports are evaluated eagerly
929-
can use :func:`!sys.set_lazy_imports` with ``"none"`` to force
930-
eager evaluation, or use :func:`!sys.set_lazy_imports_filter` for fine-grained
931-
control.
927+
Tools that install packages while performing imports from that the same
928+
environment should ensure all modules are imported eagerly, or reified, before
929+
the installation step, to avoid newly installed distributions from shadowing
930+
them.
931+
932+
Such tools can use :func:`!sys.set_lazy_imports` with ``"none"`` to
933+
force eager evaluation, or provide a :func:`!sys.set_lazy_imports_filter` function for
934+
fine-grained control.
935+
932936

933937
How to Teach This
934938
=================

0 commit comments

Comments
 (0)