alistairstead3408 / openxmllib

Automatically exported from code.google.com/p/openxmllib
GNU General Public License v2.0
0 stars 0 forks source link

test file presentation1.pptx has slides with wrong filename case #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. install all the requirement (lxml-1.3.6, openxmllib) on a case sensitive
file system (for example linux ext3)
2. execute :  openxmlinfo.py words tests/in/presentation1.pptx
3. the result is a: <not found file> in directory slide/

What is the expected output? 
Chapter presentation proud three two four item one My

What do you see instead?
--snippet
Traceback (most recent call last):
  File "scripts/openxmlinfo.py", line 117, in ?
    Application().run()
  File "scripts/openxmlinfo.py", line 52, in run
    self.commands[self.args[0]](self)
  File "scripts/openxmlinfo.py", line 64, in wordsCmd
    self.showWords(filename)
  File "scripts/openxmlinfo.py", line 94, in showWords
    text = doc.indexableText(include_properties=False)
  File
"/var/tmp/plone.products/dev/openxmllib-1.0.1/openxmllib/document.py", line
184, in indexableText
    for tree in self.content_types.getTreesFor(self, extractor.content_type):
  File
"/var/tmp/plone.products/dev/openxmllib-1.0.1/openxmllib/contenttypes.py",
line 101, in getTreesFor
    yield etree.parse(utils.xmlFile(file_path, 'rb'))
  File "/var/tmp/plone.products/dev/openxmllib-1.0.1/openxmllib/utils.py",
line 20, in xmlFile
    fh = file(path, mode)
IOError: [Errno 2] No such file or directory:
'/tmp/tmpUmFI8I/ppt/slides/slide1.xml'
--snippet end

What version of the product are you using? On what operating system?
1.0.0 and 1.0.1 for openxml
1.3.6 lxml
Linux 2.6.25-gentoo-r4 #3 SMP PREEMPT Wed Sep 10 21:47:00 CEST 2008 i686
Intel(R) Pentium(R) M processor 1600MHz GenuineIntel GNU/Linux

Please provide any additional information below.
file /ppt/_rels/presentation.xml.rels has the wrong relations:
--snippet
<Relationship
Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide"
Id="sId1" Target="slides/slide1.xml" /><Relationship
Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide"
Id="sId2" Target="slides/slide2.xml" /><Relationship
Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideM
aster"
Id="smId1" Target="slideMasters/slideMaster1.xml" /></Relationships>
--snippet end
and /[Content_Types].xml also
--snippet
<Override PartName="/ppt/slides/slide1.xml"
ContentType="application/vnd.openxmlformats-officedocument.presentationml.slide+
xml"
/><Override PartName="/ppt/slides/slide2.xml"
ContentType="application/vnd.openxmlformats-officedocument.presentationml.slide+
xml"
/>
--snippet end
At this point you have two solution : 1. only correct the filenames
themselves 2. correct all the relations. I did both.  
1. I corrected the problem so I simply change the zipped filenames from
Slide1.xml to slide1.xml and Slide2.xml to slide2.xml (as they are in the
.rel file).
2. I corrected the two relations in the two following files:
  /[Content_Types].xml
  /ppt/_rels/presentation.xml.rels

all tough both works Hackers would prefer the first version and Purist the
second. I am neither one of the other but I love snaking around
specification and implementation of Microsoft. You are not guilty in any of
both.

Cheers ! Joyeux Noel

P.S.
Here are the both corrected presentation to test with

Original issue reported on code.google.com by giobi...@gmail.com on 22 Dec 2008 at 3:53

Attachments:

GoogleCodeExporter commented 9 years ago
Hi,

This has already been fixed in 1.0.3  - and the trunk of course. Now the tests 
smile
with MacOS, Linux and Windows. As I'm developing openxmllib with MacOS ("ignore 
case"
file system like Windows), I didnt notice this bug in the early releases of 
openxmllib.

Anyway thanks for help.

Original comment by gilles.l...@gmail.com on 22 Dec 2008 at 4:11