XZise created this task.
XZise added a subscriber: XZise.
XZise added a project: pywikibot-core.
Restricted Application added subscribers: Aklapper, pywikipedia-bugs.

TASK DESCRIPTION
  In Python 2 it's not possible to add the representation of list containing a 
pages containing non-ASCII characters into a Unicode string:
  
  ```
  >>> import pywikibot
  >>> p = pywikibot.Page(pywikibot.Site(), u'öäöä')
  >>> p.title()
  u'\xf6\xe4\xf6\xe4'
  >>> '%r' % ([p],)
  '[Page(\xc3\xb6\xc3\xa4\xc3\xb6\xc3\xa4)]'
  >>> u'%r' % ([p],)
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 6: 
ordinal not in range(128)
  ```
  
  This is with 41d4254c which was the commit before merging unicode_literals. 
With unicode_literals it seems that repr doesn't correctly work at all:
  
  ```
  >>> u'%r' % ([p],)
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  UnicodeEncodeError: 'ascii' codec can't encode characters in position 5-12: 
ordinal not in range(128)
  >>> '%r' % ([p],)
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  UnicodeEncodeError: 'ascii' codec can't encode characters in position 5-12: 
ordinal not in range(128)
  >>> repr(p)
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  UnicodeEncodeError: 'ascii' codec can't encode characters in position 5-12: 
ordinal not in range(128)
  ```

TASK DETAIL
  https://phabricator.wikimedia.org/T95809

REPLY HANDLER ACTIONS
  Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign 
<username>.

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: XZise
Cc: pywikipedia-bugs, Aklapper, XZise, jayvdb



_______________________________________________
Pywikipedia-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-bugs

Reply via email to