Issue 2550675
Created on 2010-10-21 15:06 by bnordgren, last changed 2010-10-21 19:21 by schlatterbeck.
msg4170 |
Author: [hidden] (bnordgren) |
Date: 2010-10-21 15:06 |
|
In any tracker, create lib directory and file "quirky.py" containing text:
class Test:
pass
then add "import quirky" as the first line of schema.py
roundup-admin should behave as normal, the mail gateway should behave as
normal, but the web interface now throws an error on every access.
|
msg4171 |
Author: [hidden] (ber) |
Date: 2010-10-21 15:24 |
|
Which error message?
|
msg4172 |
Author: [hidden] (bnordgren) |
Date: 2010-10-21 15:29 |
|
Cut and paste from the traceback in the web page:
ImportError: No module named quirky
A problem occurred while running a Python script. Here is the sequence
of function calls leading up to the error, with the most recent
(innermost) call first. The exception attributes are:
/mnt/infomaster/roundupdev/schema.py in ()
2 import time, random
3 from roundup import hyperdb
4 from email.Utils import formataddr
5 from roundup.i18n import _
6 from roundup.mailer import Mailer, MessageSendError, encode_quopri, \
/usr/lib/python2.6/site-packages/roundup/instance.py in
open(self=<roundup.instance.Tracker instance>, name='admin')
116 if self.optimize:
117 # execute preloaded schema object
118 exec(self.schema, vars)
self = <roundup.instance.Tracker instance>, global schema =
undefined, vars = {'Boolean': <class 'roundup.hyperdb.Boolean'>,
'Class': <class roundup.backends.back_mysql.Class>, 'Date': <class
'roundup.hyperdb.Date'>, 'FileClass': <class
roundup.backends.back_mysql.FileClass>, 'Interval': <class
'roundup.hyperdb.Interval'>, 'IssueClass': <class
roundup.backends.back_mysql.IssueClass>, 'Link': <class
'roundup.hyperdb.Link'>, 'Multilink': <class
'roundup.hyperdb.Multilink'>, 'Number': <class
'roundup.hyperdb.Number'>, 'Password': <class
'roundup.hyperdb.Password'>, ...}
119 if callable (self.schema_hook):
120 self.schema_hook(**vars)
|
msg4173 |
Author: [hidden] (bnordgren) |
Date: 2010-10-21 15:31 |
|
Note that the above error actually blots out line 1 of schema.py, which
is "import quirky". This may imply that the web traceback needs a little
work too.
|
msg4174 |
Author: [hidden] (bnordgren) |
Date: 2010-10-21 15:40 |
|
Potential workaround follows, but the real fix will be to make the
availability of code in the lib directory consistent.
Put this at the top of a schema.py which depends on code in the lib
directory:
import os.path
import sys
libdir = os.path.join(db.config.TRACKER_HOME, 'lib')
if libdir not in sys.path :
sys.path.insert(0,libdir)
import quirky
|
msg4175 |
Author: [hidden] (schlatterbeck) |
Date: 2010-10-21 19:21 |
|
Fixed in r4554, thanks for reporting!
looks like I was using your workaround for years :-)
|
|
Date |
User |
Action |
Args |
2010-10-21 19:21:13 | schlatterbeck | set | status: new -> closed resolution: fixed messages:
+ msg4175 nosy:
+ schlatterbeck |
2010-10-21 15:40:54 | bnordgren | set | messages:
+ msg4174 |
2010-10-21 15:31:38 | bnordgren | set | messages:
+ msg4173 |
2010-10-21 15:29:40 | bnordgren | set | messages:
+ msg4172 |
2010-10-21 15:24:00 | ber | set | nosy:
+ ber messages:
+ msg4171 |
2010-10-21 15:06:44 | bnordgren | create | |
|