Skip to content

Commit

Permalink
python3 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Fausto Milletari committed Sep 10, 2018
1 parent 243b13f commit 2970665
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tomaat/server/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from urllib2 import urlopen

from multiprocessing import Process, Manager, Lock
from urllib2 import urlopen

from klein import Klein
from twisted.internet.defer import inlineCallbacks, returnValue, DeferredLock
Expand Down Expand Up @@ -202,7 +201,7 @@ def parse_request(self, request, savepath):
data = {}

for element in self.input_interface:
raw = request.args[element['destination']]
raw = request.args[element['destination'].encode('UTF-8')]

if element['type'] == 'volume':
uid = uuid.uuid4()
Expand Down Expand Up @@ -266,7 +265,7 @@ def make_response(self, data, savepath):
writer.Execute(data[field][0])

with open(tmp_label_volume, 'rb') as f:
vol_string = base64.encodestring(f.read())
vol_string = base64.encodestring(f.read()).decode('utf-8')

message.append({'type': 'LabelVolume', 'content': vol_string, 'label': ''})

Expand Down

0 comments on commit 2970665

Please sign in to comment.