[dataimport] Use pickle.dump instead of dumps
authorRémi Cardona <remi.cardona@logilab.fr>
Mon, 14 Sep 2015 15:34:09 +0200
changeset 10598 b3f9f929385f
parent 10597 44c52385d2d8
child 10599 99e9fe1e633f
[dataimport] Use pickle.dump instead of dumps
dataimport/pgstore.py
--- a/dataimport/pgstore.py	Mon Sep 14 15:42:38 2015 +0200
+++ b/dataimport/pgstore.py	Mon Sep 14 15:34:09 2015 +0200
@@ -109,11 +109,10 @@
                     filename = make_uid()
                     try:
                         with open(osp.join(dump_output_dir,
-                                           '%s.pickle' % filename), 'w') as fobj:
-                            fobj.write(cPickle.dumps(pdata))
+                                           '%s.pickle' % filename), 'wb') as fobj:
+                            cPickle.dump(pdata, fobj)
                     except IOError:
                         print('ERROR while pickling in', dump_output_dir, filename+'.pickle')
-                        pass
                 cnx.rollback()
                 raise
     finally: