From 25e61bb9cffebb26354af3533d55aa3316c7701a Mon Sep 17 00:00:00 2001 From: Maciej Ziarkowski Date: Mon, 20 Jan 2020 19:43:19 +0000 Subject: [PATCH] Make paths relative to source file in extract_data --- maintenance/extract_data/extract_data.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/maintenance/extract_data/extract_data.py b/maintenance/extract_data/extract_data.py index e90f0397..7e63127a 100644 --- a/maintenance/extract_data/extract_data.py +++ b/maintenance/extract_data/extract_data.py @@ -64,9 +64,11 @@ def make_data_extract(current_time, connection, zip_file_path): zip_file_path.parent.mkdir(parents=True, exist_ok=True) + source_dir_path = Path(__file__).parent + try: with zipfile.ZipFile(zip_file_path, mode='w') as newzip: - newzip.write('README.txt') + newzip.write(source_dir_path / 'README.txt') newzip.write('/tmp/building_attributes.csv', arcname='building_attributes.csv') newzip.write('/tmp/building_uprns.csv', arcname='building_uprns.csv') newzip.write('/tmp/edit_history.csv', arcname='edit_history.csv')