From 9eee2396de1eedae2676aeb8b87b4685ed037a73 Mon Sep 17 00:00:00 2001 From: __sp__ Date: Wed, 20 Jul 2016 16:29:48 -0700 Subject: [PATCH] Py3k fix. --- matgendb/creator.py | 3 ++- requirements.txt | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/matgendb/creator.py b/matgendb/creator.py index 7a87f878..7d4c1676 100644 --- a/matgendb/creator.py +++ b/matgendb/creator.py @@ -254,7 +254,8 @@ def _insert_doc(self, d): if "dos" in calc: dos = json.dumps(calc["dos"], cls=MontyEncoder) if self.compress_dos: - dos = zlib.compress(dos, self.compress_dos) + dos = zlib.compress(bytes(dos, 'utf-8'), + self.compress_dos) calc["dos_compression"] = "zlib" fs = gridfs.GridFS(db, "dos_fs") dosid = fs.put(dos) diff --git a/requirements.txt b/requirements.txt index 3e80fec8..92f03cad 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -pymatgen==4.0.0 +pymatgen==4.1.1 monty==0.8.6 -pymongo==3.2.2 +pymongo==3.3.0 prettytable==0.7.2 mongomock==3.0.0 smoqe==0.1.3