openai-cookbook
openai-cookbook copied to clipboard
Special characters not accepted for filenames (Windows)
trafficstars
While crawling the OpenAI website, it came upon this URL: https://openai.com/research?topics=language and crashed with the following error In the file web-qa.py on line 140:
with open('text/'+local_domain+'/'+url[8:].replace("/", "_") + ".txt", "w", encoding="UTF-8") as f:
OSError: [Errno 22] Invalid argument: 'text/openai.com/openai.com_research?topics=language.txt'
Need to replace the '?' and '=' characters for the text filename that it tries to write to.