Fix Python 2/3 compatibility in the NamedTemporaryFile stuff

Signed-off-by: Bryan W. Weber <bryan@bryanwweber.com>
Fix error when eqRatio is not in the keywords

Signed-off-by: Bryan W. Weber <bryan@bryanwweber.com>