[英]Azure Function - Exception: OSError: [Errno 30] Read-only file system:
I'm trying to copy the value from the Excel file but it returns this error message:我正在尝试从 Excel 文件复制值,但它返回此错误消息:
Exception while executing function: Functions.extract Result: Failure
Exception: OSError: [Errno 30] Read-only file system: './data_download/xxxxx.xlsx'
Stack: File "/azure-functions-host/workers/python/3.8/LINUX/X64/azure_functions_worker/dispatcher.py", line 343, in handle_invocation_request
call_result = await self._loop.run_in_executor(
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/azure-functions-host/workers/python/3.8/LINUX/X64/azure_functions_worker/dispatcher.py", line 480, in __run_sync_func
return func(**params)
File "/home/site/wwwroot/extract/_init_.py", line 62, in main
with open(download_file_path, "wb") as download_file:
My code我的代码
with open(download_file_path, "wb") as download_file:
This is not related to Azure function, in general Only /tmp
seems to be writable这个和Azure function没有关系,一般只有
/tmp
好像是可写的
Try adding tmp to the file path尝试将 tmp 添加到文件路径
filepath = '/tmp/' + key
I believe that Azure Function resource uses a linux based operating system.我相信 Azure Function 资源使用基于 linux 的操作系统。 All files are saved in the /tmp folder.
所有文件都保存在 /tmp 文件夹中。
import tempfile
import os
local_path = tempfile.gettempdir()
filepath = os.path.join(local_path, filename)
And then you should be able to save any data to the filepath variable然后你应该能够将任何数据保存到文件路径变量
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.