Why not using urllib.urlencode?