[Python-apps-team] Bug#713491: txt2tags: FTBFS: test failed
Philipp Kern
pkern at debian.org
Fri Nov 22 20:57:59 UTC 2013
Control: tag -1 + patch
On Sat, Jun 22, 2013 at 04:00:27PM +0200, Lucas Nussbaum wrote:
> > Entering on module csv
[…]
> > Testing error ... FAILED
Apparently csv in python2.7 is more forgiving than its python2.6 version:
% cat error.csv
"foo
% python
Python 2.7.5+ (default, Sep 17 2013, 15:31:50)
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import csv
>>> list(csv.reader(open('error.csv', 'r')))
[['foo']]
% python2.6
Python 2.6.8 (unknown, May 8 2013, 22:45:40)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import csv
>>> list(csv.reader(open('error.csv', 'r')))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
_csv.Error: newline inside string
I wonder if that's a good thing. We can make it strict:
% python2.7
Python 2.7.5+ (default, Sep 17 2013, 15:31:50)
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import csv
>>> dialect = csv.excel()
>>> dialect.strict = True
>>> list(csv.reader(open('error.csv', 'r'), dialect=dialect))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
_csv.Error: unexpected end of data
But that cannot parse marked.csv:
txt2tags: Error: CSV: file marked.csv: ',' expected after '"'
I guess it will be easiest to just drop that test and accept "test as
valid CSV.
I uploaded a skip test to delayed/10-days. Its debdiff is attached.
Kind regards
Philipp Kern
-------------- next part --------------
diff -Nru txt2tags-2.6/debian/changelog txt2tags-2.6/debian/changelog
--- txt2tags-2.6/debian/changelog 2011-04-16 17:40:13.000000000 +0200
+++ txt2tags-2.6/debian/changelog 2013-11-22 21:49:50.000000000 +0100
@@ -1,3 +1,11 @@
+txt2tags (2.6-3.1) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * Remove the error.csv test, as it parses successfully with python2.7
+ and the alternative is to break other input. (Closes: #713491)
+
+ -- Philipp Kern <pkern at debian.org> Fri, 22 Nov 2013 21:49:10 +0100
+
txt2tags (2.6-3) unstable; urgency=low
* Rebuild for Python 2.7 as default
diff -Nru txt2tags-2.6/debian/patches/series txt2tags-2.6/debian/patches/series
--- txt2tags-2.6/debian/patches/series 2009-08-11 21:33:40.000000000 +0200
+++ txt2tags-2.6/debian/patches/series 2013-11-22 21:55:11.000000000 +0100
@@ -1,3 +1,4 @@
po-makefile.patch
doc-makefile.patch
manpages.patch
+skip-error-csv-test.patch
diff -Nru txt2tags-2.6/debian/patches/skip-error-csv-test.patch txt2tags-2.6/debian/patches/skip-error-csv-test.patch
--- txt2tags-2.6/debian/patches/skip-error-csv-test.patch 1970-01-01 01:00:00.000000000 +0100
+++ txt2tags-2.6/debian/patches/skip-error-csv-test.patch 2013-11-22 21:52:18.000000000 +0100
@@ -0,0 +1,15 @@
+Index: txt2tags-2.6/test/csv/run.py
+===================================================================
+--- txt2tags-2.6.orig/test/csv/run.py 2010-10-21 00:37:33.000000000 +0200
++++ txt2tags-2.6/test/csv/run.py 2013-11-22 21:51:43.884285120 +0100
+@@ -19,6 +19,10 @@
+ for outfile in glob.glob("ok/*"):
+ stderr = 0
+ basename = re.sub('\..*?$', '', outfile.replace('ok/', ''))
++ if basename == 'error':
++ # Ignore error.t2t because it parses successfully with
++ # python2.7.
++ continue
+ target = re.sub('.*\.', '', outfile)
+ if target == 'out':
+ target = 'txt'
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/python-apps-team/attachments/20131122/d1e37854/attachment.sig>
More information about the Python-apps-team
mailing list