jayvdb added a subscriber: XZise. jayvdb added a comment.
In https://phabricator.wikimedia.org/T130919#2153737, @Xqt wrote: > The test is described as > > > """Test that repr returns ASCII compatible bytes in Python 2.""" > > and > > > \# Bug https://phabricator.wikimedia.org/T95809, the repr in Python 2 should be decodable as ASCII > > but the test fails, which means //it is not decodable//: > > >>> repr(p).decode('ascii') > > Traceback (most recent call last): > File "<pyshell#29>", line 1, in <module> > repr(p).decode('ascii') > UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 5: ordinal not in range(128) > >>> > > > Either the test is wrong or the description is wrong. Yes, the test description is 'wrong'. The method is testing what should succeed, and that is what is described in the docstring. But of course it fails and `expectedFailure` checks that it fails. That is confusing. If we built the repr according to the spec, it would pass. But building it according to the spec means that repr wont be pretty in a python console session. The code, from before 2014 and still now, chose to use non-ascii repr as opposed to ascii repr. @xzise was very opposed this, and tried to switch to ascii repr. I believe we should stay with non-ascii repr, mostly because both approaches have negatives, and the only way to avoid all negatives is to use Python 3. Do you want ascii repr? If not, then I can expand this docstring so it isnt confusing and then this task is done? TASK DETAIL https://phabricator.wikimedia.org/T130919 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: jayvdb Cc: XZise, jayvdb, Aklapper, Xqt, pywikibot-bugs-list _______________________________________________ pywikibot-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs
