1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
Description: Don't classify XML files as non-text
thanks "J.P. Delport" <jpdelport@csir.co.za> for the bug
report #516143 and the patch.
Author: Y Giridhar Appaji Nag <appaji@debian.org>
--- a/lib/python/xxdiff/utils.py
+++ b/lib/python/xxdiff/utils.py
@@ -52,6 +52,7 @@
# options were taken from Ian F. Darwin's file implementation.
guesscmd = ['file', '-b', '-L']
text_re = re.compile('\\btext\\b')
+xml_re = re.compile('\\bXML\\b')
empty_re = re.compile('^empty$')
def istextfile(fn):
@@ -68,7 +69,7 @@
if p.returncode != 0 or stderr or stdout.startswith('cannot open'):
raise RuntimeError("Error: running 'file' on '%s'." % fn)
- return bool(text_re.search(stdout) or empty_re.match(stdout))
+ return bool(text_re.search(stdout) or xml_re.search(stdout) or empty_re.match(stdout))
def makedirs(dirn, error_on_exist=True):
|