diff --git a/gridtk/local.py b/gridtk/local.py index 015d4cacc38c55d9c4944ae45537d5f50be6a3ec..e762941a06255d9c27e79935fe88b6dcc1fbf3ca 100644 --- a/gridtk/local.py +++ b/gridtk/local.py @@ -143,7 +143,7 @@ class JobManagerLocal(JobManager): """Finalizes the execution of the job by writing the stdout and stderr results into the according log files.""" def write(file, std, process): f = std if file is None else open(str(file), 'w') - f.write(process.read()) + f.write(process.read().decode('utf-8')) self.lock() # get the files to write to diff --git a/gridtk/models.py b/gridtk/models.py index aeda6d2276c529a4398f43ebcadf5d22841efa4d..de6541f12c6500be4d384889d10ee61bb6649c1d 100644 --- a/gridtk/models.py +++ b/gridtk/models.py @@ -1,7 +1,6 @@ import sqlalchemy -from sqlalchemy import Table, Column, Integer, String, Boolean, ForeignKey -from bob.db.sqlalchemy_migration import Enum, relationship -from sqlalchemy.orm import backref +from sqlalchemy import Table, Column, Integer, String, Boolean, ForeignKey, Enum +from sqlalchemy.orm import backref, relationship from sqlalchemy.ext.declarative import declarative_base import os @@ -9,8 +8,10 @@ import sys if sys.version_info[0] >= 3: from pickle import dumps, loads + python_3 = True else: from cPickle import dumps, loads + python_3 = False from .tools import logger @@ -172,13 +173,13 @@ class Job(Base): def get_command_line(self): - return loads(str(self.command_line)) + return loads(self.command_line) if python_3 else loads(str(self.command_line)) def get_array(self): - return loads(str(self.array_string)) + return loads(self.array_string) if python_3 else loads(str(self.array_string)) def get_arguments(self): - return loads(str(self.grid_arguments)) + return loads(self.grid_arguments) if python_3 else loads(str(self.grid_arguments)) def get_jobs_we_wait_for(self): return [j.waited_for_job for j in self.jobs_we_have_to_wait_for if j.waited_for_job is not None] diff --git a/gridtk/tests/__init__.py b/gridtk/tests/__init__.py index e3f3d1ef72c1ca106863ae82eb5321959191877e..c8ea43a5a041b5a78e789e8d896aabab8052febc 100644 --- a/gridtk/tests/__init__.py +++ b/gridtk/tests/__init__.py @@ -173,7 +173,7 @@ class GridTKTest(unittest.TestCase): jman.main(['./bin/jman', '--database', self.database, 'list', '--print-array-jobs']) print() - # test that the list command still works + # test that the report command works jman.main(['./bin/jman', '--database', self.database, 'report']) # clean-up