Skip to content

Constructor throw "File is not a zip file" on file created using Word  #1452

@swarmttied

Description

@swarmttied

Hi. I'm trying to parse docx using the BytesIO overload of the Document ctor. when I parse any docx created using python-docx, the codes snippet below works just fine. However, with those saved from Word, I get the "File not valid zip" error. I notice that the Word-created files are indeed larger than those created using python-docx, indicative of it not being a zip file. Is there a way to parse a non-zipped stream in this case? I'm on Python 3.11

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions