Creating files and directories via Python
===

I'm having trouble creating a directory and then opening/creating/writing into a file in the specified directory. The reason seems unclear to me. I'm using os.mkdir() and 


    path=chap_name
    print "Path : "+chap_path                       #For debugging purposes
    if not os.path.exists(path):
        os.mkdir(path)
    temp_file=open(path+'/'+img_alt+'.jpg','w')
    temp_file.write(buff)
    temp_file.close()
    print " ... Done"


I get the error 
<pre>OSError: [Errno 2] No such file or directory: 'Some Path Name'</pre>

Path is of the form 'Folder Name with un-escaped spaces'

What am I doing wrong here?