I have a Python program which performs a simple operation on a file:

```
with open(self.cache_filename_url, "a", encoding="utf8") as f:
    w = csv.writer(f, delimiter=',', quotechar='"', lineterminator='\n')
    w.writerow([cache_url, rpd_products])

```

As you can see it just opens the file and appends a CSV line to it. It does this a lot, in a loop.

I accidentally ran two copies of this program simultaneously, so I think they would have been appending to the file simultaneously. I am trying to determine the worst-case-scenario for file corruption.

Do you think the writes would at least be atomic operations in this case? For example this **wouldn't** be a problem for me:

```
old line
old line
new line written by instance 1
new line written by instance 2
new line written by one

```

This **would** be a problem for me:

```
old line
old line
[half of new line written by instance 1] [half of new line by instance 2]
etc

```

To put it another way, is it possible for the two append operations to "interfere" with each other?

EDIT: I am using Windows 7