Test failure under python 3.3

Bug #1251451 reported by Stefano Rivera
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Beautiful Soup
Won't Fix
Undecided
Unassigned

Bug Description

I got this, building 4.3.2 in debian sid this evening.

======================================================================
ERROR: test_smart_quotes_converted_on_the_way_in (bs4.tests.test_lxml.LXMLTreeBuilderSmokeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./bs4/testing.py", line 337, in test_smart_quotes_converted_on_the_way_in
    soup = self.soup(quote)
  File "./bs4/testing.py", line 29, in soup
    return BeautifulSoup(markup, builder=builder, **kwargs)
  File "./bs4/__init__.py", line 196, in __init__
    self._feed()
  File "./bs4/__init__.py", line 210, in _feed
    self.builder.feed(self.markup)
  File "./bs4/builder/_lxml.py", line 226, in feed
    self.parser.close()
  File "parser.pxi", line 1209, in lxml.etree._FeedParser.close (src/lxml/lxml.etree.c:89871)
  File "parsertarget.pxi", line 136, in lxml.etree._TargetParserContext._handleParseResult (src/lxml/lxml.etree.c:99138)
  File "parsertarget.pxi", line 130, in lxml.etree._TargetParserContext._handleParseResult (src/lxml/lxml.etree.c:99046)
  File "lxml.etree.pyx", line 294, in lxml.etree._ExceptionContext._raise_if_stored (src/lxml/lxml.etree.c:9359)
TypeError: function takes exactly 5 arguments (1 given)

In my slightly inebriated state right now, I can't see what's wrong, or if this is an LXML bug. So, I'll file it, and hope somene else gets ot the bottom of it :)

Revision history for this message
Leonard Richardson (leonardr) wrote :

This is the same as bug 1175159. My guess is it's a platform-specific bug in lxml. I've never been able to duplicate it. I'd appreciate it if you could do some more digging into the issue.

Revision history for this message
IAN DELANEY (johneed) wrote :

well I'm far from inebriated and I got it too.

 * python3_2: running distutils-r1_run_phase python_compile_all
>>> Source compiled.
 * python3_2: running distutils-r1_run_phase python_test
/usr/lib64/python3.2/site-packages/nose/plugins/manager.py:395: RuntimeWarning: Unable to load plugin html-output = htmloutput.htmloutput:HtmlOutput: No module named version
  RuntimeWarning)
