pypa / pip-audit

Audits Python environments, requirements files and dependency trees for known security vulnerabilities, and can automatically fix them
https://pypi.org/project/pip-audit/
Apache License 2.0
964 stars 63 forks source link

Fix pipe reading hanging indefinitely on Windows #756

Closed mathbou closed 5 months ago

mathbou commented 6 months ago

While doing tests with pip-audit, I noticed several times the process stalling while installing the isolated env.

By removing the stdout/stderr read size, it seems to run properly, however it's quite tricky to reproduce.

woodruffw commented 5 months ago

I'm acknowledging this PR so you know I'm not ignoring it, but JFYI: I'm pretty backlogged at the moment, so I can't guarantee a timely review here 🙂

woodruffw commented 5 months ago

Took a look, and I have no major objection to removing the explicit buffer sizes. That being said, it'd be ideal to have a better understanding of why this would deadlock on Windows: we set bufsize=0 so the pipe should be unbuffered regardless of OS, meaning that neither read() should ever block.