- Notifications
You must be signed in to change notification settings - Fork1.2k
Refactor parse_xml function to handle external target references (Issue #1349)#1350
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…T_Relationship class
SebG-js commentedMar 17, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Hello defgetinfo(self,name):"""Return the instance of ZipInfo given 'name'."""info=self.NameToInfo.get(name)ifinfoisNone:>raiseKeyError('There is no item named %r in the archive'%name)EKeyError:"There is no item named 'word/#schémaglobal' in the archive" |
schwaxpl commentedMay 28, 2025
Hello |
SebG-js commentedMay 28, 2025
Hello@al-rahul |
I've made a pull request already, but the repo owner seems to be inactive and hasn't touched it in more than a year. |
SebG-js commentedMay 28, 2025
TommasoPetrolito commentedMay 28, 2025
+1 I also faced a similar issue and I tried the change of this PR and it works. Please, it would be very useful if the proposed PR could get merged. |
TommasoPetrolito commentedMay 29, 2025
TommasoPetrolito commentedMay 29, 2025
@ondrej-111 if@scanny can't, can you maybe help with this? |
TommasoPetrolito commentedMay 29, 2025
Possible temporary fixes, in your requirements.txt instead of python-docx==1.1.2 or similar, use instead: OPTION A: OPTION B: |
The added code checks if self.target_ref exists and if it starts with a "#", which is a common way to denote external references. If both conditions are met, the method returns RTM.EXTERNAL, indicating that the target reference is external.
This change improves the robustness of our code by correctly handling and classifying external references. This will prevent potential errors or unexpected behavior when encountering such references.