Keep py3.X compatibility for urllib.urlencode

For py3.X, urllib has no attr urlencode while python 2 has.
Change urlencode to keep compatibility.

Partial-Bug: #1280105

Change-Id: I2c0447af3206cdfc55ba22748b2793de8eb94cfb
Merge "Keep py3.X compatibility for urllib.urlencode"