[Tutor] 2.7.3 Popen argument issues

Don Jennings dfjennings at gmail.com
Sun Aug 26 14:57:05 CEST 2012


On Aug 26, 2012, at 12:25 AM, tutor-request at python.org wrote:

> Message: 2
> Date: Sat, 25 Aug 2012 17:46:08 -0700
> From: Ray Jones <crawlzone at gmail.com>
> To: tutor at python.org
> Subject: [Tutor] 2.7.3 Popen argument issues
> Message-ID: <503971D0.5040609 at gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> Is there a method by which I can get an exact representation of command
> line arguments passed by Popen as seen by the called program? The
> argument error I receive shows me an argument that looks exactly like
> the argument that I use with Bash (it should - I copied and pasted it) -
> but the Bash version works while the Python version doesn't.
> 
> The purpose is to capture http streaming video to a file and also split
> it out to a local port so that I can pop in and monitor where I am in
> the stream.
> 
> Here is my Bash call to vlc (it works):
> 
> vlc http://"$HOST":$PORT -I dummy --sout 
> '#duplicate{dst="transcode{vb=400}:std{access=file,mux=avi,dst=testing.avi}",dst="std{access=http,mux=mpjpeg,dst=127.0.0.1:11300}"}'

Notice that the above call ends in a single quote?

> &
> 
> Here is my Python call to vlc (error response to follow):
> 
> vlcExec = sp.Popen(['vlc', 'http://' + ip + ':' + port, '-I dummy',
> '--sout
> \'#duplicate{dst="transcode{vb=400}:std{access=file,mux=avi,dst=outFile
> + '.avi}",dst="std{access=http,mux=mpjpeg,dst=127.0.0.1:11300}"}\''])
> 
> (That is not an escaped double quote at the end - that is " \' " and " ' ").
> 
> Here is the resulting error from vlc:
> 
> vlc: unknown option or missing mandatory argument `--sout
> '#duplicate{dst="transcode{vb=400}:std{access=file,mux=avi,dst=testing.avi}",dst="std{access=http,mux=mpjpeg,dst=127.0.0.1:11300}"}''

Notice that this one ends in a double quote? Those are **definitely not** the same :>)

Take care,
Don
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120826/87a8f9b4/attachment.html>


More information about the Tutor mailing list