curran / curran/google-diff-match-patch

NewLines appear broken in patches (Python 3, Django 1.6.1)

Offen
#95 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
auto-migrated Priority-Medium Type-Defect
Vorherrschende Sprache
Python
Sterne
17
Forks
2
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

```
What steps will reproduce the problem?
1. have a change at the end of a line
- from:
some text
more text
- to:
some text with change
more text
2. call
d = dmp.diff_match_patch()
diffs = d.diff_main(text1, text2)
patch = d.patch_make(diffs)
print_me = d.patch_toText(patch)

What is the expected output? What do you see instead?
print_me containts:
+ with change
%0D%0Amore text

it should have contained:
+ with change
more text

What version of the product are you using? On what operating system?
- Python 3.3 x64 on Windows
- Django 1.6.1
- Chrome on Windows

Please provide any additional information below.

I could do a work-around by removing newlines but I have no idea what side
effects I'm introducing:

diffs = d.diff_main(
"".join(text1.splitlines()),
"".join(text2.splitlines())
)
```

Original issue reported on code.google.com by `calistop...@gmail.com` on 22 Jan 2014 at 9:56

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Reproduziere das Problem mit Python 3 unter Windows, indem du diff_main, patch_make und patch_toText auf Text anwendest, der eine geänderte Zeile gefolgt von einem Zeilenumbruch enthält. Vergleiche die codierte Patch-Ausgabe mit der erwarteten Ausgabe und überprüfe anschließend, dass die Behandlung von Zeilenumbrüchen korrigiert ist, ohne die im Bericht beschriebenen Workaround-Fälle zu beeinträchtigen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
backend
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
42/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.