diff --git a/worker.py b/worker.py index e7ffec25..1dd62c4f 100644 --- a/worker.py +++ b/worker.py @@ -137,15 +137,13 @@ def notifyServer(self, job): if job.notifyURL: outputFileName = job.outputFile.split( "/")[-1] # get filename from path - fh = open(job.outputFile, 'rb') - files = {'file': unicode(fh.read(), errors='ignore')} + files = {'file': open(job.outputFile, 'rb')} hdrs = {'Filename': outputFileName} self.log.debug("Sending request to %s" % job.notifyURL) response = requests.post( job.notifyURL, files=files, headers=hdrs, verify=False) self.log.info("Response from callback to %s:%s" % (job.notifyURL, response.content)) - fh.close() except Exception as e: self.log.debug("Error in notifyServer: %s" % str(e))