summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarel Ben-Attia <harelba@gmail.com>2020-06-03 16:52:12 +0300
committerHarel Ben-Attia <harelba@gmail.com>2020-06-03 16:52:12 +0300
commitb9f59cbfc261ac62993944e0120d1abace497936 (patch)
tree17f0a28d50fac4b94d5970a89adca04df0d00449
parent192ec6db4ab1b0a96dea0d0ded89a2405da8654d (diff)
Some info regarding the possibility of BOM on failure2.0.142.0.132.0.112.0.11
-rwxr-xr-xbin/q.py2
-rwxr-xr-xtest/test-suite4
2 files changed, 3 insertions, 3 deletions
diff --git a/bin/q.py b/bin/q.py
index b41451f..072f608 100755
--- a/bin/q.py
+++ b/bin/q.py
@@ -1424,7 +1424,7 @@ class QTextAsData(object):
msg = str(e)
error = QError(e,"query error: %s" % msg,1)
if "no such column" in msg and effective_input_params.skip_header:
- warnings.append(QWarning(e,'Warning - There seems to be a "no such column" error, and -H (header line) exists. Please make sure that you are using the column names from the header line and not the default (cXX) column names'))
+ warnings.append(QWarning(e,'Warning - There seems to be a "no such column" error, and -H (header line) exists. Please make sure that you are using the column names from the header line and not the default (cXX) column names. Another issue might be that the file contains a BOM. Files that are encoded with UTF8 and contain a BOM can be read by specifying `-e utf-9-sig` in the command line. Support for non-UTF8 encoding will be provided in the future.'))
except ColumnCountMismatchException as e:
error = QError(e,e.msg,2)
except (UnicodeDecodeError, UnicodeError) as e:
diff --git a/test/test-suite b/test/test-suite
index 4b8c0be..510dd63 100755
--- a/test/test-suite
+++ b/test/test-suite
@@ -514,8 +514,8 @@ class BasicTests(AbstractQTestCase):
self.assertEqual(len(o), 0)
self.assertEqual(len(e), 2)
self.assertTrue(six.b('no such column: c3') in e[0])
- self.assertEqual(
- e[1], six.b('Warning - There seems to be a "no such column" error, and -H (header line) exists. Please make sure that you are using the column names from the header line and not the default (cXX) column names'))
+ self.assertTrue(
+ e[1].startswith(six.b('Warning - There seems to be a "no such column" error, and -H (header line) exists. Please make sure that you are using the column names from the header line and not the default (cXX) column names')))
self.cleanup(tmpfile)