'subprocess.check_output' extra new line?

G

Guest

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,001
Messages
2,570,249
Members
46,846
Latest member
BettinaOsw

Latest Threads

Top