softwarefactory-project / rdopkg

power to the packagers
Apache License 2.0
28 stars 21 forks source link

Possible leaking of subprocess PIPE #103

Open fuzzball81 opened 7 years ago

fuzzball81 commented 7 years ago

In utils.cmd.run (utils/cmd.py) several subprocess.PIPE instances are spawned and never closed, which can cause a leak.

fuzzball81 commented 7 years ago

I would suggest using a finally clause as part of the try... except to ensure they are always cleaned up in either a good or failing case.

fuzzball81 commented 7 years ago

May also want to investigate using subprocess.check_call or subprocess.check_output in place of using subprocess.Popen. This will remove the need for the pipes.

yac commented 7 years ago

I'd expect the python interpreter to close them automatically on garbage collection, but you might be right.

I see this as a low priority before 1.0 - please feel free to submit a fix :)