diff --git a/packaging/language/pip.py b/packaging/language/pip.py index 30adce43ef1..e587fad920f 100644 --- a/packaging/language/pip.py +++ b/packaging/language/pip.py @@ -258,6 +258,9 @@ def main(): if state == 'latest' and version is not None: module.fail_json(msg='version is incompatible with state=latest') + if chdir is None: + chdir = tempfile.gettempdir() + err = '' out = ''