utils/web.py: Python 3 should use decode() only if it is a bytes object.