Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Users
external method
 

Index | Next | Previous | View Flat


garry at schoolteachers

Jun 15, 2009, 1:40 PM


Views: 1050
Permalink
external method

I have the following external method to back up a postgres database,
using the following software versions.
Zope Version

(Zope 2.9.0, python 2.4.2, win32)
Python Version

2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)]
System Platform

win32

Zope is running as user scholarpack who is an administrator on win
server 2008.
/
import subprocess

def backup():
try:
p=subprocess.Popen("c:/scholarpack/postgres/bin/pg_dump
scholarpack",shell=True,stdout=subprocess.PIPE)
data=p.communicate()[0]

f=open('c:/scholarpack/ancillary/scholarpack.sql','w')
w=f.write(data)
f.close()
except OSError:
print "There was a problem opening the file for writing"


/When I run this through Zope I get an empty file. There are no errors
reported. However, if I use the same python that is running zope in an
interactive shell and run these commands then it works as expected.
Can anyone spot what I am obviously missing?
Regards
Garry
_______________________________________________
Zope maillist - Zope[at]zope.org
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Subject User Time
external method garry at schoolteachers Jun 15, 2009, 1:40 PM
    Re: external method yourpadre at gmail Jun 15, 2009, 6:19 PM
    Re: external method chris at simplistix Jun 16, 2009, 2:09 AM
        Re: external method garry at schoolteachers Jun 16, 2009, 2:17 AM
            Re: external method chris at simplistix Jun 16, 2009, 2:33 AM
                Re: external method garry at schoolteachers Jun 16, 2009, 2:41 AM
                    Re: external method garry at schoolteachers Jun 16, 2009, 3:39 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.