Skip to content

Commit

Permalink
Add notes
Browse files Browse the repository at this point in the history
  • Loading branch information
Erotemic committed Sep 15, 2024
1 parent 3b3ca28 commit 4b30866
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion ubelt/util_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ def check_returncode(self):

def cmd(command, shell=False, detach=False, verbose=0, tee=None, cwd=None,
env=None, tee_backend='auto', check=False, system=False, timeout=None,
capture=True):
capture=True,
# Do we support these?
# universal_newlines=True,
# stdout='unused', stderr='unused'
):
"""
Executes a command in a subprocess.
Expand Down Expand Up @@ -228,6 +232,13 @@ def cmd(command, shell=False, detach=False, verbose=0, tee=None, cwd=None,
When using the tee output, the stdout and stderr may be shuffled from
what they would be on the command line.
Note:
While this function is generally compatible with subprocess.run and
other variants of Popen, we force defaults of universal_newlines=True,
and choose the values of stdout and stderr based on other arguments.
We are considering the pros and cons of a completely
drop-in-replacement API.
Related Work:
Similar to other libraries: [SubprocTee]_, [ShellJob]_, [CmdRunner]_, [PyInvoke]_.
Expand Down
2 changes: 1 addition & 1 deletion ubelt/util_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ def hash_data(data, hasher=NoParam, base=NoParam, types=False, convert=False,
convert (bool):
if True, try and convert the data to json an the json is hashed
instead. This can improve runtime in some instances, however the
hash may differ from the case where convert=False.
hash will likely differ from the case where convert=False.
extensions (HashableExtensions | None):
a custom :class:`HashableExtensions` instance that can overwrite or
Expand Down

0 comments on commit 4b30866

Please sign in to comment.