title: Why is my docx file broken when I unzip it with python?
body: <p>I am trying to edit the xml of a docx file, but first found I was getting an issue when I unzipped it with python. I have a word document, <code>temp.docx</code> I copied with <code>shutil.copyfile()</code> and copied it in the same directory as <code>temp.zip</code>. Then I unzipped it into the same directory in a folder named <code>temp</code> using :</p>
  <pre><code>with zipfile.ZipFile(zip_path, 'r') as zip_ref:
      zip_ref.extractall(path.join(directory, &quot;temp&quot;))
  </code></pre>
  <p>Now, if I manually rename the original zip file from <code>temp.zip</code> to <code>temp.docx</code>, no issues and it reads like a normal document.</p>
  <p>But, if I manually send the temp folder to a zip file and rename it from <code>temp.zip</code> to <code>temp.docx</code>, I get a window saying that the file <a href="https://i.stack.imgur.com/lM50W.png" rel="nofollow noreferrer">might become unusable</a>. I hit Yes, and it says <a href="https://i.stack.imgur.com/CfJqB.png" rel="nofollow noreferrer">it found unreadable content</a>. Again I hit Yes and then it tells me <a href="https://i.stack.imgur.com/sV35m.png" rel="nofollow noreferrer">there is an error opening the file</a>.</p>
  <p>Is <code>extractall</code> altering the files at all when opening? Any ideas on what is going on here?</p>