mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-01-18 16:40:41 -06:00
Try to fix Audio Uploader when the audio file name contains non-ascii characters
This commit is contained in:
parent
45263732b8
commit
d2123fdab7
@ -19,7 +19,10 @@ class Upload(object):
|
||||
self.completed_callback = completed_callback
|
||||
self.background_thread = None
|
||||
self.transfer_rate = 0
|
||||
self.m = MultipartEncoder(fields={field:(os.path.basename(self.filename), open(self.filename, 'rb'), "application/octet-stream")})
|
||||
self.local_filename=os.path.basename(self.filename)
|
||||
if isinstance(self.local_filename, unicode):
|
||||
self.local_filename=self.local_filename.encode(sys.getfilesystemencoding())
|
||||
self.m = MultipartEncoder(fields={field:(self.local_filename, open(self.filename, 'rb'), "application/octet-stream")})
|
||||
self.monitor = MultipartEncoderMonitor(self.m, self.progress_callback)
|
||||
self.response=None
|
||||
self.obj=obj
|
||||
|
Loading…
x
Reference in New Issue
Block a user