subprocess.check_call() fails ... but only on my production machine

Discussion in 'Python' started by Chris Curvey, Oct 12, 2010.

  1. Chris Curvey

    Chris Curvey Guest

    I've got a python program running on windows that executes a command-
    line script. The command being executed is:

    >>> print cmd

    "C:\Program Files\ImageMagick-6.6.1-Q16\convert.exe" -density 72x72 "c:
    \temp\choicepoint 2010-01 Stmt_p1.pdf" -quiet -region (612.0x70.0+0+0 -
    blur 0x3) -region (612.0x709.0+0+83.0 -blur 0x3) "\\fs4\w
    \13\132651\BILLING_PROOFS\132651_choicepoint 2010-01 Stmt_p1_r1.pdf"

    >>> subprocess.check_call(cmd, shell=True)


    if I run the command thru python subprocess.check_call() on my
    Windows 7 (development) machine, it works fine.
    if I run the command in a command in a command window on my windows
    2007 server (production) machine, it works fine.
    if I run the command thru python subprocess.check_call() on my
    Windows 2007 server (production) machine, it fails.

    I'm running both the Python script and the command window as the same
    user. Can anyone give me a hint as to what might be happening...or a
    way to get more information about what the error is? (All I get is
    "Command returned non-zero exit status 1")
    Chris Curvey, Oct 12, 2010
    #1
    1. Advertising

  2. Chris Curvey

    Chris Curvey Guest

    just a note that the "Windows 2007 Server" is actually a "Windows 2008
    Server" (despite the fact that Control Panel->System tells me it's
    2007...but that's a different discussion)
    Chris Curvey, Oct 12, 2010
    #2
    1. Advertising

  3. Chris Curvey

    Tim Golden Guest

    Re: subprocess.check_call() fails ... but only on my productionmachine

    On 12/10/2010 14:31, Chris Curvey wrote:
    > I've got a python program running on windows that executes a command-
    > line script. The command being executed is:
    >
    >>>> print cmd

    > "C:\Program Files\ImageMagick-6.6.1-Q16\convert.exe" -density 72x72 "c:
    > \temp\choicepoint 2010-01 Stmt_p1.pdf" -quiet -region (612.0x70.0+0+0 -
    > blur 0x3) -region (612.0x709.0+0+83.0 -blur 0x3) "\\fs4\w
    > \13\132651\BILLING_PROOFS\132651_choicepoint 2010-01 Stmt_p1_r1.pdf"
    >
    >>>> subprocess.check_call(cmd, shell=True)

    >
    > if I run the command thru python subprocess.check_call() on my
    > Windows 7 (development) machine, it works fine.
    > if I run the command in a command in a command window on my windows
    > 2007 server (production) machine, it works fine.
    > if I run the command thru python subprocess.check_call() on my
    > Windows 2007 server (production) machine, it fails.
    >
    > I'm running both the Python script and the command window as the same
    > user. Can anyone give me a hint as to what might be happening...or a
    > way to get more information about what the error is? (All I get is
    > "Command returned non-zero exit status 1")


    The subprocess code has changed quite a bit between
    versions. Can you confirm which version of Python you're
    using?

    FWIW, subprocess.check_call is a lightweight wrapper around subprocess.call
    so running the same code as subprocess.call should give you more
    information.

    TJG
    Tim Golden, Oct 13, 2010
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Seth Darr
    Replies:
    2
    Views:
    507
    Seth Darr
    Oct 6, 2004
  2. Replies:
    4
    Views:
    5,703
    Michael Borgwardt
    Dec 10, 2004
  3. bahoo
    Replies:
    1
    Views:
    481
    Marc 'BlackJack' Rintsch
    Apr 25, 2007
  4. Raj
    Replies:
    4
    Views:
    284
  5. harijay
    Replies:
    8
    Views:
    2,080
    harijay
    Jan 4, 2011
Loading...

Share This Page