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


Groups > comp.lang.python > #36112 > unrolled thread

'subprocess.check_output' extra new line?

Started by<sbremal@hotmail.com>
First post2013-01-04 15:50 +0000
Last post2013-01-04 15:50 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

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

#36112 — 'subprocess.check_output' extra new line?

From<sbremal@hotmail.com>
Date2013-01-04 15:50 +0000
Subject'subprocess.check_output' extra new line?
Message-ID<mailman.86.1357314726.2939.python-list@python.org>
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. 		 	   		  

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web