added fix that allows regressions tests to work on pythons > 3.1

python 3.1 changed the urllib api.  This catches those cases and uses the new api.