I get this error when I try to use the open function. If I understand correctly, if the file doesnt exist (it doesn't), it is automatically created. I tried changing the 'w' to 'w+', but I got the same error.
Traceback (most recent call last):
File "altdl.py", line 24, in <module>
sys.stdout = open(str(start_dir + "\\Logs\\" + "log_" + str(now.date()) + "_
" + str(now.time()) + ".log"), 'w')
IOError: [Errno 22] invalid mode ('w') or filename: 'C:\\Users\\Vaibhav\\Desktop
\\Test\\Logs\\log_2013-07-02_11:21:37.717000.log'
By the way, start_dir
is set as str(os.getcwd())
.