tolerate a str arg to writeData()
This commit is contained in:
parent
d503b62cd1
commit
2d4e88afbd
@ -89,6 +89,10 @@ class MediaManager(object):
|
||||
return self.writeData(opath, open(opath, "rb").read())
|
||||
|
||||
def writeData(self, opath, data):
|
||||
if not isinstance(opath, unicode):
|
||||
# old code/addons were passing as str
|
||||
print "writeData() should be called with unicode"
|
||||
opath = unicode(opath, "utf8", "ignore")
|
||||
# if fname is a full path, use only the basename
|
||||
fname = os.path.basename(opath)
|
||||
# make sure we write it in NFC form (on mac will autoconvert to NFD),
|
||||
|
Loading…
Reference in New Issue
Block a user