Skip to content

Commit 904ccec

Browse files
[Fix] Codebook directive now creates a file if it does not exist
1 parent 0154fdf commit 904ccec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/directives/csv_codebook_directive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def run(self):
3636
doc_sensor = abrv_to_sensor[maybe_sensor[0]]
3737

3838
# Open the CSV file and append the content
39-
with open(csv_file_path, 'a', newline='', encoding='utf-8') as csvfile:
39+
with open(csv_file_path, 'a+', newline='', encoding='utf-8') as csvfile:
4040
writer = csv.writer(csvfile)
4141

4242
# Write header if file is newly created or empty

0 commit comments

Comments
 (0)