Skip to content
Advertisement

Tag: thread-safety

how can i safely write to a file when using Flask?

I need to write a method on a Flask server which will write part of the request to a log file. However, if I understand correctly, Flask is multi-threaded, and there’s a good chance that writing to a file is not safe. Admittedly, I am more or less new to Python and multi-threaded programming in general, so I need someone

Is python zipfile thread-safe?

In a django project, I need to generate some pdf files for objects in db. Since each file takes a few seconds to generate, I use celery to run tasks asynchronously. Problem is, I need to add each file to a zip archive. I was planning to use the python zipfile module, but different tasks can be run in different

Advertisement