dataimport/pgstore.py
changeset 10978 6f88cb7b7a84
parent 10513 7bec01a59f92
child 10981 45bc791275b4
child 10982 20bf21bb16e4
--- a/dataimport/pgstore.py	Wed Dec 09 18:42:13 2015 +0100
+++ b/dataimport/pgstore.py	Tue Dec 15 11:41:25 2015 +0100
@@ -64,8 +64,9 @@
                                columns, encoding='utf-8'):
     """ Execute thread with copy from
     """
-    buf = _create_copyfrom_buffer(data, columns, encoding=encoding)
-    if buf is None:
+    try:
+        buf = _create_copyfrom_buffer(data, columns, encoding=encoding)
+    except ValueError:
         _execmany_thread_not_copy_from(cu, statement, data)
     else:
         if columns is None: