Comments (5)
The benefit of this one is that it's subprocess
backed with all that brings. I agree shell=True is not what I promote use of but if we recommend people skip over os.system
in favor of something else, subprocess.shell
might make a good gateway drug out of os
land.
os.system
is, as the os
module is generally intended to be, a thin wrapper around the platform's libc or platform provided system()
or _wsystem()
C calls.
from cpython.
So essentially shell = functools.partial(subprocess.run, shell=True)
? That seems fine to me.
from cpython.
Possibly.
I think it has plenty of legitimate uses, which is why keeping os.system
is important. But adding something new to support it is certainly endorsing its use. And it doesn't really have much of a place in production or library code, while it does have an important place in scripting.
It's being added here so we can soft deprecate it elsewhere. I'd rather just leave the original one in place without any kind of deprecation.
from cpython.
Are we handing beginners a foot-shotgun by making shells (and all their quoting problems) easier to access? I like the explicit subprocess.run(..., shell=True)
spelling, but maybe I've stockholm syndrome'd myself.
from cpython.
I think that functools.partial definition is exactly all this should be (though lets make sure it does not allow shell=False
to be passed - I don't recall off the top of my what functools.partial does in that situation).
Documentation wise it'd get listed in the subprocess docs after subprocess.run()
with a one or two sentence description that it is just "run" with "shell=True" for convenience. With an example. And with the caveats of shell=True being re-stated.
from cpython.
Related Issues (20)
- "import hashlib" crashes on aarch64 after Finalize and re-initialize HOT 1
- test_launcher fails if no Python is installed
- Built-in function for generating UUIDv7 identifiers according to RFC9562 HOT 1
- Valgrind lists memory leaks: dlopen() called without dlclose() HOT 2
- python -Wall is undocumented
- Free-threaded libraries should be in `lib/python3.14t` (configure) HOT 2
- Add unittest.TestCase.assertMappingEqual
- Max linker memory being set for wasi thread builds
- tarfile "r|*" (stream mode) is much slower than "r:*"
- test_basic_multiple_interpreters_reset_each: _PyRefchain_Remove: Assertion `value == REFCHAIN_VALUE' failed HOT 2
- zipimport cannot do a namespace import when a directory has no python files, but it contains nested directories with python files inside of a zip file. HOT 7
- segfault in pymalloc_alloc HOT 1
- Skip __index__ handling in PyLong_AsNativeBytes
- tracemalloc: add new `dump_snapshot()` and `load_snapshot()` functions implemented in C HOT 1
- [C API] Add PySet_NextEntry() function HOT 10
- Self-documenting f-string in conversion specifier throws ValueError HOT 7
- Setting the line number is ignored in `INSTRUMENTED_YIELD_VALUE`
- Missing PyDECREF calls for ADDITEMS opcode of _pickle.c HOT 1
- riscv64: Python/perf_jit_trampoline.c:491:6: error: #error "Unsupported target architecture" HOT 2
- Support copy.replace() on AST nodes HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpython.