python-unidiff icon indicating copy to clipboard operation
python-unidiff copied to clipboard

python-unidiff requires to separate diff to lines

Open cool-RR opened this issue 7 years ago • 1 comments

I have a diff file in a string in memory, and I tried to do unidiff.PatchSet(diff_contents) but it failed. After investigating I realized that I need to do unidiff.PatchSet(diff_contents.readlines()) to make it work. It'll be nice if the readlines call wouldn't be needed.

cool-RR avatar Feb 26 '17 14:02 cool-RR

Well, the init method expects a file-like object, that's why. An option would be to have a from_string class method to initialize from a string.

matiasb avatar May 20 '17 16:05 matiasb