BUG: Use io.open instead of open for compatibility.

The recent Python 3 fix adding encoding="utf-8" to the open function
fails on Python 2 because the encoding keyword is not defined. The
solution is to use io.open, which is available for Python 2.6 and 2.7
and is an alias for open when Python >= 3.0. It is reputed to be slow
when running in 2.6, but that should not be a problem.
Merge pull request #3623 from charris/fix-postprocess-script

BUG: Use io.open instead of open for compatibility.