title: Python open("file", "w+") not creating a nonexistent file
body: <p>Similar questions exist on Stack Overflow. I have read such questions and they have not resolved my problem. The simple code below results in a File Not Found Error. I am running  Python 3.9.1 on Mac OS X 11.4</p>
  <p>Can anyone suggest next steps for troubleshooting the cause of this?</p>
  <pre><code>with open(&quot;/Users/root/test/test.txt&quot;, &quot;w+&quot;) as f:
      f.write(&quot;test&quot;)
  </code></pre>
  <pre><code>Traceback (most recent call last):
    File &quot;/Users/root1/PycharmProjects/web_crawler/test.py&quot;, line 1, in &lt;module&gt;
      with open(&quot;/Users/root/test/test.txt&quot;, &quot;w+&quot;) as f:
  FileNotFoundError: [Errno 2] No such file or directory: '/Users/root/test/test.txt'
  </code></pre>