Closed rdmolony closed 1 year ago
Huh, it is odd that NamedTemporaryFile
got used without using an explicit name. Let me take a look a bit more, but in concept I'll get this merged in a day or two.
Got this problem too. https://stackoverflow.com/questions/66744497/python-tempfile-namedtemporaryfile-cant-use-generated-tempfile
The following adjustments also solved the problem:
def _save_virtual_workbook(self, wb):
try:
tmp = NamedTemporaryFile(delete=False)
save_workbook(wb, tmp.name)
tmp.seek(0)
virtual_workbook = tmp.read()
finally:
tmp.close()
os.unlink(tmp.name)
return virtual_workbook
Sorry for the delay, just back from vacation. I'll get a version published to PyPI today. @rdmolony @AlexKovyazin
Hi there,
Thanks for creating & maintaining
drf-excel
😃I'm running
drf
onWindows Server 2019 (Datacenter)
for legacy/historical reasons. This version blocksNamedTemporaryFile
from saving to temp dir.TemporaryFile
seems to work fine across platforms in its place as it is not blocked by the dreaded permissions