[issue11632] difflib.unified_diff loses context

2016-10-18 Thread Steve Newcomb

Steve Newcomb added the comment:

Context reporting is still buggy in Python 3.5.2:

>>> [ x for x in difflib.unified_diff( "'on'\n", "'on'\n\n\n")]
['--- \n', '+++ \n', '@@ -3,3 +3,5 @@\n', ' n', " '", ' \n', '+\n', '+\n']
>>> import sys
>>> sys.version
'3.5.2 (default, Sep 10 2016, 08:21:44) \n[GCC 5.4.0 20160609]'
>>> 
(compiled under Ubuntu 16.04.1 LTS)

--
nosy: +steve.newcomb

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11632] difflib.unified_diff loses context

2013-09-20 Thread Benoît D Vages

Benoît D Vages added the comment:

An other exemple if necessary (python 2.6 / 2.7)
Got same behavior than mal using his script and my files.

Seems to occur when the chunk of lines between 2 differences is repeated many 
times in the file

--
nosy: +folder4ben
Added file: http://bugs.python.org/file31823/450.zip

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11632
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11632] difflib.unified_diff loses context

2013-04-29 Thread Miguel Latorre

Miguel Latorre added the comment:

This bug is still present in python 2.7.4 and python 3.3.1.
I attach another example, the result differs depending on number of lines to 
process (see test.py).

--
nosy: +mal
versions: +Python 2.7, Python 3.3
Added file: http://bugs.python.org/file30057/test.zip

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11632
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11632] difflib.unified_diff loses context

2013-04-29 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
versions: +Python 3.4 -Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11632
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11632] difflib.unified_diff loses context

2011-03-27 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

2.6 only gets security fixes now.

--
nosy: +terry.reedy
versions:  -Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11632
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11632] difflib.unified_diff loses context

2011-03-22 Thread Brice Videau

New submission from Brice Videau brice.vid...@gmail.com:

unified_diff seems to lose the context when comparing the 2 files contained in 
the attached archive using this script :

import difflib
b1 = open(out1.short,r).read().splitlines(True)
b2 = open(out2.short,r).read().splitlines(True)
compare = difflib.unified_diff(b1,b2)
for line in compare:
print line,

a big chunk of lines is considered as removed, just to be added next (around 
line 16).

Comparing out2.short against out1.short does not produce this behavior :
compare = difflib.unified_diff(b2,b1)
is correct.

Other diff tools such as diff or vimdiff do not exhibit this problem.

--
components: Library (Lib)
files: diff.tgz
messages: 131735
nosy: Brice.Videau
priority: normal
severity: normal
status: open
title: difflib.unified_diff loses context
type: behavior
versions: Python 2.6, Python 3.1
Added file: http://bugs.python.org/file21332/diff.tgz

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11632
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com