python url encoding; handle url params properly