@@ -754,8 +754,8 @@ Exceptions defined in this module all inherit from :exc:`SubprocessError`.
754754Security Considerations
755755-----------------------
756756
757- Unlike some other popen functions, this implementation will never
758- implicitly call a system shell. This means that all characters,
757+ Unlike some other popen functions, this library will not
758+ implicitly choose to call a system shell. This means that all characters,
759759including shell metacharacters, can safely be passed to child processes.
760760If the shell is invoked explicitly, via ``shell=True ``, it is the application's
761761responsibility to ensure that all whitespace and metacharacters are
@@ -764,6 +764,14 @@ quoted appropriately to avoid
764764vulnerabilities. On :ref: `some platforms <shlex-quote-warning >`, it is possible
765765to use :func: `shlex.quote ` for this escaping.
766766
767+ On Windows, batch files (:file: `*.bat ` or :file: `*.cmd `) may be launched by the
768+ operating system in a system shell regardless of the arguments passed to this
769+ library. This could result in arguments being parsed according to shell rules,
770+ but without any escaping added by Python. If you are intentionally launching a
771+ batch file with arguments from untrusted sources, consider passing
772+ ``shell=True `` to allow Python to escape special characters. See :gh: `114539 `
773+ for additional discussion.
774+
767775
768776Popen Objects
769777-------------
0 commit comments