Repository: oppia/oppia

Issue:
Running scripts.clean followed by scripts.install_third_party leads to an unexpected error message
**Description of the bug**

Per a recent [email](https://groups.google.com/g/oppia-dev/c/AvyfVBIl_fA) by @brianrodri on oppia-dev@, I ran `python -m scripts.clean` followed by `python -m scripts.install_third_party`. On running the second script, I got the following traceback:

```
Regenerating "requirements.txt" file...
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/opensource/oppia/scripts/install_third_party.py", line 420, in <module>
    main()
  File "/opensource/oppia/scripts/install_third_party.py", line 412, in main
    install_backend_python_libs.main()
  File "scripts/install_backend_python_libs.py", line 579, in main
    stderr=subprocess.PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '[u'python', u'-m', u'scripts.regenerate_requirements']' returned non-zero exit status 1
```

It would be better if a clearer error message was displayed here, specifically the text and stacktrace of what the error from regenerate_requirements was.

/cc @kevjumba 
Running scripts.clean followed by scripts.install_third_party leads to an unexpected error message
**Description of the bug**

Per a recent [email](https://groups.google.com/g/oppia-dev/c/AvyfVBIl_fA) by @brianrodri on oppia-dev@, I ran `python -m scripts.clean` followed by `python -m scripts.install_third_party`. On running the second script, I got the following traceback:

```
Regenerating "requirements.txt" file...
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/opensource/oppia/scripts/install_third_party.py", line 420, in <module>
    main()
  File "/opensource/oppia/scripts/install_third_party.py", line 412, in main
    install_backend_python_libs.main()
  File "scripts/install_backend_python_libs.py", line 579, in main
    stderr=subprocess.PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '[u'python', u'-m', u'scripts.regenerate_requirements']' returned non-zero exit status 1
```

It would be better if a clearer error message was displayed here, specifically the text and stacktrace of what the error from regenerate_requirements was.

/cc @kevjumba 


Discussion:

Resolving patch:
diff --git a/scripts/install_backend_python_libs.py b/scripts/install_backend_python_libs.py
--- a/scripts/install_backend_python_libs.py
+++ b/scripts/install_backend_python_libs.py
@@ -575,8 +575,7 @@ def main():
     subprocess.check_call(
         ['python', '-m', 'scripts.regenerate_requirements'],
         stdin=subprocess.PIPE,
-        stdout=subprocess.PIPE,
-        stderr=subprocess.PIPE)
+        stdout=subprocess.PIPE)
     # Adds a note to the beginning of the 'requirements.txt' file to make sure
     # developers understand that they should not append or change this
     # autogenerated file.


Test patch: