radharamana / google-diff-match-patch

Automatically exported from code.google.com/p/google-diff-match-patch
Apache License 2.0
0 stars 0 forks source link

error in patch_fromText function in python2 #51

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
    this is form my function on python2.7

    diff_patch = diff_match_patch()
    patches = diff_patch.patch_fromText(diff)
    patched_text,_ = diff_patch.patch_apply(patches,text)

What is the expected output? What do you see instead?
expected output is patched text from using unified_diff,but i have error

What version of the product are you using? On what operating system?
from diff_match_patch_20110725

Original issue reported on code.google.com by anton.ne...@gmail.com on 28 Jul 2011 at 10:03

Attachments:

GoogleCodeExporter commented 8 years ago
The DMP library is character-based, whereas the UNIX patch format is 
line-based.  That's why we use a slightly different format.  See this page:
http://code.google.com/p/google-diff-match-patch/wiki/Unidiff

What you have created is a Unidiff parser, which is fine.  But it isn't 
compatible with the patch_toText function.

Original comment by neil.fra...@gmail.com on 28 Jul 2011 at 12:21