Re: subprocess command fails

2015-02-21 Thread Larry Hudson
On 02/20/2015 08:47 PM, Brad s wrote: [...] print("command = %r" % (cmdargv,)) sfmove = subprocess.call(cmdargv) also, is the % to Python what precision is to C++? No. It is like the % in C's printf(). -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: subprocess command fails

2015-02-20 Thread Cameron Simpson
On 20Feb2015 21:14, Brad s wrote: Time adjustment error: # python3.4 timefix.py 2015022105 2015-02-21 05:00:00 Traceback (most recent call last): File "timefix.py", line 15, in ndate = datetime.datetime.strptime(timeadd, '%Y%m%d%H') TypeError: must be str, not datetime.datetime # cat ti

Re: subprocess command fails

2015-02-20 Thread Brad s
fixed with now = datetime.datetime.now() later = now + datetime.timedelta(days=2*365) striplater = later.strftime('%Y%m%d%H') # python3.4 makekeys.py Enter the domain to configure keys for? test1234.com Generating key pair..

Re: subprocess command fails

2015-02-20 Thread Brad s
Time adjustment error: # python3.4 timefix.py 2015022105 2015-02-21 05:00:00 Traceback (most recent call last): File "timefix.py", line 15, in ndate = datetime.datetime.strptime(timeadd, '%Y%m%d%H') TypeError: must be str, not datetime.datetime # cat timefix.py #!/usr/bin/python3.4 impor

Re: subprocess command fails

2015-02-20 Thread Brad s
Yes, the program deletes the same files it produces. It looks to see if old stuff is there and if it exist, it deletes the files and creates and entirely new DNS zone with keys and then it is supposed to sign it. The last step is where it is still failing but your code helped me to figure out wh

Re: subprocess command fails

2015-02-20 Thread Cameron Simpson
On 20Feb2015 15:30, Brad s wrote: I am trying to execute a subprocess, something done in my script a couple of times. But on the last one, it outputs an error I cannot find the solution to. The exact same command using the same files produced at the command line works just fine. Hi Brad,

subprocess command fails

2015-02-20 Thread Brad s
# cat makekeys.py #!/usr/bin/python3.4 import subprocess import sys import string import os.path import datetime import shlex from time import gmtime, strftime from subprocess import Popen, PIPE, STDOUT pretime = strftime("%Y%m%d%H", gmtime()) time = datetime.datetime.strptime(pretime,'%Y%m%d%H')