Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #36112

'subprocess.check_output' extra new line?

From <sbremal@hotmail.com>
Subject 'subprocess.check_output' extra new line?
Date 2013-01-04 15:50 +0000
Newsgroups comp.lang.python
Message-ID <mailman.86.1357314726.2939.python-list@python.org> (permalink)

Show all headers | View raw


Hi

I wonder if the additional new line charachter at the end of the standard output capture is on purpose with 'subprocess.check_output'?

>>> subprocess.check_output([ 'cygpath', 'C:\\' ])
'/cygdrive/c\n'

If I do the same from the shell there is no extra new line (which is correct I believe):

$ x=$(cygpath C:\\); echo "_${x}_"
_/cygdrive/c_

Surely I have a workaround. I was more interested whether it was a design flaw.

Cheers
B. 		 	   		  

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

'subprocess.check_output' extra new line? <sbremal@hotmail.com> - 2013-01-04 15:50 +0000

csiph-web