.............................................................................................E.........................................................................................................................................................................................................................................................
======================================================================
ERROR: test_smart_quotes_converted_on_the_way_in (bs4.tests.test_lxml.LXMLTreeBuilderSmokeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/mnt/gen2/TmpDir/portage/dev-python/beautifulsoup-4.3.2/work/beautifulsoup4-4.3.2-python3_2/lib/bs4/testing.py", line 337, in test_smart_quotes_converted_on_the_way_in
    soup = self.soup(quote)
  File "/mnt/gen2/TmpDir/portage/dev-python/beautifulsoup-4.3.2/work/beautifulsoup4-4.3.2-python3_2/lib/bs4/testing.py", line 29, in soup
    return BeautifulSoup(markup, builder=builder, **kwargs)
  File "/mnt/gen2/TmpDir/portage/dev-python/beautifulsoup-4.3.2/work/beautifulsoup4-4.3.2-python3_2/lib/bs4/__init__.py", line 196, in __init__
    self._feed()
  File "/mnt/gen2/TmpDir/portage/dev-python/beautifulsoup-4.3.2/work/beautifulsoup4-4.3.2-python3_2/lib/bs4/__init__.py", line 210, in _feed
    self.builder.feed(self.markup)
  File "/mnt/gen2/TmpDir/portage/dev-python/beautifulsoup-4.3.2/work/beautifulsoup4-4.3.2-python3_2/lib/bs4/builder/_lxml.py", line 226, in feed
    self.parser.close()
  File "parser.pxi", line 1209, in lxml.etree._FeedParser.close (src/lxml/lxml.etree.c:90597)
  File "parsertarget.pxi", line 136, in lxml.etree._TargetParserContext._handleParseResult (src/lxml/lxml.etree.c:99900)
  File "parsertarget.pxi", line 130, in lxml.etree._TargetParserContext._handleParseResult (src/lxml/lxml.etree.c:99807)
  File "lxml.etree.pyx", line 294, in lxml.etree._ExceptionContext._raise_if_stored (src/lxml/lxml.etree.c:9383)
TypeError: function takes exactly 5 arguments (1 given)

----------------------------------------------------------------------
Ran 343 tests in 0.687s

FAILED (errors=1)

ditto py3.3

 * python3_3: running distutils-r1_run_phase python_compile_all
>>> Source compiled.
 * python3_3: running distutils-r1_run_phase python_test

.........
.....
..

what ditch would you like me to dig? mb a py3 version?

dev-lang/python

Installed versions:

3.2.5-r2

the -rx are just a gentoo thingy.

3.3.2-r2

Revision history for this message
IAN DELANEY (johneed) wrote :
Download full text (5.9 KiB)

the 1 error was with lxml-3.2.1. Look what we get with 3.2.4.

.......
======================================================================
ERROR: test_smart_quotes_converted_on_the_way_in (bs4.tests.test_lxml.LXMLTreeBuilderSmokeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/mnt/gen2/TmpDir/portage/dev-python/beautifulsoup-4.3.2/work/beautifulsoup4-4.3.2-python3_3/lib/bs4/testing.py", line 337, in test_smart_quotes_converted_on_the_way_in
    soup = self.soup(quote)
  File "/mnt/gen2/TmpDir/portage/dev-python/beautifulsoup-4.3.2/work/beautifulsoup4-4.3.2-python3_3/lib/bs4/testing.py", line 29, in soup
    return BeautifulSoup(markup, builder=builder, **kwargs)
  File "/mnt/gen2/TmpDir/portage/dev-python/beautifulsoup-4.3.2/work/beautifulsoup4-4.3.2-python3_3/lib/bs4/__init__.py", line 196, in __init__
    self._feed()
  File "/mnt/gen2/TmpDir/portage/dev-python/beautifulsoup-4.3.2/work/beautifulsoup4-4.3.2-python3_3/lib/bs4/__init__.py", line 210, in _feed
    self.builder.feed(self.markup)
  File "/mnt/gen2/TmpDir/portage/dev-python/beautifulsoup-4.3.2/work/beautifulsoup4-4.3.2-python3_3/lib/bs4/builder/_lxml.py", line 226, in feed
    self.parser.close()
  File "parser.pxi", line 1209, in lxml.etree._FeedParser.close (src/lxml/lxml.etree.c:90682)
  File "parsertarget.pxi", line 136, in lxml.etree._TargetParserContext._handleParseResult (src/lxml/lxml.etree.c:99839)
  File "parsertarget.pxi", line 130, in lxml.etree._TargetParserContext._handleParseResult (src/lxml/lxml.etree.c:99746)
  File "lxml.etree.pyx", line 291, in lxml.etree._ExceptionContext._raise_if_stored (src/lxml/lxml.etree.c:9384)
TypeError: function takes exactly 5 arguments (1 given)

======================================================================
ERROR: test_namespaces_are_preserved (bs4.tests.test_lxml.LXMLXMLTreeBuilderSmokeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/mnt/gen2/TmpDir/portage/dev-python/beautifulsoup-4.3.2/work/beautifulsoup4-4.3.2-python3_3/lib/bs4/testing.py", line 529, in test_namespaces_are_preserved
    self.assertEqual("http://example.com/", root['xmlns:a'])
  File "/mnt/gen2/TmpDir/portage/dev-python/beautifulsoup-4.3.2/work/beautifulsoup4-4.3.2-python3_3/lib/bs4/element.py", line 905, in __getitem__
    return self.attrs[key]
KeyError: 'xmlns:a'

======================================================================
FAIL: test_closing_namespaced_tag (bs4.tests.test_lxml.LXMLXMLTreeBuilderSmokeTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/mnt/gen2/TmpDir/portage/dev-python/beautifulsoup-4.3.2/work/beautifulsoup4-4.3.2-python3_3/lib/bs4/testing.py", line 535, in test_closing_namespaced_tag
    self.assertEqual(str(soup.p), markup)
AssertionError: '<p><date>20010504</date></p>' != '<p xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:date>20010504</dc:date></p>' [truncated]...
- <p><date>20010504</date></p>
+ <p xmlns:dc="http://purl.org/dc/elements/1.1/"><dc:date>20010504</dc:date></p>

=================================...

Read more...

Revision history for this message
Stefano Rivera (stefanor) wrote :

Had a dig around

First appeared here in beautifulsoup r301.1.3.

It goes away if I use the LXML in debian/unstable or Ubuntu/trusty, which was cythonned with cython 0.20b1. If I try and built it myself, with cython 0.19.2+git5-g0c6fdf0-1, it crops up again.

Revision history for this message
Leonard Richardson (leonardr) wrote :

Closing this because it really looks like an lxml problem and the last activity here was over a year ago. If you keep having this problem I'd bring it to the attention of the lxml developer.

Changed in beautifulsoup:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.