google-code-export / feedparser

Automatically exported from code.google.com/p/feedparser
Other
1 stars 0 forks source link

Test script feedparsertest.py gives errors: Broken Pipe, UndeclaredNamespace #414

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Having feedparser-5.1.3, going into feedparser/ directory and running 
feedparsertest.py gives this output (many dots removed so it is not so long 
here):

feedparser$ python feedparsertest.py 
..........ENo such file or 
directory.......................................................................
................................................................................
................................................................................
......................................................................----------
------------------------------
Exception happened during processing of request from ('127.0.0.1', 38260)
Traceback (most recent call last):
  File "/usr/lib64/python2.7/SocketServer.py", line 295, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib64/python2.7/SocketServer.py", line 321, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib64/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib64/python2.7/SocketServer.py", line 651, in __init__
    self.finish()
  File "/usr/lib64/python2.7/SocketServer.py", line 710, in finish
    self.wfile.close()
  File "/usr/lib64/python2.7/socket.py", line 279, in close
    self.flush()
  File "/usr/lib64/python2.7/socket.py", line 303, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
----------------------------------------
...................................
======================================================================
ERROR: test_002067 (__main__.TestCase)
./tests/illformed/undeclared_namespace.xml: undeclared namespace
----------------------------------------------------------------------
Traceback (most recent call last):
  File "feedparsertest.py", line 752, in <lambda>
    self.failUnlessEval(xmlfile, evalString)
  File "feedparsertest.py", line 162, in failUnlessEval
    env = feedparser.parse(xmlfile)
  File "/home/jkoncick/fedora/python-feedparser/feedparser-5.1.3/feedparser/feedparser.py", line 4001, in parse
    saxparser.parse(source)
  File "/usr/lib64/python2.7/site-packages/drv_libxml2.py", line 208, in parse
    eltName,eltQName,attributesNSImpl)
  File "/home/jkoncick/fedora/python-feedparser/feedparser-5.1.3/feedparser/feedparser.py", line 1801, in startElementNS
    raise UndeclaredNamespace, "'%s' is not associated with a namespace" % givenprefix
UndeclaredNamespace: 'itunes' is not associated with a namespace

----------------------------------------------------------------------
Ran 4254 tests in 9.753s

FAILED (errors=1)

I figured out that the one failing test is the test using 
"tests/illformed/undeclared_namespace.xml" file. I personally think it is a bug 
of the testing script itself, which does not handle the UndeclaredNamespace 
exception and gives this error, although raising this exception should be 
intended behavior. The exception is raised in feedparse.py on line 1801 and is 
not handled anywhere in this file. So I think this test does not fail, it is 
just not properly handled in the test script. I suppressed this error by 
skipping this test (putting some always-false condition into 
undeclared_namespace.xml in section SkipUnless), but it is not clear solution.

I could not figure out the cause of the "No such file or directory" message and 
the Broken Pipe problem.

Could you please look into this and fix the tests? I really need the tests to 
be working properly, without any error.

I am using Fedora 19 (3.10.4-300.fc19.x86_64) and Python 2.7.5

Original issue reported on code.google.com by j.koncic...@gmail.com on 30 Sep 2013 at 4:37

GoogleCodeExporter commented 9 years ago
Thanks for reporting this!

Original comment by kurtmckee on 10 Jul 2014 at 5:10