TypeError if given None as a text to index

Bug #598776 reported by Christophe Combelles
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zope.index
Fix Released
Undecided
Tres Seaver
zope.index (Ubuntu)
Fix Released
Undecided
Gediminas Paulauskas

Bug Description

using repoze.catalog, a text attribute ends up being None, and I get an error while indexing:

Exception happened during processing of request from ('127.0.0.1', 48338)
Traceback (most recent call last):
  File "/home/ccomb/buildout-eggs/Paste-1.7.4-py2.6.egg/paste/httpserver.py", line 1068, in process_request_in_thread
    self.finish_request(request, client_address)
  File "/usr/lib/python2.6/SocketServer.py", line 320, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.6/SocketServer.py", line 615, in __init__
    self.handle()
  File "/home/ccomb/buildout-eggs/Paste-1.7.4-py2.6.egg/paste/httpserver.py", line 442, in handle
    BaseHTTPRequestHandler.handle(self)
  File "/usr/lib/python2.6/BaseHTTPServer.py", line 329, in handle
    self.handle_one_request()
  File "/home/ccomb/buildout-eggs/Paste-1.7.4-py2.6.egg/paste/httpserver.py", line 437, in handle_one_request
    self.wsgi_execute()
  File "/home/ccomb/buildout-eggs/Paste-1.7.4-py2.6.egg/paste/httpserver.py", line 287, in wsgi_execute
    self.wsgi_start_response)
  File "/home/ccomb/buildout-eggs/repoze.browserid-0.3-py2.6.egg/repoze/browserid/middleware.py", line 127, in __call__
    return self.app(environ, start_response)
  File "/home/ccomb/buildout-eggs/Beaker-1.5.4-py2.6.egg/beaker/middleware.py", line 152, in __call__
    return self.wrap_app(environ, session_start_response)
  File "/home/ccomb/buildout-eggs/repoze.zodbconn-0.10-py2.6.egg/repoze/zodbconn/middleware.py", line 15, in __call__
    result = self.application(environ, start_response)
  File "/home/ccomb/buildout-eggs/repoze.tm-1.0a5-py2.6.egg/repoze/tm/__init__.py", line 23, in __call__
    result = self.application(environ, save_status_and_headers)
  File "/home/ccomb/buildout-eggs/repoze.bfg-1.2.1-py2.6.egg/repoze/bfg/router.py", line 130, in __call__
    response = view_callable(context, request)
  File "/home/ccomb/buildout-eggs/repoze.bfg-1.2.1-py2.6.egg/repoze/bfg/configuration.py", line 1753, in _secured_view
    return view(context, request)
  File "/home/ccomb/buildout-eggs/repoze.bfg-1.2.1-py2.6.egg/repoze/bfg/configuration.py", line 1704, in _rendered_view
    response = view(context, request)
  File "/home/dadafkas/projets/virtualcareteam/vctdemo/views/patient_item.py", line 62, in add
    return HTTPFound(location=model_url(pitem, request))
  File "/home/ccomb/buildout-eggs/repoze.catalog-0.7.2-py2.6.egg/repoze/catalog/catalog.py", line 31, in index_doc
    index.index_doc(docid, obj)
  File "/home/ccomb/buildout-eggs/repoze.catalog-0.7.2-py2.6.egg/repoze/catalog/indexes/common.py", line 33, in index_doc
    return super(CatalogIndex, self).index_doc(docid, value)
  File "/home/ccomb/buildout-eggs/zope.index-3.6.0-py2.6-linux-x86_64.egg/zope/index/text/textindex.py", line 50, in index_doc
    self.index.index_doc(docid, text)
  File "/home/ccomb/buildout-eggs/zope.index-3.6.0-py2.6-linux-x86_64.egg/zope/index/text/okapiindex.py", line 228, in index_doc
    count = BaseIndex.index_doc(self, docid, text)
  File "/home/ccomb/buildout-eggs/zope.index-3.6.0-py2.6-linux-x86_64.egg/zope/index/text/baseindex.py", line 97, in index_doc
    wids = self._lexicon.sourceToWordIds(text)
  File "/home/ccomb/buildout-eggs/zope.index-3.6.0-py2.6-linux-x86_64.egg/zope/index/text/lexicon.py", line 66, in sourceToWordIds
    last = element.process(last)
  File "/home/ccomb/buildout-eggs/zope.index-3.6.0-py2.6-linux-x86_64.egg/zope/index/text/lexicon.py", line 175, in process
    for s in lst:
TypeError: 'NoneType' object is not iterable

Indexing None shouldn't be a problem, and should be equivalent to the empty string.

Revision history for this message
Leo Arias (elopio) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. This bug did not have a package associated with it, which is important for ensuring that it gets looked at by the proper developers. You can learn more about finding the right package at https://wiki.ubuntu.com/Bugs/FindRightPackage. I have classified this bug as a bug in python-zope.index.

When reporting bugs in the future please use apport, either via the appropriate application's "Help -> Report a Problem" menu or using 'ubuntu-bug' and the name of the package affected. You can learn more about this functionality at https://wiki.ubuntu.com/ReportingBugs.

affects: ubuntu → zope.index (Ubuntu)
Revision history for this message
Leo Arias (elopio) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please execute the following command, as it will automatically gather debugging information, in a terminal:

apport-collect 598776

This will help us to find and resolve the problem. Bear in mind that you may need to install the python-launchpadlib package from the universe repository. Additionally, when prompted to give apport-collect permissions for Launchpad you will need to give it at least the ability to "Change Non-Private" data as it will be adding information to your bug report. Thanks in advance!

When reporting bugs in the future please use apport, either via the appropriate application's "Help -> Report a Problem" menu or using 'ubuntu-bug' and the name of the package affected. You can learn more about this functionality at https://wiki.ubuntu.com/ReportingBugs.

Changed in zope.index (Ubuntu):
status: New → Incomplete
Tres Seaver (tseaver)
Changed in zope.index:
assignee: nobody → Tres Seaver (tseaver)
status: New → In Progress
Tres Seaver (tseaver)
Changed in zope.index:
status: In Progress → Fix Committed
Revision history for this message
Tres Seaver (tseaver) wrote :
Changed in zope.index:
status: Fix Committed → Fix Released
Leo Arias (elopio)
Changed in zope.index (Ubuntu):
status: Incomplete → Confirmed
Changed in zope.index (Ubuntu):
assignee: nobody → Gediminas Paulauskas (menesis)
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package zope.index - 3.6.1-0ubuntu1

---------------
zope.index (3.6.1-0ubuntu1) maverick; urgency=low

  * New upstream release.
    - Avoid raising an exception when indexing None (LP: #598776)
  * Convert to debhelper 7 and the pydeb dh7 extension.
  * ZopePublicLicense.txt: remove, tarball now contains a license.
 -- Gediminas Paulauskas <email address hidden> Thu, 26 Aug 2010 00:42:29 +0300

Changed in zope.index (Ubuntu):
status: Fix Committed → Fix Released
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.