This is an archive of the discontinued LLVM Phabricator instance.

[LNT] Python 3 support: use Python 3 urllib
ClosedPublic

Authored by thopre on Sep 21 2019, 10:19 AM.

Details

Summary

Adapt imports to urllib and urllib2 to rely on Python 3 module
organization by installing them as aliases. This was produced by running
futurize's stage2 libfuturize.fixes.fix_future_standard_library_urllib
and adapted manually to remove excess import and fix up str to byte
conversion of urlencode result.

Event Timeline

thopre created this revision.Sep 21 2019, 10:19 AM
lnt/util/ServerUtil.py
45

I think .encode(encoding='ascii') makes it more clear that the Python 2 and Python 3 behavior of this is not going to diverge.

thopre updated this revision to Diff 221202.Sep 21 2019, 2:57 PM

Encode URL in ascii for real compability with Python2

This revision is now accepted and ready to land.Sep 21 2019, 3:49 PM
thopre updated this revision to Diff 232277.Dec 5 2019, 1:49 AM

Rebase earlier in the patch series since it's already approved