openai-cookbook icon indicating copy to clipboard operation
openai-cookbook copied to clipboard

Special characters not accepted for filenames (Windows)

Open sonnyjon opened this issue 2 years ago • 0 comments
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.

sonnyjon avatar Apr 24 '23 22:04 sonnyjon