Greg Ward added the comment:

The original reproduction I posted was incorrect -- it makes difflib look worse 
than it should. (I passed strings rather than lists of strings.) Here is a more 
accurate version:

>>> import difflib
>>> a = [b'hello']
>>> b = [b'hello!']
>>> '\n'.join(line for line in difflib.unified_diff(a, b))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 1, in <genexpr>
  File "/home/greg/src/cpython/3.3/Lib/difflib.py", line 1223, in unified_diff
    yield '-' + line
TypeError: Can't convert 'bytes' object to str implicitly

So it still crashes, but the exception makes it pretty clear what the problem 
is.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17445>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to