mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Handle unicode objects in stringfiled by converting via a str() call
This commit is contained in:
parent
50df03806f
commit
e3a9bfc265
@ -187,6 +187,7 @@ class stringfield(object):
|
|||||||
return obj.unpack(start=self._start, fmt="<"+length+"s")[0]
|
return obj.unpack(start=self._start, fmt="<"+length+"s")[0]
|
||||||
|
|
||||||
def __set__(self, obj, val):
|
def __set__(self, obj, val):
|
||||||
|
if val.__class__.__name__ != 'str': val = str(val)
|
||||||
obj.pack(val, start=self._start, fmt="<"+str(len(val))+"s")
|
obj.pack(val, start=self._start, fmt="<"+str(len(val))+"s")
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user