GNUパッチと互換性のあるpythonモジュールdifflibでパッチを作成することは可能ですか? 私はこのエラーをgettings unified_diff使うとcontext_diffしようとしたとしてもlinetermを指定しようとした「\ n」は私はまだだ:ワンピース(Python difflib gnuパッチの互換性
[[email protected] Desktop]$ patch diff.patch test.txt
patch unexpectedly ends in middle of line
patch: **** Only garbage was found in the patch input.
私は、ファイルにパッチを書くことfile.writelines(差分)を使用コードhttp://pastebin.com/3HAWfwVfの)
ファイルtest.txtの:
Hello, this is test
blah
ファイルtest2.txtという名前:
Hello, this is test
blah, dfsgjdfgj
lfkdjgkldfjgkldfjgkl
そして、生成されたパッチ:任意の助け
--- /home/intense/Desktop/test.txt
+++ /home/intense/Desktop/test2.txt
@@ -1,2 +1,7 @@
-Hello, this is test
-blah+Hello,+this+is+test+blah,+dfsgjdfgj+lfkdjgkldfjgkldfjgkl
感謝。
どこで見つけることができますか? –