title: with open() error 22 (windows path)
body: <p>I have trouble getting the following code to work:</p>
  
  <pre><code>path = "C:\\Users\\jiversen\\Documents\\Jsons\\"+jsonName+'.json'
  
  with open(path,'w') as outfile:
          json.dump(df,outfile)
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>OSError                                   Traceback (most recent call last)
  &lt;ipython-input-162-ad4856eeb7ee&gt; in &lt;module&gt;()
        7 #path = r "C:\Users\jiversen\Documents\CosmosDB Simulator\Jsons\"+jsonName+'.json'
        8 
  ----&gt; 9 with open(abs_file_path,'w') as outfile:
       10         json.dump(df,outfile)
  
  OSError: [Errno 22] Invalid argument: 'C:\\Users\\jiversen\\Documents\\Jsons\\2018.04.06 12:00:00.000.json'
  </code></pre>
  
  <p>I have tried the following ways to create the path:</p>
  
  <h1>1</h1>
  
  <pre><code>path = "C:\Users\jiversen\Documents\Jsons\"+jsonName+'.json'
  </code></pre>
  
  <p>this produces the following error:</p>
  
  <pre><code>File "&lt;ipython-input-166-405d2aae6e9c&gt;", line 7
      path = "C:\Users\jiversen\Documents\Jsons\"+jsonName+'.json'
                                                                  ^
  SyntaxError: EOL while scanning string literal
  </code></pre>
  
  <h1>2</h1>
  
  <pre><code>path = R"C:\Users\jiversen\Documents\Jsons\"+jsonName+'.json'
  </code></pre>
  
  <p>this produces the folling error:</p>
  
  <pre><code>File "&lt;ipython-input-167-ff5d5da61135&gt;", line 7
      path = R"C:\Users\jiversen\Documents\Jsons\"+jsonName+'.json'
                                                                   ^
  SyntaxError: EOL while scanning string literal
  </code></pre>
  
  <h1>3</h1>
  
  <pre><code>    import os
      script_dir = os.path.abspath('C:\\Users\\jiversen\\Documents\\jsons\\') # i.e. /path/to/dir/foobar.py
      rel_path = 'Jsons\\'+jsonName+'.json'
      abs_file_path = os.path.join(script_dir, rel_path)
  </code></pre>
  
  <p>this produces the folling error:</p>
  
  <pre><code>OSError                                   Traceback (most recent call last)
  &lt;ipython-input-168-d286c1f58b6a&gt; in &lt;module&gt;()
        7 #path = R"C:\Users\jiversen\Documents\Jsons\"+jsonName+'.json'
        8 
  ----&gt; 9 with open(path,'w') as outfile:
       10         json.dump(df,outfile)
  
  OSError: [Errno 22] Invalid argument: 'C:\\Users\\jiversen\\Documents\\Jsons\\2018.04.06 12:00:00.000.json'
  </code></pre>
  
  <h1>4 no subdir and no spaces</h1>
  
  <pre><code>with open(jsonName+'.json','w') as outfile:
          json.dump(df,outfile)
  </code></pre>
  
  <p>this produces the following error:</p>
  
  <pre><code>OSError                                   Traceback (most recent call last)
  &lt;ipython-input-173-818eaaa66077&gt; in &lt;module&gt;()
        6 path = 'C:\\Users\\jiversen\\Documents\\Jsons\\'+jsonName+'.json'
        7 
  ----&gt; 8 with open(jsonName+'.json','w') as outfile:
        9         json.dump(df,outfile)
  
  OSError: [Errno 22] Invalid argument: '2018.04.06-12:00:00.000.json'
  </code></pre>
  
  <h1>Aditional info</h1>
  
  <p>I have copy pasted the path, and made sure over and over it exists (C:\Users\jiversen\Documents\Jsons)</p>
  
  <p>I work in jupyter-notebook</p>
  
  <h1>Response to deepspace</h1>
  
  <pre><code>OSError                                   Traceback (most recent call last)
  &lt;ipython-input-177-f09b6b3b06fe&gt; in &lt;module&gt;()
       10 # C:\Users\jiversen\Documents\Jsons\2018.04.06-12:00:00.000.json
       11 
  ---&gt; 12 with open(full_path, 'w') as outfile:
       13     json.dump(df, outfile)
  
  OSError: [Errno 22] Invalid argument: 'C:\\Users\\jiversen\\Documents\\Jsons\\2018.04.06-12:00:00.000.json'
  </code></pre>