title: Python docx AttributeError: 'WindowsPath' object has no attribute 'seek'
body: <p>I want to insert about 250 images with their filename into a docx-file.</p>
  
  <p>My <code>test.py</code> file:</p>
  
  <pre><code>from pathlib import Path
  import docx
  from docx.shared import Cm
  
  filepath = r"C:\Users\Admin\Desktop\img"
  document = docx.Document()
  
  for file in Path(filepath).iterdir():
  #    paragraph = document.add_paragraph(Path(file).resolve().stem)
      document.add_picture(Path(file).absolute(), width=Cm(15.0))
  
  document.save('test.docx')
  </code></pre>
  
  <p>After Debugging I got this Error:</p>
  
  <pre><code>Exception has occurred: AttributeError
  'WindowsPath' object has no attribute 'seek'
    File "C:\Users\Admin\Desktop\test.py", line 10, in &lt;module&gt;
      document.add_picture(Path(file).absolute(), width=Cm(15.0))
  </code></pre>
  
  <p>How can i avoid this Error?</p>