Pickle Problem

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Wed Mar 4 02:40:21 CET 2009

En Tue, 03 Mar 2009 23:11:30 -0200, Fab86 <fabien.hall at gmail.com> escribió:

> On Mar 4, 12:00 am, MRAB <goo... at mrabarnett.plus.com> wrote:
>> Fab86 wrote:
>> > On Mar 3, 8:59 pm, "Gabriel Genellina" <gagsl-... at yahoo.com.ar> wrote:

>> >> How to "spell" exactly the exception name should appear in the  
>> >> documentation; might be yahoo.SearchError, or  
>> yahoo.search.SearchError, or  
>> >> yahoo.errors.SearchError, or similar.
>> > I have been trying except SearchError: however I get the error:
>> > Traceback (most recent call last):
>> >   File "C:\Downloads\MoS\yws-2.12\Python\pYsearch-3.1\timeDelay.py",
>> > line 19, in <module>
>> >     except SearchError:
>> > NameError: name 'SearchError' is not defined
>> > I have searched all documents for terms along the lines of searcherror
>> > but am finding nothing..
>> It's defined in the module you imported to get the search functionality.
> I imported:
> from yahoo.search.web import WebSearch
> However there is nothing re SearchError in that doc or in the .py.
> I can only find a reference to SearchError in the __init__ file as a
> class called SearchError

The __init__.py indicates a package  
You didn't tell the package name (the name of the directory containing  
__init__.py) so this is somewhat generic. If the package name is foo, use:
 from foo import SearchError
If foo is a subpackage under bar, use:
 from bar.foo import SearchError

It *might* be:
 from yahoo.search.web import WebSearch
or perhaps:
 from yahoo.search import WebSearch

You can enter those lines in the interactive interpreter to discover the  
right form. (This really ought to have been documented)

Gabriel Genellina

More information about the Python-list mailing list