Skip to content

Commit 2ae54b2

Browse files
committed
Merge branch 'release/0.7.5'
2 parents 0d523f9 + 8f7c95b commit 2ae54b2

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ License
3939
Changelog
4040
~~~~~~~~~
4141

42+
- v0.7.5
43+
44+
- Fix an issue where dictionary attributes (like ``jtEnvironment``) could
45+
encounter ``UnicodeDecodeError``s upon assignment.
46+
4247
- v0.7.4
4348
4449
- Switch to using preferred encoding from ``locale`` module for converting

drmaa/helpers.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,13 @@ def __init__(self, name):
200200
self.name = name
201201

202202
def __set__(self, instance, value):
203-
v = ["{0}={1}".format(k, v).encode(ENCODING) for (k, v) in
204-
value.items()]
203+
v = []
204+
for k, v in value.items():
205+
if isinstance(k, bytes):
206+
k = k.decode(ENCODING)
207+
if isinstance(v, bytes):
208+
v = v.decode(ENCODING)
209+
v.append("{0}={1}".format(k, v).encode(ENCODING))
205210
c(drmaa_set_vector_attribute, instance, self.name,
206211
string_vector(v))
207212

drmaa/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222
:author: Dan Blanchard (dblanchard@ets.org)
2323
'''
2424

25-
__version__ = '0.7.4'
25+
__version__ = '0.7.5'
2626
VERSION = tuple(int(x) for x in __version__.split('.'))

test/testwrap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class SubmitBase(unittest.TestCase):
6161
def setUp(self):
6262
self.jt = jt = Session.createJobTemplate()
6363
jt.remoteCommand = 'python'
64-
jt.args = ['-c', "print 'hello from python!'"]
64+
jt.args = ['-c', "print('hello from python!')"]
6565
if hasattr(self, 'jt_tweaks'):
6666
self.jt_tweaks()
6767
self.jid = Session.runJob(jt)

0 commit comments

Comments
 (0)