Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #36112
| Path | csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <sbremal@hotmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.023 |
| X-Spam-Evidence | '*H*': 0.95; '*S*': 0.00; 'output': 0.04; "subject:' ": 0.07; 'subject:extra': 0.09; "'c:\\\\'": 0.16; 'echo': 0.16; 'shell': 0.18; '>>>': 0.18; 'cheers': 0.24; '(which': 0.26; 'wonder': 0.27; 'correct': 0.28; 'skip:_ 10': 0.29; "skip:' 10": 0.30; "skip:' 20": 0.32; 'surely': 0.33; 'to:addr:python-list': 0.33; 'subject:?': 0.35; 'there': 0.35; 'to:addr:python.org': 0.39; 'end': 0.40; 'from:no real name:2**0': 0.60; 'more': 0.63; 'subject:skip:s 20': 0.91 |
| X-EIP | [9x08pgejNnOapr7n8a9hkbPOEBMkJ6y45nt6rDSL9h4=] |
| X-Originating-Email | [sbremal@hotmail.com] |
| From | <sbremal@hotmail.com> |
| To | <python-list@python.org> |
| Subject | 'subprocess.check_output' extra new line? |
| Date | Fri, 4 Jan 2013 15:50:58 +0000 |
| Importance | Normal |
| Content-Type | text/plain; charset="iso-8859-1" |
| Content-Transfer-Encoding | quoted-printable |
| MIME-Version | 1.0 |
| X-OriginalArrivalTime | 04 Jan 2013 15:50:59.0241 (UTC) FILETIME=[4A5E7990:01CDEA93] |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.86.1357314726.2939.python-list@python.org> (permalink) |
| Lines | 20 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1357314726 news.xs4all.nl 6955 [2001:888:2000:d::a6]:38974 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:36112 |
Show key headers only | 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
'subprocess.check_output' extra new line? <sbremal@hotmail.com> - 2013-01-04 15:50 +0000
csiph-web