Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9237973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:39:08+00:00 2026-06-18T07:39:08+00:00

Python 2.7.3 I got the following error when I ran SillyWalk.getGroups(user_id = user) for

  • 0

Python 2.7.3

I got the following error when I ran SillyWalk.getGroups(user_id = user) for a user who, like the parrot, is no more.

Traceback (most recent call last):
    File "C:\Python\API\getgroups.py", line 32, in <module>
        Grp = SillyWalk.getGroups(user_id = user)
    File "c:\python27\lib\site-packages\SillyWalkapi-1.4.2-py2.7.egg\SillyWalkapi\__init__.py", line 349, in handler
        parse_format=args['format'], **args)
    File "c:\python27\lib\site-packages\SillyWalkapi-1.4.2-py2.7.egg\SillyWalkapi\__init__.py", line 435, in __wrap_in_parser
        return parser(self, data)
    File "c:\python27\lib\site-packages\SillyWalkapi-1.4.2-py2.7.egg\SillyWalkapi\__init__.py", line 278, in parse_etree
        raise SillyWalkError(u'Error: %(code)s: %(msg)s' % err.attrib)
SillyWalkError: Error: 1: User not found

I tried to fix the problem by putting a try ... except statement in:

try:
    Grp = SillyWalk.getGroups(user_id = user)
    g = 0
    for group in Grp.find('groups').findall('group'):
        g += 1
        u_ID  = user
        g_ID  = group.get('_ID')
        gName  = "" # group.get('name')
        HasParrot    = group.get('HasParrot')
        Priv   = group.get('Priv')
        Mbr    = group.get('members')
        threads = group.get('threads')

        tup = '{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\n'.format(u_ID, g_ID, gName.encode('utf-8'), HasParrot, Priv, Mbr, threads)
        OutFile.write(tup.encode('utf-8'))
except SillyWalkError:
    tup = '{0}\tNo Records Found\n'.format(u_ID)
    OutFile.write(tup.encode('utf-8'))

but it gave me an undefined error:

Traceback (most recent call last):
    File "C:\Python\API\getgroups.py", line 47, in <module>
        except SillyWalkError:
NameError: name 'SillyWalkError' is not defined
>>> 

This is my first attempt to write an exception class, so could someone please show me how to do it? The SillyWalk.getGroups has a dozen or so different error numbers, for various error reasons. Do I need a case for each one?

I’ll be forever in your debt! (You’ll never collect anything from me, but I’ll still owe it to you!)

BTW: while rooting about in the guts of my script, could someone show me how to fix my gName problem, so I don’t need to null it out? It keeps giving me:

Traceback (most recent call last):
    File "C:\Python\API\getgroups.py", line 44, in <module>
        OutFile.write(tup.encode('utf-8'))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 54: ordinal not in range(128)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T07:39:09+00:00Added an answer on June 18, 2026 at 7:39 am

    NameError: name 'SillyWalkError' is not defined just indicates that the name SillyWalkError is not defined. It’s nothing specific to exception handling or writing an exception class.

    It looks like you just haven’t imported the name SillyWalkError into the module that’s trying to catch the exception; the error you were getting without the except indicates that the exception class itself is working fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to install mysql-python. Got following error. Got mysql and pythond already installed. Any
I just got the following type error while executing my Python script: File /Library/Python/2.7/site-packages/Flask-0.9-py2.7.egg/flask/app.py,
While trying to use Python's exec statement, I got the following error: TypeError: exec:
Using pyblog.py , I got the following error, which I then tried to more
Recently I've spotted a very disturbing issue. I've got the following python code: for
I got the following error when compiling sip with --arch x86_64 option. prosseek:siplib smcho$
I got the following error when calling the url in Django. It's working before,
I got the following syntax error at the following line when I run my
Following this tutorial I got the following error where y = 1; I'm using
I pulled the latest code using git today and I got the following error:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.