I got an error that the directory for the output file doesn't exist:
### suspicious links found
Writing output to finished_searches/test_links_2021_2021-02-01.csv
Traceback (most recent call last):
File "main.py", line 98, in <module>
f = open(output_path, 'w')
FileNotFoundError: [Errno 2] No such file or directory: 'finished_searches/test_links_2021_2021-02-01.csv'
The error line is here:
|
f = open(output_path, 'w') |
The output path is defined here:
|
output_path = 'finished_searches/' + output_file_name + '_' + str(datetime.now().date()) + '.csv' |
output_path = 'finished_searches/' + output_file_name + '_' + str(datetime.now().date()) + '.csv'
The folder finished_searches does not exist by default unless created manually. The python script doesn't attempt to make it for you if it is missing and the ReadMe doesn't mention adding it.
This should address this issue:
import os
if not os.path.exists('finished_searches'):
os.makedirs('finished_searches')
I got an error that the directory for the output file doesn't exist:
The error line is here:
discourse_link_checker/main.py
Line 98 in 650fce6
The output path is defined here:
discourse_link_checker/main.py
Line 16 in 650fce6
output_path = 'finished_searches/' + output_file_name + '_' + str(datetime.now().date()) + '.csv'The folder
finished_searchesdoes not exist by default unless created manually. The python script doesn't attempt to make it for you if it is missing and the ReadMe doesn't mention adding it.This should address this issue: