Message184487
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. |
|
| Date |
User |
Action |
Args |
| 2013-03-18 18:43:01 | gward | set | recipients:
+ gward, barry, terry.reedy, ncoghlan, durin42, r.david.murray |
| 2013-03-18 18:43:01 | gward | set | messageid: <[email protected]> |
| 2013-03-18 18:43:01 | gward | link | issue17445 messages |
| 2013-03-18 18:43:01 | gward | create | |
|