bpo-41718: subprocess imports grp and pwd on demand by vstinner · Pull Request #24987 · python/cpython

Conversation

@vstinner

The shutil and subprocess modules now only import the grp and pwd
modules when they are needed, which is not the case by default in
subprocess.

https://bugs.python.org/issue41718

The shutil and subprocess modules now only import the grp and pwd
modules when they are needed, which is not the case by default in
subprocess.

@vstinner

@gpshead: Would you mind to review this change? Does it sound worth it to you?

I have no idea if this change has an impact on subprocess.Popen performance when the user/group options are used. An import should be efficient if it's already in sys.modules.

gpshead

@vstinner

Labels