Hello Cedric,

the reason for the problem is, that bacula running the python interpreter in its own address space, can't access dynamically linked modules (*.so - they can be found in python's "lib-dynload" - directory).
My workaround is to have a seperate python-script running which imports e.g. the said time module and does all the functionality I need from there.
This script does an output on the shell (simple "print xyz").
Inside the DirStartUp.py then I call the above script and read it's output in a variable.
I do this with:

     sout = commands.getoutput("./bacula_label.py")
     mylabel = sout

(Don't forget to import the commands module - it should work)
I've also tried to read the output with:

os.popen2("./bacula_label.py")[1].read()

or:

popen.popen2("./bacula_label.py")[1].read()

but this always brings an AttributeError with it.
In my case, it didn't break my desired functionality but wasn't nice to look at either.

A word on my python implementation:
It's rpms for python 2.3.4 and python-devel of the same version.
I run it on SuSE Linux 9.2

Hope that helps a bit!

Best Regards,

i. A. Christoff Buch

=====================================
[EMAIL PROTECTED]
OneVision Software AG
Dr.-Leo-Ritter-Str. 9
93049 Regensburg



Cedric Tefft <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]

17.05.2006 10:52

To
Christoff Buch <[EMAIL PROTECTED]>
cc
bacula-users@lists.sourceforge.net
Subject
Re: [Bacula-users] Fw: Problem with Python-Script "DirStartUp.py": Can't import "time"-module: Bacula disables python interpreter.





Christoff Buch wrote:

>
> Dear users,
>
> as the subject says, bacula disables the python interpreter if I try
> to import the time - module (which I need).
> Has anyone any idea or experience with this?
>
> Thanks a lot!

I can confirm the problem -- unfortunately no clue on the solution.

- Cedric



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Reply via email to