Make updates.py compatible with Python 3

A limitation is that I do not set the default encoding (utf-8) in Python 3, but otherwise this code works with both Python 2 and 3.