The code below is part of my code. In my local machine, everything is fine.However, I deploy my code and inside of docker container,it gives the error "result": "[Errno 13] Permission denied: path". What could be solution to delete in docker container also? I tried os.remove()
also,It didn't work.
path = "/mypath/"
output = path + "myfile.pdf"
result_file = open(output, "w+b")
pisa_res = pisa.CreatePDF(
source_html,
dest = result_file)
result_file.close()
with open(output, "rb") as pdf_file:
encoded_string = base64.b64encode(pdf_file.read())
os.system(f"rm -rf {output}")