Skip to content

Repair Executor error handling for other classes of IOError/OSError.#292

Merged
kwlzn merged 2 commits into
pex-tool:masterfrom
kwlzn:kwlzn/executor/error_handling
Jul 19, 2016
Merged

Repair Executor error handling for other classes of IOError/OSError.#292
kwlzn merged 2 commits into
pex-tool:masterfrom
kwlzn:kwlzn/executor/error_handling

Conversation

@kwlzn
Copy link
Copy Markdown
Contributor

@kwlzn kwlzn commented Jul 19, 2016

Addresses handling of @benley's case of attempted execution of a dir, which produced the following unhandled AttributeError:

Traceback (most recent call last):
  File ".bootstrap/_pex/pex.py", line 328, in execute
  File ".bootstrap/_pex/pex.py", line 260, in _wrap_coverage
  File ".bootstrap/_pex/pex.py", line 292, in _wrap_profiling
  File ".bootstrap/_pex/pex.py", line 371, in _execute
  File ".bootstrap/_pex/pex.py", line 429, in execute_entry
  File ".bootstrap/_pex/pex.py", line 434, in execute_module
  File "/usr/lib/python2.7/runpy.py", line 180, in run_module
    fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/nonexistent/.pex/install/pex_wrapper-0.0.0-py2.7.egg.355ab1e4a2649222db04cd7b5a7f2a400079ce2a/pex_wrapper-0.0.0-py2.7.egg/pex_wrapper.py", line 256, in <module>
    sys.exit(main())
  File "/nonexistent/.pex/install/pex_wrapper-0.0.0-py2.7.egg.355ab1e4a2649222db04cd7b5a7f2a400079ce2a/pex_wrapper-0.0.0-py2.7.egg/pex_wrapper.py", line 253, in main
    pex_builder.build(output)
  File "/nonexistent/.pex/install/pex-1.1.13-py2.py3-none-any.whl.54e2486bd5c6fda99021a6500098c4976315d6fc/pex-1.1.13-py2.py3-none-any.whl/pex/pex_builder.py", line 424, in build
    self.freeze(bytecode_compile=bytecode_compile)
  File "/nonexistent/.pex/install/pex-1.1.13-py2.py3-none-any.whl.54e2486bd5c6fda99021a6500098c4976315d6fc/pex-1.1.13-py2.py3-none-any.whl/pex/pex_builder.py", line 411, in freeze
    self._precompile_source()
  File "/nonexistent/.pex/install/pex-1.1.13-py2.py3-none-any.whl.54e2486bd5c6fda99021a6500098c4976315d6fc/pex-1.1.13-py2.py3-none-any.whl/pex/pex_builder.py", line 335, in _precompile_source
    compiled_relpaths = compiler.compile(self._chroot.path(), source_relpaths)
  File "/nonexistent/.pex/install/pex-1.1.13-py2.py3-none-any.whl.54e2486bd5c6fda99021a6500098c4976315d6fc/pex-1.1.13-py2.py3-none-any.whl/pex/compiler.py", line 86, in compile
    out, _ = Executor.execute([self._interpreter.binary, fp.name])
  File "/nonexistent/.pex/install/pex-1.1.13-py2.py3-none-any.whl.54e2486bd5c6fda99021a6500098c4976315d6fc/pex-1.1.13-py2.py3-none-any.whl/pex/executor.py", line 83, in execute
    stdout_raw, stderr_raw = process.communicate(input=stdin_payload)
AttributeError: 'NoneType' object has no attribute 'communicate'

@peiyuwang
Copy link
Copy Markdown

lgtm!

@kwlzn kwlzn merged commit be17416 into pex-tool:master Jul 19, 2016
@kwlzn
Copy link
Copy Markdown
Contributor Author

kwlzn commented Jul 19, 2016

thanks @peiyuwang!

@kwlzn kwlzn mentioned this pull request Jul 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants