A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-June/135076.html below:

[Python-Dev] subprocess shell=True on Windows doesn't escape ^ character

[Python-Dev] subprocess shell=True on Windows doesn't escape ^ character [Python-Dev] subprocess shell=True on Windows doesn't escape ^ characteranatoly techtonik techtonik at gmail.com
Sat Jun 14 21:54:01 CEST 2014
On Fri, Jun 13, 2014 at 2:55 AM, Ryan Gonzalez <rymg19 at gmail.com> wrote:

> SHELLS ARE NOT CROSS-PLATFORM!!!! Seriously, there are going to be
> differences. If you really must:
>
> escape = lambda s: s.replace('^', '^^') if os.name == 'nt' else s
>

It is not about generic shell problem, it is about specific behavior that
on Windows Python already uses cmd.exe shell hardcoded in its sources. So
for crossplatform behavior on Windows, it should escape symbols on command
passed to cmd.exe that are special to this shell to avoid breaking Python
scripts. What you propose is a bad workaround, because it assumes that all
Python users who use subprocess to execute hg or git should possess apriori
knowledge about default subprocess behaviour with default shell on Windows
and implement workaround for that.
-- 
anatoly t.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20140614/9f23e89d/attachment.html>
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4