Peter Hoffmann | 2 Sep 2012 21:35
Favicon
Gravatar

Sphinx Documentation

Hi all,

I have started to port[0] the documentation to sphinx. As I have
read[1] on the mailling list that's a task where help would be
appreciated.

Because the documentation is already in rst format, an initial build
with sphinx was easy and the result[2] looks quite promising.

The next steps will be:

* remove markup specific to the current build system and replace it
with sphinx idioms
* fix pdf generation
* use sphinx for api documentation (with sphinx autodoc where possible)
* theme/layout

If you have additional ideas or things I should pay attention to
please let me know.

Peter

[0]: https://github.com/hoffmann/lxml
[1]: http://thread.gmane.org/gmane.comp.python.lxml.devel/5821/focus=5822
[2]: http://vps.peter-hoffmann.com/lxml-sphinx/
_________________________________________________________________
Mailing list for the lxml Python XML toolkit - http://lxml.de/
lxml <at> lxml.de
https://mailman-mail5.webfaction.com/listinfo/lxml
(Continue reading)

Stefan Behnel | 2 Sep 2012 22:03
Picon
Favicon

Re: Sphinx Documentation

Peter Hoffmann, 02.09.2012 21:35:
> I have started to port[0] the documentation to sphinx. As I have
> read[1] on the mailling list that's a task where help would be
> appreciated.

Definitely! Thanks for picking it up.

> Because the documentation is already in rst format, an initial build
> with sphinx was easy and the result[2] looks quite promising.
> 
> The next steps will be:
> 
> * remove markup specific to the current build system and replace it
> with sphinx idioms

Most of that should be doable with a straight forward search & replace. But
try to be a bit careful that the PDF generation can still work afterwards.
Don't use Sphinx features carelessly, because they won't be available for
the PDF.

> * fix pdf generation

You can give rst2pdf a try. I prefer it over rst2latex these days. Sphinx
won't help much with PDF generation anyway.

> * use sphinx for api documentation (with sphinx autodoc where possible)

