-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: accommodate NULL relationship (by skipping) #678
Comments
ps: the word file was created or saved by MSWORD2016,however,rels always has relationship target is null. |
We've seen this problem before, I think it comes from a Word Add-in like a "management-pack" or something that improperly leaves dangling relationships. There is some more information about it here: scanny/python-pptx#206 where it came up in the sister project |
that's my document , i try to find where the error position |
Looks like you corrupted the main rels file somehow. |
I have solved this problem by deleting the NULL relationship each time, and then packaged it into docx. thank you very much |
The same problem i have . So how to avoid this in code |
Just to bump this issue a bit, we have also encountered the problem mentioned here in production. I have manually fixed the affected word-document but of course it would be more elegant if |
It seems that python-docx can't handle such problem. Can anyone tell me how to avoid this in code ,or how to delete the null relationship in word 2016? thanks a lot~ |
I fix this problem by the following steps:
|
@ngc7023 how do you "delete the with 'NULL'"? Do you just do that by hand or do you have some code you use? |
@scanny |
Just encountered the same situation (as attached), just wondering if this kind of bad file would be handled gracefully by python-docx? Or prefer not to fix it? |
@yingang @scanny @deiferni @whybeyoung @zhangjx53 You can find a solution here-> |
when i using "docx.Document("a.docx")" want to open that document, had make 'keyError',what is happend?
the file i unzip, idont know what is that?Does this file make the keyError?
The text was updated successfully, but these errors were encountered: