Laurence Rowe | 30 Jan 16:59
Picon
Gravatar

Cython errors building from git on Mac OS X

I'm having trouble building lxml from a git clone on Mac OS X 10.6
with python.org python 2.7 or my own compiled python 2.6. Any idea
what might be causing the errors below?

Thanks in advance,

Laurence

$ python2.7 setup.py build
Building lxml version 2.4.dev.
Building with Cython 0.15.1.
Using build configuration of libxslt 1.1.24
Building against libxml2/libxslt in the following directory: /usr/local/lib
running build
running build_py
creating build/lib.macosx-10.6-intel-2.7
creating build/lib.macosx-10.6-intel-2.7/lxml
copying src/lxml/__init__.py -> build/lib.macosx-10.6-intel-2.7/lxml
copying src/lxml/_elementpath.py -> build/lib.macosx-10.6-intel-2.7/lxml
copying src/lxml/builder.py -> build/lib.macosx-10.6-intel-2.7/lxml
copying src/lxml/cssselect.py -> build/lib.macosx-10.6-intel-2.7/lxml
copying src/lxml/doctestcompare.py -> build/lib.macosx-10.6-intel-2.7/lxml
copying src/lxml/ElementInclude.py -> build/lib.macosx-10.6-intel-2.7/lxml
copying src/lxml/pyclasslookup.py -> build/lib.macosx-10.6-intel-2.7/lxml
copying src/lxml/sax.py -> build/lib.macosx-10.6-intel-2.7/lxml
copying src/lxml/usedoctest.py -> build/lib.macosx-10.6-intel-2.7/lxml
creating build/lib.macosx-10.6-intel-2.7/lxml/html
copying src/lxml/html/__init__.py -> build/lib.macosx-10.6-intel-2.7/lxml/html
copying src/lxml/html/_dictmixin.py -> build/lib.macosx-10.6-intel-2.7/lxml/html
copying src/lxml/html/_diffcommand.py ->
(Continue reading)

Piotr Oh | 24 Jan 14:49
Picon
Gravatar

from xml to sql

Hi
I'm not a programmer, so please be patient "> I just need some scripting done and my choice is python+lxml.

The problem to solve is.
1. xml file with some data is exported from our ERP system using third party tools. It has xml schema.
2. It is intended to import to another system (sql/firebird)
3. Between the export/import process I'd like to validate the xml (using xml schema)
4. Than I need to import it to another system:
4a. check the values of the corresponding data in xml and SQL database, compare them, do some action, write to log etc
4b. put them to SQL database, update (update, insert new)

Validating is simple (point 3). then I need to traverse the xml, record by record, do something with each and translate into sql query.

From this point of view IMHO what is the right way: use lxml.objectify or etree?
I don't care about efficiency. Instead it should be as simple as possible (to modify, read etc)

Could you give me some hints here? Some programming idioms, patterns or just basic pseudocode to follow?

Regards
Piotr

