Dvorapa added a comment.
In T243710#5833799 <https://phabricator.wikimedia.org/T243710#5833799>, @Xqt wrote: > Have a look at `test_url_encoding_from_basestring`: The code (in `api_tests` and `api` as well as in Python 2.7.4) hasn't been changed for 5 years. Probably it was never tested or not tested for a Long time before rPWBCff6c72e <https://phabricator.wikimedia.org/rPWBCff6c72ebbda7dbbb801b679876730314165223f5>. Does it work on Travis? See T121318 <https://phabricator.wikimedia.org/T121318>. This seems to be a bug in urllib: urllib tries all the possible way to make `query` **bytes** (str) and finally it does `s.rstrip('/')` on it. This works quite good, until **we** use `from __future__ import unicode_literals` in our code. This makes `s.rstrip(u'/')`, but s is bytes, which produces the error. Either we should disable `unicode_literals` for urllib somehow or use other option than urllib or just ignore this and deprecate Python 2 ASAP TASK DETAIL https://phabricator.wikimedia.org/T243710 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Dvorapa Cc: Mpaa, murfel, Dvorapa, Aklapper, pywikibot-bugs-list, Xqt, Un1tY, Zkhalido, Hook696, Daryl-TTMG, RomaAmorRoma, 0010318400, E.S.A-Sheild, AramBakir, Meekrab2012, joker88john, Viztor, CucyNoiD, NebulousIris, Wenyi, Gaboe420, Versusxo, Majesticalreaper22, Giuliamocci, Adrian1985, Cpaulf30, Af420, Darkminds3113, Bsandipan, Lordiis, Adik2382, Th3d3v1ls, Ramalepe, Liugev6, Tbscho, MayS, WSH1906, Lewizho99, Mdupont, JJMC89, Maathavan, Altostratus, Avicennasis, mys_721tx, jayvdb, Masti, Alchimista, Rxy
_______________________________________________ pywikibot-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs
