alistairstead3408 / openxmllib

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

Second parameter in etree.XPath() should be named as namespaces #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I am using plone 3.1.6, and Products.OpenXML with lxml==1.3.6 in the
plone.recipe.lxml recipe for building lxml through buidout.
2. This works just fine in my ubuntu development box, but on my production
rPath linux deployment it bombs during zope startup with the error that
only 1 non-keyword parameter is accepted by the  etree.XPath method.
3. So I looked it up on codespeak and it seems that the second parameter
should be named as namespaces = and I tried doing that, and it worked!
The exact full line (in openxmllib/utils.py) after changing is:
self.text_elts_xpaths.append(etree.XPath('//' + element_name,
namespaces=ns_map))

Just wanted to let you know that this fixed it for me on the rPath linux
deployment and now I'm attempting to get all required stuff within my
buildout just so I can distribute my deployment immediately. If this is
actually a correct fix for this, please include it in a future update. This
will let me go back to using it directly from the eggs in the buildout and
that would be great!

Great effort on providing plone indexing for Office 2007 document formats,
I love openxmllib and Products.openxml.

Thanks,
Dhiraj Gupta.

Original issue reported on code.google.com by dhirajgu...@gmail.com on 13 Nov 2008 at 3:18

GoogleCodeExporter commented 9 years ago
Thanks for your feedback and support.
I dunno what's rPath linux (sorry for this) and I suspect you have a newer 
version of
lxml installed on this box (means > 1/3/x) that changed the API.

Installing a newer version (2.x +) of lxml on my MacOSX box is very painful and 
I
can't actually unit test your change.

As soon as I succeed inistalling lxml 2.x I'll test your patch.

BTW, can you please attach a "svn diff" of your patch against the trunk? I'll 
add it
in a branch for you.

Original comment by gilles.l...@gmail.com on 18 Nov 2008 at 11:25

GoogleCodeExporter commented 9 years ago
Hi Gilles,

No, I'm not using lxml 2.0.x series, I am on lxml 1.3.6 and it is still 
happening on
that version.

I have attached the diff file, it's a very small change and will not impact the 
main
even if you put it on trunk - it runs on my ubuntu box just as well as the rPath
production box.

Thanks for the reply,
Regards,
Dhiraj Gupta.

Original comment by dhirajgu...@gmail.com on 18 Nov 2008 at 11:52

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Dhiraj,

I made some fixes including your patch in the subversion trunk. Can you please 
run
the unit tests on your platform and tell me if all's OK ?

Cheers.

Original comment by gilles.l...@gmail.com on 19 Nov 2008 at 10:51