No item named 'ppt/drawings/NULL' in the archive
See original GitHub issueWhen I open a particular PPTX file (which opens without error or complaint in multiple versions/platforms of PowerPoint) I get the following exception:
$ python
Python 2.7.10 (v2.7.10:15c95b7d81dc, May 23 2015, 09:33:12)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pptx import Presentation
>>> prs = Presentation("MyPresentation.pptx")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pptx/api.py", line 26, in __init__
self._package = Package.open(pkg_file)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pptx/package.py", line 44, in open
return super(Package, cls).open(pkg_file)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pptx/opc/package.py", line 122, in open
pkg_reader = PackageReader.from_file(pkg_file)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pptx/opc/pkgreader.py", line 36, in from_file
phys_reader, pkg_srels, content_types
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pptx/opc/pkgreader.py", line 69, in _load_serialized_parts
for partname, blob, srels in part_walker:
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pptx/opc/pkgreader.py", line 104, in _walk_phys_parts
phys_reader, part_srels, visited_partnames):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pptx/opc/pkgreader.py", line 104, in _walk_phys_parts
phys_reader, part_srels, visited_partnames):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pptx/opc/pkgreader.py", line 104, in _walk_phys_parts
phys_reader, part_srels, visited_partnames):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pptx/opc/pkgreader.py", line 101, in _walk_phys_parts
blob = phys_reader.blob_for(partname)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pptx/opc/phys_pkg.py", line 109, in blob_for
return self._zipf.read(pack_uri.membername)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 935, in read
return self.open(name, "r", pwd).read()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 961, in open
zinfo = self.getinfo(name)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 909, in getinfo
'There is no item named %r in the archive' % name)
KeyError: "There is no item named 'ppt/drawings/NULL' in the archive"
I’m using Pillow-3.1.1 XlsxWriter-0.8.4 lxml-3.6.0 python-pptx-0.5.8 on Python 2.7.10 on OS X. Thoughts on this error? Thanks! -Josh
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Using Python-pptx, what conditions could a PowerPoint have ...
A PPTX file is an Open Packaging Convention (OPC) package. ... error: KeyError: "There is no item named 'ppt/slides/NULL' in the archive" ....
Read more >ERROR: No item named xxx/yyy found - Jenkins Jira
Apparently the Pipeline Snippet Generator doesnt use the full project name, so it won't work if the Job is inside multiple, nested Folders...
Read more >Insert Line Break In Docx4J With Variable Replacement
When I open a particular PPTX file which opens without error or complaint in multiple No item named 'ppt/drawings/NULL' in the archive #206...
Read more >Address review suggestions for #33643 - IssueHint
SELinux issues deploying rook on CoreOS, 2, 2022-10-08 ; No item named 'ppt/drawings/NULL' in the archive, 11, 2016-03-31 ; build(deps): bump tar from...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I wrote a script that goes through all .rels files, find items with target=“NULL”, and remove those items from the corresponding .xml file. ex. If there’s an item=‘NULL’ in
ppt/slides/_rels/slide1.xml.rels
, I would get the Id of the item, then remove the object with the same Id inppt/slides/slide1.xml
I’m not sure if it covers all possibilities, and I have not tested extensively, but hope this helps.
This should be fixed in the upcoming release
0.6.20
due out today or tomorrow. Any relationship “pointing” to a package part that cannot be found (e.g. “NULL”) is now ignored. If the file is truly corrupted and a part is in fact missing, this isn’t going to help, but the common-ish case where a neglectful client has “removed” relationships simply by marking them “NULL” no longer raises an error on load.