[mod_python] strange import behaviour out of the blue

Kevin J. Smith hockeysk8 at gmail.com
Thu Oct 27 02:27:59 EDT 2005


I have been running an app under mod_python for quite some time. In one bit
of the code I do an import of mx.DateTime like so:

from mx.DateTime import *

and I later make a call to the function localtime(). I did a restart on the
server a week or so ago and now I am getting an exception being thrown
saying that localtime doesn't exist! I have tried importing differently,
directly, calling it directly like mx.DateTime.localtime() but all are
unsuccessful. I have logged a call to mx.DateTime.__path__ with the
following result:

2005-10-27 02:04:14,347 Domain -1208703296 DEBUG here is the datetime path:

It looks like it is getting the right module, but logging a call to dir(
mx.DateTime) yields this:

2005-10-27 02:04:14,347 Domain -1208703296 DEBUG here is datetime funcs:
['DateTime', '__builtins__', '__doc__', '__file__', '__name__'
, '__path__', 'mxDateTime']

Where did all the stuff go?!?

If I go on the command line and do the same I get the same path but the
following for the dir():

['ARPA', 'Age', 'April', 'August', 'Date', 'DateFrom', ... AND MANY, MANY
OTHERS ... 'localtime', 'mktime', 'mxDateTime', 'mxDateTimeAPI', 'now', ...
etc. etc. ]

Why is mod_python all of a sudden failing to import the module correctly? I
am really, really stumped because I have been using this app for close to
two years and have never ran into this problem.

I would be greatful for any insight that anyone can provide as to what is
going on!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20051026/75736def/attachment.html

More information about the Mod_python mailing list