November 22nd, 2003, 01:23 PM
Class not loading properly in CGI
I've got a very, very odd problem here which I can't seem to solve. I'm creating a class instance in a CGI script, but that instance isn't inheriting all of the methods associated with that file. Confused? Here's what I mean:
the commands to check:
mydb = db.mySQL()
done in a python shell on my machine:
"['__doc__', '__init__', '__module__', 'connectTime', 'cursor', 'delete', 'fetchRow', 'fetchRows', 'info', 'insert', 'mysql', 'update']"
in the cgi script online:
['connectTime', 'cursor', 'mysql']
What on earth is going on?
November 22nd, 2003, 05:30 PM
Hey telex, its a nice idea thats for sure! I gave it a try earlier but i couldnt get it to connect?
Anyway this is pretty wierd.. i guess.. are both your computer and the server running the same version of Python on the same OS etc? Oh, is it just this class of does this happen with classes from other modules?
November 22nd, 2003, 06:08 PM
Ah, well the Python installation on the web server is 1.5.2, whilst I'm using 2.2.3... could this be it? Is there anything that the 2.x series changed in this regard?
That page shows useful info relating to this problem.
November 22nd, 2003, 06:27 PM
Could well be , an increadable amount has changed since Python 1.5 although i wasn't Pythoning bach then . I first came across Python a month of two before Python 2 was released..
So obviously my best sugestion would be UPDATE YOUR PYTHON VERSION - i'd give you a long list of reasons to do this but i'm sure you already have plenty of reasons - and see if that fixes the bug.
November 22nd, 2003, 07:29 PM
Yers, well I can bug my web host to do it, but it'd be good to isolate the problem anyway, in case they don't and so the code is backwards compatable. If anyone knows what they might have done to the class system to cause this problem, I'd appreciate help!