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

  • SEARCH
  • Home
  • 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 8144111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:17:01+00:00 2026-06-06T13:17:01+00:00

I’m trying to run Selenium tests for a Django app on production server. I

  • 0

I’m trying to run Selenium tests for a Django app on production server.

I am getting a syntax error on the finally: clause.

I don’t see where the error is and all the tests ran fine in development.

Here is the code:

 def activate_revision(self, user, revision):  
    self.title = revision.title  
    self.tagnames = revision.tagnames  

    self.body = self.rendered(revision.body)  

    self.active_revision = revision  

    # Try getting the previous revision  
    try:  
        prev_revision = NodeRevision.objects.get(node=self, revision=revision.revision-1)  

        update_activity = True  

        # Do not update the activity if only the tags are changed  
        if prev_revision.title == revision.title and prev_revision.body == revision.body \  
        and prev_revision.tagnames != revision.tagnames and not settings.UPDATE_LATEST_ACTIVITY_ON_TAG_EDIT:  
            update_activity = False  
    except NodeRevision.DoesNotExist:  
        update_activity = True  
    finally:  
        if update_activity:  
            self.update_last_activity(user)  
    self.save()  

Here is the traceback:

$ python manage.py test forum  
Traceback (most recent call last):  
  File "/usr/lib/python2.4/logging/__init__.py", line 731, in emit  
    msg = self.format(record)  
  File "/usr/lib/python2.4/logging/__init__.py", line 617, in format  
    return fmt.format(record)  
  File "/usr/lib/python2.4/logging/__init__.py", line 408, in format  
    s = self._fmt % record.__dict__  
KeyError: 'funcName'  
/home/spirituality/lib/python2.7/Django-1.3.1-py2.7.egg/django/db/models/fields/subclassing.py:80: DeprecationWarning: A Field class whose get_db_prep_lookup method hasn't been updated to take `connection` and `prepared` arguments.  
  new_class = super(SubfieldBase, cls).__new__(cls, name, bases, attrs)  
/home/spirituality/lib/python2.7/Django-1.3.1-py2.7.egg/django/db/models/fields/subclassing.py:80: DeprecationWarning: A Field class whose get_db_prep_value method hasn't been updated to take `connection` and `prepared` arguments.  
  new_class = super(SubfieldBase, cls).__new__(cls, name, bases, attrs)  
Traceback (most recent call last):  
  File "manage.py", line 13, in ?  
    execute_manager(settings)  
  File "/home/spirituality/lib/python2.7/Django-1.3.1-py2.7.egg/django/core/management/__init__.py", line 438, in execute_manager  
    utility.execute()  
  File "/home/spirituality/lib/python2.7/Django-1.3.1-py2.7.egg/django/core/management/__init__.py", line 379, in execute  
    self.fetch_command(subcommand).run_from_argv(self.argv)  
  File "/home/spirituality/lib/python2.7/Django-1.3.1-py2.7.egg/django/core/management/base.py", line 191, in run_from_argv  
    self.execute(*args, **options.__dict__)  
  File "/home/spirituality/lib/python2.7/Django-1.3.1-py2.7.egg/django/core/management/base.py", line 220, in execute  
    output = self.handle(*args, **options)  
  File "/home/spirituality/lib/python2.7/South-0.7.3-py2.7.egg/south/management/commands/test.py", line 8, in handle  
    super(Command, self).handle(*args, **kwargs)  
  File "/home/spirituality/lib/python2.7/Django-1.3.1-py2.7.egg/django/core/management/commands/test.py", line 37, in handle  
    failures = test_runner.run_tests(test_labels)  
  File "/home/spirituality/lib/python2.7/Django-1.3.1-py2.7.egg/django/test/simple.py", line 358, in run_tests  
    suite = self.build_suite(test_labels, extra_tests)  
  File "/home/spirituality/lib/python2.7/Django-1.3.1-py2.7.egg/django/test/simple.py", line 247, in build_suite  
    app = get_app(label)  
  File "/home/spirituality/lib/python2.7/Django-1.3.1-py2.7.egg/django/db/models/loading.py", line 129, in get_app  
    self._populate()  
  File "/home/spirituality/lib/python2.7/Django-1.3.1-py2.7.egg/django/db/models/loading.py", line 61, in _populate  
    self.load_app(app_name, True)  
  File "/home/spirituality/lib/python2.7/Django-1.3.1-py2.7.egg/django/db/models/loading.py", line 78, in load_app  
    models = import_module('.models', app_name)  
  File "/home/spirituality/lib/python2.7/Django-1.3.1-py2.7.egg/django/utils/importlib.py", line 35, in import_module  
    __import__(name)  
  File "/home/spirituality/webapps/spirituality/spirit_app/forum/models/__init__.py", line 2, in ?  
    from question import Question ,QuestionRevision, QuestionSubscription  
  File "/home/spirituality/webapps/spirituality/spirit_app/forum/models/question.py", line 1, in ?  
    from base import *  
  File "/home/spirituality/webapps/spirituality/spirit_app/forum/models/base.py", line 349, in ?  
    from node import Node, NodeRevision, NodeManager  
  File "/home/spirituality/webapps/spirituality/spirit_app/forum/models/node.py", line 383  
    finally:  
          ^  
SyntaxError: invalid syntax  
  • 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-06T13:17:03+00:00Added an answer on June 6, 2026 at 1:17 pm

    First part of the traceback suggests that it’s Python 2.4 on production. As per my comment above, the problem is that try..except..finally is only for Python 2.5 and newer. Upgrade production or rewrite the code to nest try..except inside an outer try..finally.

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

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka

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.