Not sure how well that will work. Lxml relies on an epydoc feature that
parses the signature from the first line in the docstring (because most
tools don't bother figuring out the signatures of Cython implemented
(Continue reading)

mark grandi | 5 Sep 2012 01:27
Picon
Gravatar

Re: Building lxml with mac os x mountain lion fails.

Stefan Behnel <stefan_ml <at> behnel.de> writes:

> 
> 
> http://comments.gmane.org/gmane.comp.python.lxml.devel/6515
> 
> Stefan
> 
> _________________________________________________________________
> Mailing list for the lxml Python XML toolkit - http://lxml.de/
> lxml <at> lxml.de
> https://mailman-mail5.webfaction.com/listinfo/lxml
> 

Doesn't work =/

I did export LIBXML2_VERSION=2.8.0, but since i'm on mountain lion, it seems 
that the script keeps trying to use the wrong sdk, its no longer 
/Developer/SDKs/MacOSX10.4u.sdk, but /Applications/Xcode.app/Contents/Developer.

Also, i've read that xcode no longer supports building ppc binaries, and that 
was causing the entire  build to fail with something like 

'lipo: can't figure out the architecture type of: /var/
folders/10/10P5vwX-Ghmkg8s25PMr3E+++TI/-Tmp-//ccZQsHOd.out
error: Setup script exited with error: command 'gcc-4.0' failed with exit 
status 1 ". 

See http://
stackoverflow.com/a/5806246/975046, the fix listed, having 
(Continue reading)

mark grandi | 6 Sep 2012 11:07
Picon
Gravatar

Re: Building lxml with mac os x mountain lion fails.

mark grandi <markgrandi <at> gmail.com> writes:

> ImportError:
>  dlopen(/Users/markgrandi/Library/Python/3.2/lib/python/site-packages/
>  lxml-2.3.5-py3.2-macosx-10.6-intel.egg/lxml/etree.so, 2): Symbol not found:
>   _lzma_auto_decoder
>   Referenced from: /Users/markgrandi/Library/Python/3.2/lib/python/
> site-packages/lxml-2.3.5-
> py3.2-macosx-10.6-intel.egg/lxml/etree.so
>   Expected in: flat namespace
>  in /Users/markgrandi/Library/Python/3.2/lib/python/site-packages/
>  lxml-2.3.5-py3.2-macosx-10.6-intel.egg/lxml/etree.so
> 
> no idea why =/ 
> 
> _________________________________________________________________
> Mailing list for the lxml Python XML toolkit - http://lxml.de/
> lxml <at> lxml.de
> https://mailman-mail5.webfaction.com/listinfo/lxml
> 

Well, I seem to of figured it out. It seems that libxml2 by default tries to 
include lzma, but since I recently installed the xz libraries, its probably 
having some conflict with the static vs not static version of  liblzma, so i 
edited the buildlibxml.py script to pass in a '--without-lzma' option, and that 
worked. My entire compile process is listed below. The setup script REALLY 
needs to be updated to work with recent versions of mac os x.....

Corvidae:lxml-2.3.5 markgrandi$ echo $CFLAGS
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
(Continue reading)

Stefan Behnel | 6 Sep 2012 17:42
Picon
Favicon

Re: Building lxml with mac os x mountain lion fails.

mark grandi, 06.09.2012 11:07:
> The setup script REALLY 
> needs to be updated to work with recent versions of mac os x.....

Can you provide a pull request?

Stefan

_________________________________________________________________
Mailing list for the lxml Python XML toolkit - http://lxml.de/
lxml <at> lxml.de
https://mailman-mail5.webfaction.com/listinfo/lxml
descusr | 8 Sep 2012 10:54
Picon
Gravatar

the lxml.etree bug

Hello:
    I try to parse the page: http://www.liqucn.com.
    My py-code:
    #coding=utf-8
    from lxml import etree,tostring
    import requests
    resp = requests.get('http://www.liqucn.com')
    html = resp.text
    page = etree.HTML(html)
    print tostring(page)
#-------------------------------------
    I found many missing html-code where affter '<span class="app_ico"><a 
href="http://www.liqucn.com/yx/17773.shtml" target="_blank" 
lz_src="http://images.liqucn.com/mini/60x60/h005/h79/img201208220736340_60x60.png
" '.I am doubt this result very confused.You can you open this url, see the 
source code, and then run my code.Thank you!

_________________________________________________________________
Mailing list for the lxml Python XML toolkit - http://lxml.de/
lxml <at> lxml.de
https://mailman-mail5.webfaction.com/listinfo/lxml
Brett | 12 Sep 2012 09:05

Re: Building lxml with mac os x mountain lion fails.

mark grandi <markgrandi <at> gmail.com> writes:

> 
> Well, I seem to of figured it out. It seems that libxml2 by default tries to 
> include lzma, but since I recently installed the xz libraries, its probably 
> having some conflict with the static vs not static version of  liblzma, so i 
> edited the buildlibxml.py script to pass in a '--without-lzma' option, and 
> that worked. My entire compile process is listed below. The setup script 
> REALLY needs to be updated to work with recent versions of mac os x...
> 
> Corvidae:lxml-2.3.5 markgrandi$ echo $CFLAGS
> -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
> /Developer/SDKs/MacOSX10.8.sdk/
> 
> Corvidae:lxml-2.3.5 markgrandi$ echo $LDFLAGS
> -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
> /Developer/SDKs/MacOSX10.8.sdk/usr/lib
> ...snip...
> add '--without-lzma' to that list, so it becomes
> 
>     # build libxml2
>     libxml2_configure_cmd = configure_cmd + [
>         '--without-python',
>         '--with-iconv=%s' % prefix,
>         '--without-lzma']
> ...snip...

I tried the following and it seems to work fine:
lilliput:lxml-2.3.5 brett$ STATIC_DEPS=true sudo easy_install "lxml==2.3.5"
lilliput:lxml-2.3.5 brett$ sudo python setup.py install
(Continue reading)

Mark Grandi | 12 Sep 2012 09:25
Picon
Gravatar

Re: Building lxml with mac os x mountain lion fails.

My mistake, I should of clarified that this was for python 3.
Easy_install works great but it doesn't run under python3...
From: Brett
Sent: 9/12/2012 12:11 AM
To: lxml <at> lxml.de
Subject: Re: [lxml] Building lxml with mac os x mountain lion fails.
mark grandi <markgrandi <at> gmail.com> writes:

>
> Well, I seem to of figured it out. It seems that libxml2 by default tries to
> include lzma, but since I recently installed the xz libraries, its probably
> having some conflict with the static vs not static version of  liblzma, so i
> edited the buildlibxml.py script to pass in a '--without-lzma' option, and
> that worked. My entire compile process is listed below. The setup script
> REALLY needs to be updated to work with recent versions of mac os x...
>
> Corvidae:lxml-2.3.5 markgrandi$ echo $CFLAGS
> -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
> /Developer/SDKs/MacOSX10.8.sdk/
>
> Corvidae:lxml-2.3.5 markgrandi$ echo $LDFLAGS
> -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
> /Developer/SDKs/MacOSX10.8.sdk/usr/lib
> ...snip...
> add '--without-lzma' to that list, so it becomes
>
>     # build libxml2
>     libxml2_configure_cmd = configure_cmd + [
>         '--without-python',
>         '--with-iconv=%s' % prefix,
(Continue reading)

Stefan Behnel | 12 Sep 2012 22:27
Picon
Favicon

Re: Strange memory leakage problem on Ubuntu

Hi,

please do not spam the list with repeated posts.

zzjjzzgggg, 12.09.2012 10:09:
>     I am new to lxml. I installed lxml on Ubuntu 12.04 via easy_install as suggested
>             easy_install --allow-hosts=lxml.de,*.python.org lxml
>     The version of libxml2 is 
>             Version: 2.7.8.dfsg-5.1ubuntu4.1 
>     I use python 3.2.
> 
>     When I use lxml to process some HTML fragments, I find serious memory leakage issues. 
> The test code and test data are attached. 
>     When I remove this line
>             ps=html.xpath("//p[ <at> node-type='feed_list_content']") ,
> There isn't memory leakage problem. 

Thanks for the report.

I can reproduce this, also with a later version of libxml2 and Python 2.7.
Haven't investigated it yet, so I have no idea what is going wrong.

Stefan

_________________________________________________________________
Mailing list for the lxml Python XML toolkit - http://lxml.de/
lxml <at> lxml.de
https://mailman-mail5.webfaction.com/listinfo/lxml
Stefan Behnel | 12 Sep 2012 22:32
Picon
Favicon

Re: Building lxml with mac os x mountain lion fails.

> From: Brett
> mark grandi writes:
>> Well, I seem to of figured it out. It seems that libxml2 by default tries to
>> include lzma, but since I recently installed the xz libraries, its probably
>> having some conflict with the static vs not static version of  liblzma, so i
>> edited the buildlibxml.py script to pass in a '--without-lzma' option, and
>> that worked. My entire compile process is listed below. The setup script
>> REALLY needs to be updated to work with recent versions of mac os x...
>>
>> Corvidae:lxml-2.3.5 markgrandi$ echo $CFLAGS
>> -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
>> /Developer/SDKs/MacOSX10.8.sdk/
>>
>> Corvidae:lxml-2.3.5 markgrandi$ echo $LDFLAGS
>> -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
>> /Developer/SDKs/MacOSX10.8.sdk/usr/lib
>> ...snip...
>> add '--without-lzma' to that list, so it becomes
>>
>>     # build libxml2
>>     libxml2_configure_cmd = configure_cmd + [
>>         '--without-python',
>>         '--with-iconv=%s' % prefix,
>>         '--without-lzma']
>> ...snip...
> 
> I tried the following and it seems to work fine:
> lilliput:lxml-2.3.5 brett$ STATIC_DEPS=true sudo easy_install "lxml==2.3.5"
> lilliput:lxml-2.3.5 brett$ sudo python setup.py install
> lilliput:lxml-2.3.5 brett$ python
(Continue reading)


Gmane