4519: ImportError: No module named exceptions

kyz
chipx86
chipx86

What version are you running?

ReviewBoard 2.5.8

What's the URL of the page containing the problem?

/reviews/

What steps will reproduce the problem?

  1. Load main review requests list on ReviewBoard 2.5.8

What is the expected output? What do you see instead?

Expected: page. Result: 500 internal server error

What operating system are you using? What browser?

RHEL 6, Python 2.6.6

pytz module version 2010h (I used easy_install --upgrade ReviewBoard to go from ReviewBoard 2.5.7 to 2.5.8, and the ReviewBoard dependencies are such that easy_install didn't see a need to upgrade pytz from this version)

Please provide any additional information below.

Part of the the traceback from wsgi log:

ERROR:root:Unable to load webapi resource review_request: No module named exceptions
Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/Djblets-0.9.5-py2.6.egg/djblets/webapi/resources/registry.py", line 65, in getattr
{}, {}, [instance_name])
File "/usr/lib/python2.6/site-packages/ReviewBoard-2.5.8-py2.6.egg/reviewboard/webapi/resources/review_request.py", line 22, in <module>
from pytz.exceptions import AmbiguousTimeError
ImportError: No module named exceptions

Looking at the code, it's because in pytz version 2010h has AmbiguousTimeError class defined in pytz.tzinfo, not pytz.exceptions

This diff fixes the problem:

--- /usr/lib/python2.6/site-packages/ReviewBoard-2.5.8-py2.6.egg/reviewboard/webapi/resources/review_request.py.orig 2017-02-10 14:27:23.143549455 +0000
+++ /usr/lib/python2.6/site-packages/ReviewBoard-2.5.8-py2.6.egg/reviewboard/webapi/resources/review_request.py 2017-02-10 14:27:53.475549455 +0000
@@ -19,7 +19,7 @@
INVALID_FORM_DATA,
NOT_LOGGED_IN,
PERMISSION_DENIED)
-from pytz.exceptions import AmbiguousTimeError
+from pytz.tzinfo import AmbiguousTimeError

from reviewboard.admin.server import build_server_url
from reviewboard.diffviewer.errors import (DiffTooBigError,

chipx86
#1 chipx86

Fix pending review at https://reviews.reviewboard.org/r/8751/

  • -New
    +Incomplete
  • +Release-2.5.x
  • +Component:Deployment
  • +chipx86