I tried to upload file with name foo[bar].mov and it won't upload renaming it to foobar.mov works.
I have isolated the error to this piece of code in files.py
def chunk_names(self):
"""Iterates over all stored chunks and yields their names."""
file_names = sorted(self.storage.listdir('')[1])
pattern = '%s%s*' % (self.filename, self.chunk_suffix)
for name in file_names:
if fnmatch.fnmatch(name, pattern):
yield name
using fnname.fnmatch on the pattern of the filename itself cause issue as brackets are not escaped.
My work around is to replace chunk_names method with
def chunk_names(self):
"""Iterates over all stored chunks and yields their names."""
file_names = sorted(self.storage.listdir('')[1])
pattern = '%s%s' % (self.filename, self.chunk_suffix)
for name in file_names:
if name[:-4] == pattern:
yield name
I tried to upload file with name
foo[bar].mov
and it won't upload renaming it tofoobar.mov
works. I have isolated the error to this piece of code in files.pyusing
fnname.fnmatch
on the pattern of the filename itself cause issue as brackets are not escaped.My work around is to replace
chunk_names
method with