_________________________________________________________________
Mailing list for the lxml Python XML toolkit - http://lxml.de/
lxml <at> lxml.de
https://mailman-mail5.webfaction.com/listinfo/lxml
Willmer, Alex (PTS | 24 Jan 14:21
Picon
Favicon

Difference in behaviour: bug or bad usage?

The following is a simplified example of the behaviour we’re seeing the Sunburnt library, which uses lxml:

 

Python 2.4.3 (#1, Sep 21 2011, 19:55:41)

[GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import lxml.etree

>>> from lxml.builder import E

>>>

>>> class Foo(object):

...     QUERY = E.query

...    

...     def test(self, q):

...         return self.QUERY(q)

...

>>> foo = Foo()

>>> bar = foo.test('a')

Traceback (most recent call last):

  File "<stdin>", line 1, in ?

  File "<stdin>", line 5, in test

  File "/opt/define/lib/python2.4/site-packages/lxml-2.2.7_r0-py2.4-linux-x86_64.egg/lxml/builder.py", line 47, in <lambda>

    return lambda *args, **kwargs: func(tag, *args, **kwargs)

  File "/opt/define/lib/python2.4/site-packages/lxml-2.2.7_r0-py2.4-linux-x86_64.egg/lxml/builder.py", line 220, in __call__

    raise TypeError("bad argument type: %r" % item)

TypeError: bad argument type: <__main__.Foo object at 0x2b1a8a79ee10>

 

Python 2.7, lxml 2.7.7

>>> import lxml.etree

>>> from lxml.builder import E

>>>

>>> class Foo(object):

...     QUERY = E.query

...    

...     def test(self, q):

...         return self.QUERY(q)

...

>>> foo = Foo()

>>> bar = foo.test('a')

>>> print lxml.etree.tostring(bar)

<query>a</query>

 

I’m looking for guidance on whether the exception in Python 2.4 is due to a bug in lxml, incorrect usage in binding E.query to a class attribute, or perhaps an error on our part when building lxml on Redhat.

 

The Sunburnt code in which this occurred is SoldrDelete.delete_queries() https://github.com/tow/sunburnt/blob/master/sunburnt/schema.py#L617

 

With thanks, Alex


Think green - keep it on the screen. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
_________________________________________________________________
Mailing list for the lxml Python XML toolkit - http://lxml.de/
lxml <at> lxml.de
https://mailman-mail5.webfaction.com/listinfo/lxml
Adam Tauno Williams | 20 Jan 23:54
Gravatar

lxml/etree/XSLT and dynamic stylesheet variables

I'm using etree to perform XSLT transforms, such as -

from lxml import etree
source = etree.parse(self.rfile)
xslt = etree.fromstring(self._xslt)
transform = etree.XSLT(xslt)
result = transform(source)

according to the docs at
<http://lxml.de/xpathxslt.html#stylesheet-parameters> I can pass a
dictionary of parameters to transform, such as -

result = transform(doc_root, **{'non-python-identifier': '5'})

Can I pass a dictionary-like object?  That doesn't seem to be working.
I need to perform dynamic lookup of variables for the stylesheet.

I've subclassed dictionary and overloaded [], get, has_key, and in to
perform the required lookups; these work in testing. But passing the
object to transform doesn't work.

If that isn't possible is there an alternate XSLT implementation for
python that would allow calling back for variable values?

_________________________________________________________________
Mailing list for the lxml Python XML toolkit - http://lxml.de/
lxml <at> lxml.de
https://mailman-mail5.webfaction.com/listinfo/lxml
Tim Arnold | 20 Jan 19:40
Picon
Favicon

encoding question

I have to follow a specification for producing xhtml files. 
The original files are in cp1252 encoding and I must reencode them to utf-8.
Also, I have to replace certain characters with html entities.

I think I've got this right, but I'd like to hear if there's something I'm doing that is dangerous or wrong.
Please see the appended code, and thanks for any comments.

I have two functions, translate (replaces high characters with entities) and reencode (um, reencodes):
---------------------------------
import codecs, StringIO
from lxml import etree
high_chars = {
    0x2014:'&mdash;', # 'EM DASH',
    0x2013:'&ndash;', # 'EN DASH',
    0x0160:'&Scaron;',# 'LATIN CAPITAL LETTER S WITH CARON',
    0x201d:'&rdquo;', # 'RIGHT DOUBLE QUOTATION MARK',
    0x201c:'&ldquo;', # 'LEFT DOUBLE QUOTATION MARK',
    0x2019:"&rsquo;", # 'RIGHT SINGLE QUOTATION MARK',
    0x2018:"&lsquo;", # 'LEFT SINGLE QUOTATION MARK',
    0x2122:'&trade;', # 'TRADE MARK SIGN',
    0x00A9:'&copy;',  # 'COPYRIGHT SYMBOL',
    }
def translate(string):
    s = ''
    for c in string:
        if ord(c) in high_chars:
            c = high_chars.get(ord(c))
        s += c
    return s

def reencode(filename, in_encoding='cp1252',out_encoding='utf-8'):
    with codecs.open(filename,encoding=in_encoding) as f:
        s = f.read()
    sio = StringIO.StringIO(translate(s))
    parser = etree.HTMLParser(encoding=in_encoding)
    tree = etree.parse(sio, parser)
    result = etree.tostring(tree.getroot(), method='html', 
                            pretty_print=True,
                            encoding=out_encoding)
    with open(filename,'wb') as f:
        f.write(result)

if __name__ == '__main__':
    fname = 'mytest.htm'
    reencode(fname)

_________________________________________________________________
Mailing list for the lxml Python XML toolkit - http://lxml.de/
lxml <at> lxml.de
https://mailman-mail5.webfaction.com/listinfo/lxml
Piotr Oh | 20 Jan 08:20
Picon
Gravatar

objectify and namespaces weirdnes

Hi

I'm scratching the surface of the lxml library and found objectify.
I have xml file like this:
http://pastebin.com/3bE1rSpW
and would like to objectify it. The point is I have no idea how to deal with namespaces there.

what I'm doing
...
>>> tree=objectify.parse("file.xml",parser)
>>> root=tree.getroot()
>>> root.studenci.tag

....
AttributeError: no such child: {urn:polon:plikImp:1_5}studenci

or any other child.

Well, what I'm missing here? I am a bit confused about the name space syntax. How can I get to the different children in this objectified file?

P.
_________________________________________________________________
Mailing list for the lxml Python XML toolkit - http://lxml.de/
lxml <at> lxml.de
https://mailman-mail5.webfaction.com/listinfo/lxml
Motiejus Jakštys | 20 Jan 00:59
Picon
Gravatar

lxml cutting tails of strings

Hello, lxml community,

I get string tails cut off in certain cases when I parse XML data.  

How to reproduce:

Clone sample xml and python executable from here:
$ git clone git://github.com/Motiejus/lxml_report.git

and start it:
$ ./debug.py demo.xml

Actual output:
Got data len: 752
Got data len: 752
Got data len: 2169
Got data len: 375

Expected output:
Got data len: 752
Got data len: 752
Got data len: 2544
Got data len: 752

Is this a bug?

Python and (LXML) versions I have tried on two amd64 installations:
Debian Stable:
python: 2.6.6-3+squeeze6 and 3.1.3-12
lxml: 2.2.8-2
libxslt1.1: 1.1.26-6
libxml2: 2.7.8.dfsg-2+squeeze1

Debian Sid:
python: 2.7.2-9 and 3.2.2-1
lxml: 2.3.2-1 
libxslt1.1: 1.1.26-8
libxml2: 2.7.8.dfsg-6

This also happens with xml.etree.cElementTree, xml.etree.ElementTree and
xml.sax. However, data sets differ for every backend, and it was easiest to
create (a small) one for lxml.

Thank you for help.

Motiejus Jakštys
_________________________________________________________________
Mailing list for the lxml Python XML toolkit - http://lxml.de/
lxml <at> lxml.de
https://mailman-mail5.webfaction.com/listinfo/lxml
contro opinion | 18 Jan 11:30
Picon

parse problem

here is my code:

import urllib
import lxml.html

down="http://sc.hkex.com.hk/gb/www.hkex.com.hk/chi/market/sec_tradinfo/stockcode/eisdeqty_c.htm"
file=urllib.urlopen(down).
read()
root=lxml.html.document_fromstring(file)

data1 = root.xpath('//tr[ <at> class="tr_normal"  and  .//img]')
print "the row which contains img  :"
for u in data1:
    print  u.text_content()

data2 = root.xpath('//tr[ <at> class="tr_normal"  and  not(.//img)]')
print "the row which do not contain img  :"
for u in data2:
    print  u.text_content()


the output is :(i omit many lines )

the row which contains img  :
00329
the row which do not contain img  :
00001长江实业1,000#HOF
................many lines omitted   
00327百富环球1,000#H
00328ALCO HOLDINGS2,000# 

i wondered why  there are so many lines i can't get such as :
(you can see in the web
http://sc.hkex.com.hk/gb/www.hkex.com.hk/chi/market/sec_tradinfo/stockcode/eisdeqty_c.htm)


00330    思捷环球     100    #    H    O    F
00331    春天百货     2,000    #    H          
00332    NGAI LIK IND     4,000    #               
...................many lines  ommitted
i want to know how can i get these ??


_________________________________________________________________
Mailing list for the lxml Python XML toolkit - http://lxml.de/
lxml <at> lxml.de
https://mailman-mail5.webfaction.com/listinfo/lxml
Bartek Urbaniec | 18 Jan 11:15
Picon

Namespace inconsistency with attributes

Hello!

I have a problem with namespaces for attributes. lxml takes always first value (which in my case is default) from list of namespaces and uses it for attributes.

My xml file:

<Root xmlns="urn:schemas-microsoft-

com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
    <Child ss:Color = "Blue"/>
</Root>

My program which adds one child element:

from lxml import etree
from StringIO import StringIO

f = StringIO('<Root  xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"><Child ss:Color = "Blue"/></Root>')

parser = etree.parse(f)

nameSpaces = {'ss': 'urn:schemas-microsoft-com:office:spreadsheet'}
nameSpace = '{urn:schemas-microsoft-com:office:spreadsheet}'

root = parser.xpath("/ss:Root", namespaces = nameSpaces)[0]
child = etree.Element("Child")
child.set(nameSpace+"Color","Red")
root.append(child)
print etree.tostring(root, pretty_print=True)

And my result:

<Root xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
  <Child ss:Color="Blue"/>
  <Child Color="Red"/>
</Root>


I would like to have:

<Root xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
  <Child ss:Color="Blue"/>
  <Child ss:Color="Red"/>
</Root>

If i changed position of default namespace (I will put it at the end) everything will be OK. I will get attribute with prefix ss. But I cannot do this in that way. Is there other way to handle with that problem?

Thanks in advance
Bartek
_________________________________________________________________
Mailing list for the lxml Python XML toolkit - http://lxml.de/
lxml <at> lxml.de
https://mailman-mail5.webfaction.com/listinfo/lxml
Picon
Gravatar

Multi threaded lxml usage causes crash in etree.so (lxml.etree.c:160651)

Hey,


Spent about a month trying to track down the cause of a crash in one of our webapps.

When using uWSGI+Django, if you import lxml (without even using it) it will cause the worker to crash after the response has been sent back.

I have replicated the same problem in a fresh vbox install.

Attached is the gdb trace, and below is some info about the env + crash.

Any advice on this would be *very* much appreciated, and will do anything I can to assist.

Cal Leeming
Simplicity Media Ltd

----

Tue Jan 17 20:01:51 2012 - *** Starting uWSGI 1.0.2.1 (64bit) on [Tue Jan 17 20:01:51 2012] ***
Tue Jan 17 20:01:51 2012 - compiled with version: 4.4.5 on 16 January 2012 19:31:32
Tue Jan 17 20:01:51 2012 - current working directory: /home/duke
Tue Jan 17 20:01:51 2012 - writing pidfile to /home/chroot/home/duke_local/webapps/ddcms/pid/uwsgi.pid
Tue Jan 17 20:01:51 2012 - detected binary path: /home/duke/bin/uwsgi
Tue Jan 17 20:01:51 2012 - limiting address space of processes...
Tue Jan 17 20:01:51 2012 - your process address space limit is 536870912 bytes (512 MB)
Tue Jan 17 20:01:51 2012 - your memory page size is 4096 bytes
Tue Jan 17 20:01:51 2012 - allocated 7808 bytes (7 KB) for 8 cores per worker.
Tue Jan 17 20:01:51 2012 - uwsgi socket 0 bound to UNIX address /home/chroot/home/duke_local/webapps/ddcms/sock/uwsgi.sock fd 3
Tue Jan 17 20:01:51 2012 - Python main interpreter initialized at 0x7c5e90
Tue Jan 17 20:01:51 2012 - threads support enabled
Tue Jan 17 20:01:51 2012 - your server socket listen backlog is limited to 1024 connections
Tue Jan 17 20:01:51 2012 - *** Operational MODE: threaded ***
Tue Jan 17 20:01:51 2012 - added /home/chroot/home/duke_local/webapps/ddcms/webapp/ to pythonpath.
Tue Jan 17 20:01:51 2012 - WSGI application 0 (mountpoint='/') ready on interpreter 0x7c5e90 pid: 3527 (default app)
Tue Jan 17 20:01:51 2012 - spawned uWSGI master process (pid: 3527)
Tue Jan 17 20:01:51 2012 - spawned uWSGI worker 1 (pid: 3528, cores: 8)
Tue Jan 17 20:01:54 2012 - DAMN ! worker 1 (pid: 3528) died :( trying respawn ...
Tue Jan 17 20:01:54 2012 - Respawned uWSGI worker 1 (new pid: 3541)
Tue Jan 17 20:01:56 2012 - DAMN ! worker 1 (pid: 3541) died :( trying respawn ...
Tue Jan 17 20:01:56 2012 - Respawned uWSGI worker 1 (new pid: 3553)

[ 3276.149102] uwsgi[3531]: segfault at 27b00 ip 00007fefd0d802d4 sp 00007fefd952d6f0 error 4 in etree.so[7fefd0d10000+109000]
[ 3278.533480] uwsgi[3542]: segfault at 27b00 ip 00007fefd0d802d4 sp 00007fefda52f6f0 error 4 in etree.so[7fefd0d10000+109000]

Python version: 2.6.6 (r266:84292, Dec 26 2010, 22:48:11)  [GCC 4.4.5]

lxml.etree:        (2, 3, 3, 0)
libxml used:       (2, 7, 8)
libxml compiled:   (2, 7, 8)
libxslt used:      (1, 1, 26)
libxslt compiled:  (1, 1, 26)

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f912f2df700 (LWP 3432)]
0x00007f9126b7e2d4 in initetree () at src/lxml/lxml.etree.c:160651
160651  src/lxml/lxml.etree.c: No such file or directory.
        in src/lxml/lxml.etree.c
(gdb) bt full
#0  0x00007f9126b7e2d4 in initetree () at src/lxml/lxml.etree.c:160651
        __pyx_t_1 = 0x0
        __pyx_t_5 = <value optimized out>
        __pyx_t_6 = 0x7f91335ec848
        __pyx_t_7 = 0x0
        __pyx_t_8 = 0x7f9126b75fe0
        __pyx_t_9 = 0x7f91328baa60
        __pyx_t_11 = <value optimized out>
        __pyx_t_12 = <value optimized out>
        __pyx_t_13 = <value optimized out>
        __pyx_t_14 = <value optimized out>

#0  0x00007f9126b7e2d4 in initetree () at src/lxml/lxml.etree.c:160651
      __pyx_t_7 = ((PyObject *)PyUnicode_DecodeASCII(xmlParserVersion, strlen(xmlParserVersion), NULL)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L34_error;}

 root <at> test01 [/home/duke/deployment/ddcms.prod/current/ddcms/webapp/pyquery] > gdb
/home/duke/bin/uwsgi 3331
GNU gdb (GDB) 7.0.1-debian
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/duke/bin/uwsgi...done.
Attaching to program: /home/duke/bin/uwsgi, process 3331
Reading symbols from /lib/libpthread.so.0...(no debugging symbols found)...done.
[Thread debugging using libthread_db enabled]
[New Thread 0x7f912d2db700 (LWP 3338)]
[New Thread 0x7f912dadc700 (LWP 3337)]
[New Thread 0x7f912e2dd700 (LWP 3336)]
[New Thread 0x7f912eade700 (LWP 3335)]
[New Thread 0x7f912f2df700 (LWP 3334)]
[New Thread 0x7f912fae0700 (LWP 3333)]
[New Thread 0x7f91302e1700 (LWP 3332)]
Loaded symbols for /lib/libpthread.so.0
Reading symbols from /lib/libm.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libdl.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /usr/lib/libxml2.so.2...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libxml2.so.2
Reading symbols from /lib/libutil.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libutil.so.1
Reading symbols from /usr/lib/libpython2.6.so.1.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libpython2.6.so.1.0
Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /usr/lib/libz.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libz.so.1
Reading symbols from /usr/lib/libssl.so.0.9.8...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libssl.so.0.9.8
Reading symbols from /usr/lib/libcrypto.so.0.9.8...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libcrypto.so.0.9.8
Reading symbols from /usr/lib/python2.6/lib-dynload/_json.so...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/python2.6/lib-dynload/_json.so
Reading symbols from /usr/lib/python2.6/lib-dynload/datetime.so...(no debugging symbols found)...done.

Loaded symbols for /usr/lib/python2.6/lib-dynload/datetime.so
Reading symbols from /usr/local/lib/python2.6/dist-packages/MySQL_python-1.2.3-py2.6-linux-x86_64.egg/_mysql.so...done.
Loaded symbols for /usr/local/lib/python2.6/dist-packages/MySQL_python-1.2.3-py2.6-linux-x86_64.egg/_mysql.so
Reading symbols from /usr/lib/libmysqlclient_r.so.16...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libmysqlclient_r.so.16
Reading symbols from /lib/libcrypt.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libcrypt.so.1
Reading symbols from /lib/libnsl.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /usr/lib/python2.6/lib-dynload/resource.so...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/python2.6/lib-dynload/resource.so
0x00007f91321e0623 in epoll_wait () from /lib/libc.so.6
(gdb) bt
#0  0x00007f91321e0623 in epoll_wait () from /lib/libc.so.6
#1  0x0000000000426692 in event_queue_wait ()
#2  0x00000000004115fe in wsgi_req_accept ()
#3  0x0000000000429737 in simple_loop ()
#4  0x000000000042c93d in uwsgi_ignition ()
#5  0x000000000042ea5b in uwsgi_start ()
#6  0x00000000004337d5 in main ()
(gdb) c
Continuing.
[New Thread 0x7f912cada700 (LWP 3424)]
[New Thread 0x7f9127fff700 (LWP 3425)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f912f2df700 (LWP 3334)]
0x00007f9126b7e2d4 in initetree () at src/lxml/lxml.etree.c:160651
160651  src/lxml/lxml.etree.c: No such file or directory.
        in src/lxml/lxml.etree.c
(gdb) bt
#0  0x00007f9126b7e2d4 in initetree () at src/lxml/lxml.etree.c:160651
#1  0x00007f9132580218 in _PyImport_LoadDynamicModule () from /usr/lib/libpython2.6.so.1.0
#2  0x00007f913257e7df in ?? () from /usr/lib/libpython2.6.so.1.0
#3  0x00007f913257ed3c in ?? () from /usr/lib/libpython2.6.so.1.0
#4  0x00007f913257f322 in ?? () from /usr/lib/libpython2.6.so.1.0
#5  0x00007f913257f604 in PyImport_ImportModuleLevel () from /usr/lib/libpython2.6.so.1.0
#6  0x00007f9132561baf in ?? () from /usr/lib/libpython2.6.so.1.0
#7  0x00007f91324c2103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#8  0x00007f9132562103 in PyEval_CallObjectWithKeywords () from /usr/lib/libpython2.6.so.1.0
#9  0x00007f9132565b98 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#10 0x00007f9132569cc0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#11 0x00007f9132569d92 in PyEval_EvalCode () from /usr/lib/libpython2.6.so.1.0
#12 0x00007f913257b0d2 in PyImport_ExecCodeModuleEx () from /usr/lib/libpython2.6.so.1.0
#13 0x00007f913257d99e in ?? () from /usr/lib/libpython2.6.so.1.0
#14 0x00007f913257e7df in ?? () from /usr/lib/libpython2.6.so.1.0
#15 0x00007f913257ea6f in ?? () from /usr/lib/libpython2.6.so.1.0
#16 0x00007f913257f0f0 in ?? () from /usr/lib/libpython2.6.so.1.0
#17 0x00007f913257f604 in PyImport_ImportModuleLevel () from /usr/lib/libpython2.6.so.1.0
#18 0x00007f9132561baf in ?? () from /usr/lib/libpython2.6.so.1.0
#19 0x00007f91324c2103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#20 0x00007f9132562103 in PyEval_CallObjectWithKeywords () from /usr/lib/libpython2.6.so.1.0
#21 0x00007f9132565b98 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#22 0x00007f9132569cc0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#23 0x00007f9132569d92 in PyEval_EvalCode () from /usr/lib/libpython2.6.so.1.0
#24 0x00007f913257b0d2 in PyImport_ExecCodeModuleEx () from /usr/lib/libpython2.6.so.1.0
#25 0x00007f913257d99e in ?? () from /usr/lib/libpython2.6.so.1.0
#26 0x00007f913257e7df in ?? () from /usr/lib/libpython2.6.so.1.0
#27 0x00007f913257ea6f in ?? () from /usr/lib/libpython2.6.so.1.0
#28 0x00007f913257f0b0 in ?? () from /usr/lib/libpython2.6.so.1.0
#29 0x00007f913257f604 in PyImport_ImportModuleLevel () from /usr/lib/libpython2.6.so.1.0
#30 0x00007f9132561baf in ?? () from /usr/lib/libpython2.6.so.1.0
#31 0x00007f91324c2103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#32 0x00007f9132562103 in PyEval_CallObjectWithKeywords () from /usr/lib/libpython2.6.so.1.0
#33 0x00007f9132565b98 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#34 0x00007f9132569cc0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#35 0x00007f9132569d92 in PyEval_EvalCode () from /usr/lib/libpython2.6.so.1.0
#36 0x00007f913257b0d2 in PyImport_ExecCodeModuleEx () from /usr/lib/libpython2.6.so.1.0
#37 0x00007f913257d99e in ?? () from /usr/lib/libpython2.6.so.1.0
#38 0x00007f913257e7df in ?? () from /usr/lib/libpython2.6.so.1.0
#39 0x00007f913257ea6f in ?? () from /usr/lib/libpython2.6.so.1.0
#40 0x00007f913257f0b0 in ?? () from /usr/lib/libpython2.6.so.1.0
#41 0x00007f913257f604 in PyImport_ImportModuleLevel () from /usr/lib/libpython2.6.so.1.0
#42 0x00007f9132561baf in ?? () from /usr/lib/libpython2.6.so.1.0
#43 0x00007f91324c2103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#44 0x00007f9132562103 in PyEval_CallObjectWithKeywords () from /usr/lib/libpython2.6.so.1.0
#45 0x00007f9132565b98 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#46 0x00007f9132569cc0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#47 0x00007f9132569d92 in PyEval_EvalCode () from /usr/lib/libpython2.6.so.1.0
#48 0x00007f913257b0d2 in PyImport_ExecCodeModuleEx () from /usr/lib/libpython2.6.so.1.0
#49 0x00007f913257d99e in ?? () from /usr/lib/libpython2.6.so.1.0
#50 0x00007f913257e22d in ?? () from /usr/lib/libpython2.6.so.1.0
#51 0x00007f913257e7df in ?? () from /usr/lib/libpython2.6.so.1.0
#52 0x00007f913257ea6f in ?? () from /usr/lib/libpython2.6.so.1.0
---Type <return> to continue, or q <return> to quit---
#53 0x00007f913257f0f0 in ?? () from /usr/lib/libpython2.6.so.1.0
#54 0x00007f913257f604 in PyImport_ImportModuleLevel () from /usr/lib/libpython2.6.so.1.0
#55 0x00007f9132561baf in ?? () from /usr/lib/libpython2.6.so.1.0
#56 0x00007f91324c2103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#57 0x00007f9132562103 in PyEval_CallObjectWithKeywords () from /usr/lib/libpython2.6.so.1.0
#58 0x00007f9132565b98 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#59 0x00007f9132569cc0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#60 0x00007f9132569d92 in PyEval_EvalCode () from /usr/lib/libpython2.6.so.1.0
#61 0x00007f913257b0d2 in PyImport_ExecCodeModuleEx () from /usr/lib/libpython2.6.so.1.0
#62 0x00007f913257d99e in ?? () from /usr/lib/libpython2.6.so.1.0
#63 0x00007f913257e7df in ?? () from /usr/lib/libpython2.6.so.1.0
#64 0x00007f913257ea6f in ?? () from /usr/lib/libpython2.6.so.1.0
#65 0x00007f913257f0f0 in ?? () from /usr/lib/libpython2.6.so.1.0
#66 0x00007f913257f604 in PyImport_ImportModuleLevel () from /usr/lib/libpython2.6.so.1.0
#67 0x00007f9132561baf in ?? () from /usr/lib/libpython2.6.so.1.0
#68 0x00007f9132567f80 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#69 0x00007f9132569cc0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#70 0x00007f9132567ffb in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#71 0x00007f9132569cc0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#72 0x00007f9132567ffb in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#73 0x00007f9132568878 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#74 0x00007f9132568878 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#75 0x00007f9132568878 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#76 0x00007f9132569cc0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#77 0x00007f9132567ffb in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#78 0x00007f9132569cc0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#79 0x00007f9132569d92 in PyEval_EvalCode () from /usr/lib/libpython2.6.so.1.0
#80 0x00007f913257b0d2 in PyImport_ExecCodeModuleEx () from /usr/lib/libpython2.6.so.1.0
#81 0x00007f913257d99e in ?? () from /usr/lib/libpython2.6.so.1.0
#82 0x00007f913257e7df in ?? () from /usr/lib/libpython2.6.so.1.0
#83 0x00007f913257ea6f in ?? () from /usr/lib/libpython2.6.so.1.0
#84 0x00007f913257f0f0 in ?? () from /usr/lib/libpython2.6.so.1.0
#85 0x00007f913257f604 in PyImport_ImportModuleLevel () from /usr/lib/libpython2.6.so.1.0
#86 0x00007f9132561baf in ?? () from /usr/lib/libpython2.6.so.1.0
#87 0x00007f9132567f80 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#88 0x00007f9132569cc0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#89 0x00007f9132567ffb in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#90 0x00007f9132568878 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#91 0x00007f9132569cc0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#92 0x00007f9132569d92 in PyEval_EvalCode () from /usr/lib/libpython2.6.so.1.0
#93 0x00007f913257b0d2 in PyImport_ExecCodeModuleEx () from /usr/lib/libpython2.6.so.1.0
#94 0x00007f913257d99e in ?? () from /usr/lib/libpython2.6.so.1.0
#95 0x00007f913257e7df in ?? () from /usr/lib/libpython2.6.so.1.0
#96 0x00007f913257ea6f in ?? () from /usr/lib/libpython2.6.so.1.0
#97 0x00007f913257f0f0 in ?? () from /usr/lib/libpython2.6.so.1.0
#98 0x00007f913257f604 in PyImport_ImportModuleLevel () from /usr/lib/libpython2.6.so.1.0
#99 0x00007f9132561baf in ?? () from /usr/lib/libpython2.6.so.1.0
#100 0x00007f9132567f80 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#101 0x00007f9132569cc0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#102 0x00007f9132567ffb in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#103 0x00007f9132569cc0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#104 0x00007f91324ef980 in ?? () from /usr/lib/libpython2.6.so.1.0
#105 0x00007f91324c2103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
---Type <return> to continue, or q <return> to quit---
#106 0x00007f91324c4bbf in PyObject_CallFunction () from /usr/lib/libpython2.6.so.1.0
#107 0x00007f913250711b in PyObject_GenericGetAttr () from /usr/lib/libpython2.6.so.1.0
#108 0x00007f91325660ad in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#109 0x00007f9132569cc0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#110 0x00007f91324ef980 in ?? () from /usr/lib/libpython2.6.so.1.0
#111 0x00007f91324c2103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#112 0x00007f91324c4bbf in PyObject_CallFunction () from /usr/lib/libpython2.6.so.1.0
#113 0x00007f913250711b in PyObject_GenericGetAttr () from /usr/lib/libpython2.6.so.1.0
#114 0x00007f91325660ad in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#115 0x00007f9132569cc0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#116 0x00007f91324efa7d in ?? () from /usr/lib/libpython2.6.so.1.0
#117 0x00007f91324c2103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#118 0x00007f91325668af in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#119 0x00007f9132569cc0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#120 0x00007f91324ef980 in ?? () from /usr/lib/libpython2.6.so.1.0
#121 0x00007f91324c2103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#122 0x00007f91324d3abf in ?? () from /usr/lib/libpython2.6.so.1.0
#123 0x00007f91324c2103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#124 0x00007f913252845c in ?? () from /usr/lib/libpython2.6.so.1.0
#125 0x00007f91324c2103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#126 0x00007f91325676b9 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#127 0x00007f9132569cc0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#128 0x00007f9132567ffb in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#129 0x00007f9132569cc0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#130 0x00007f9132567ffb in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#131 0x00007f9132569cc0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#132 0x00007f91324efa7d in ?? () from /usr/lib/libpython2.6.so.1.0
#133 0x00007f91324c2103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#134 0x00007f91325668af in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#135 0x00007f9132569cc0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#136 0x00007f91324ef980 in ?? () from /usr/lib/libpython2.6.so.1.0
#137 0x00007f91324c2103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#138 0x00007f91324d3abf in ?? () from /usr/lib/libpython2.6.so.1.0
#139 0x00007f91324c2103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#140 0x00007f913252845c in ?? () from /usr/lib/libpython2.6.so.1.0
#141 0x00007f91324c2103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#142 0x00007f91325676b9 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#143 0x00007f9132568878 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#144 0x00007f9132569cc0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#145 0x00007f91324ef980 in ?? () from /usr/lib/libpython2.6.so.1.0
#146 0x00007f91324c2103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#147 0x00007f91324d3abf in ?? () from /usr/lib/libpython2.6.so.1.0
#148 0x00007f91324c2103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#149 0x00007f913252845c in ?? () from /usr/lib/libpython2.6.so.1.0
#150 0x00007f91324c2103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#151 0x00007f91325676b9 in PyEval_EvalFrameEx () from /usr/lib/libpython2.6.so.1.0
#152 0x00007f9132569cc0 in PyEval_EvalCodeEx () from /usr/lib/libpython2.6.so.1.0
#153 0x00007f91324ef980 in ?? () from /usr/lib/libpython2.6.so.1.0
#154 0x00007f91324c2103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#155 0x00007f91324d3abf in ?? () from /usr/lib/libpython2.6.so.1.0
#156 0x00007f91324c2103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
#157 0x00007f913252845c in ?? () from /usr/lib/libpython2.6.so.1.0
#158 0x00007f91324c2103 in PyObject_Call () from /usr/lib/libpython2.6.so.1.0
---Type <return> to continue, or q <return> to quit---
#159 0x00007f9132562103 in PyEval_CallObjectWithKeywords () from /usr/lib/libpython2.6.so.1.0
#160 0x000000000043bfcf in python_call ()
#161 0x000000000043e3bc in uwsgi_request_wsgi ()
#162 0x0000000000411a6d in wsgi_req_recv ()
#163 0x0000000000429743 in simple_loop ()
#164 0x00007f91333028ba in start_thread () from /lib/libpthread.so.0
#165 0x00007f91321e002d in clone () from /lib/libc.so.6
#166 0x0000000000000000 in ?? ()
(gdb)
(gdb)
(gdb)
(gdb)
_________________________________________________________________
Mailing list for the lxml Python XML toolkit - http://lxml.de/
lxml <at> lxml.de
https://mailman-mail5.webfaction.com/listinfo/lxml
Mag Gam | 15 Jan 16:27
Picon

need help with finding elements

Hello,

I have a xml file like this,
http://msdn.microsoft.com/en-us/library/windows/desktop/ms762271(v=vs.85).aspx

Lets say I want to get all the book titles authored by, ¨O'Brien,
Tim¨.  What is the best way to do that?
_________________________________________________________________
Mailing list for the lxml Python XML toolkit - http://lxml.de/
lxml <at> lxml.de
https://mailman-mail5.webfaction.com/listinfo/lxml

Gmane