Dvorapa added a comment.

  Okay, tried to reproduce and here is what happens:
  
    $ python2
    Python 2.7.17 (default, Oct 22 2019, 09:14:09) 
    [GCC 9.2.0] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from __future__ import absolute_import, division, unicode_literals
    >>> k='test\xe2\x80\x94test'
    >>> k
    u'test\xe2\x80\x94test'
    >>> l=k.encode('utf-8')
    >>> l
    'test\xc3\xa2\xc2\x80\xc2\x94test'
    >>> m=str(l)
    >>> m
    'test\xc3\xa2\xc2\x80\xc2\x94test'
    >>> isinstance(m, str)
    True
    >>> m.encode('utf-8')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 4: 
ordinal not in range(128)
  
  It seems in `test_url_encoding_from_basestring` test we encode it once and in 
api.py we ancode it twice, which produces this error

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

Reply via email to