PyUtilib / pyutilib

A collection of general Python utilities, including logging and file IO, subprocess management, plugin systems, and workflow management.
BSD 3-Clause "New" or "Revised" License
34 stars 21 forks source link

Fix UnboundLocalError (subprocess died before reader threads started). #49

Closed jsiirola closed 5 years ago

jsiirola commented 5 years ago

Summary/Motivation:

This resolves an exception that is due to a timing error where a subprocess can die before the I/O reader thread is launched. The cleanup routines need to verify that the threads were created before joining them.

The original error was reported on the Pyomo Forum

Changes proposed in this PR:

Legal Acknowledgement

By contributing to this software project, I agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.
coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.0009%) to 63.973% when pulling 85b13d0393133c2b40b1589263d027feb09efa6d on subprocess_th_fix into 89086c2e09d60c854c1255ce7256998aee3f552d on master.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.0009%) to 63.973% when pulling 85b13d0393133c2b40b1589263d027feb09efa6d on subprocess_th_fix into 89086c2e09d60c854c1255ce7256998aee3f552d on master.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.0009%) to 63.973% when pulling 85b13d0393133c2b40b1589263d027feb09efa6d on subprocess_th_fix into 89086c2e09d60c854c1255ce7256998aee3f552d on master.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.01%) to 63.985% when pulling 85b13d0393133c2b40b1589263d027feb09efa6d on subprocess_th_fix into 89086c2e09d60c854c1255ce7256998aee3f552d on master.