hi, we’re trying to upgrade pants from 1.18 -> ...
# general
hi, we’re trying to upgrade pants from 1.18 -> 1.29. we’ve currently configured pants to use ipython for the repl but that doesn’t seem to be working with the v2 engine? Getting a bad file descriptor error from prompt_toolkit.
Copy code
File "/Users/nate/.pex/installed_wheels/76668ef9197325b7555d7f8658f6c5fa043bed68/prompt_toolkit-1.0.18-py3-none-any.whl/prompt_toolkit/terminal/vt100_input.py", line 473, in __enter__
    os.write(self.fileno, b'\x1b[?1l')
OSError: [Errno 9] Bad file descriptor
When i clone the pants repo and run pants on an arbitrary target i seem to encounter this error as well.
Copy code
$ pants repl --shell=ipython src/python/pants/subsystem
20:37:35 [INFO] initializing pantsd...
20:37:37 [INFO] pantsd initialized.
Python 3.6.8 (default, Dec 10 2019, 16:24:15)
Type "copyright", "credits" or "license" for more information.

IPython 5.8.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]:
Traceback (most recent call last):
  File "/Users/nate/git/pants/.pants.d/tmpfzvz8aqy/ipython-repl.pex/.bootstrap/pex/pex.py", line 401, in execute
    exit_code = self._wrap_coverage(self._wrap_profiling, self._execute)
  File "/Users/nate/git/pants/.pants.d/tmpfzvz8aqy/ipython-repl.pex/.bootstrap/pex/pex.py", line 333, in _wrap_coverage
    return runner(*args)
  File "/Users/nate/git/pants/.pants.d/tmpfzvz8aqy/ipython-repl.pex/.bootstrap/pex/pex.py", line 364, in _wrap_profiling
    return runner(*args)
  File "/Users/nate/git/pants/.pants.d/tmpfzvz8aqy/ipython-repl.pex/.bootstrap/pex/pex.py", line 452, in _execute
    return self.execute_entry(self._pex_info.entry_point)
  File "/Users/nate/git/pants/.pants.d/tmpfzvz8aqy/ipython-repl.pex/.bootstrap/pex/pex.py", line 549, in execute_entry
    return runner(entry_point)
  File "/Users/nate/git/pants/.pants.d/tmpfzvz8aqy/ipython-repl.pex/.bootstrap/pex/pex.py", line 564, in execute_pkg_resources
    return runner()
  File "/Users/nate/.pex/installed_wheels/2928e7ea34defca47fe9b3590872c4898d3d337c/ipython-5.8.0-py3-none-any.whl/IPython/__init__.py", line 119, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/Users/nate/.pex/installed_wheels/2141181f135fda3f826e75453c112fc9d4ab5943/traitlets-4.3.3-py2.py3-none-any.whl/traitlets/config/application.py", line 664, in launch_instance
  File "/Users/nate/.pex/installed_wheels/2928e7ea34defca47fe9b3590872c4898d3d337c/ipython-5.8.0-py3-none-any.whl/IPython/terminal/ipapp.py", line 355, in start
  File "/Users/nate/.pex/installed_wheels/2928e7ea34defca47fe9b3590872c4898d3d337c/ipython-5.8.0-py3-none-any.whl/IPython/terminal/interactiveshell.py", line 495, in mainloop
  File "/Users/nate/.pex/installed_wheels/2928e7ea34defca47fe9b3590872c4898d3d337c/ipython-5.8.0-py3-none-any.whl/IPython/terminal/interactiveshell.py", line 478, in interact
    code = self.prompt_for_code()
  File "/Users/nate/.pex/installed_wheels/2928e7ea34defca47fe9b3590872c4898d3d337c/ipython-5.8.0-py3-none-any.whl/IPython/terminal/interactiveshell.py", line 372, in prompt_for_code
    pre_run=self.pre_prompt, reset_current_buffer=True)
  File "/Users/nate/.pex/installed_wheels/76668ef9197325b7555d7f8658f6c5fa043bed68/prompt_toolkit-1.0.18-py3-none-any.whl/prompt_toolkit/interface.py", line 411, in run
    with self.input.raw_mode():
  File "/Users/nate/.pex/installed_wheels/76668ef9197325b7555d7f8658f6c5fa043bed68/prompt_toolkit-1.0.18-py3-none-any.whl/prompt_toolkit/terminal/vt100_input.py", line 473, in __enter__
    os.write(self.fileno, b'\x1b[?1l')
OSError: [Errno 9] Bad file descriptor
I checked the open issues and prs on github and didn’t find anything. Is this a known issue? Or is there something with my current system that’s causing this? I’m currently on Mac 10.14.6 and running pyenv with python 3.6.8.
Hey Nate! Try out
. This might be https://github.com/pantsbuild/pants/issues/9939
Also, to double check, have you seen the upgrade guide for adopting the v2 engine? https://www.pantsbuild.org/docs/how-to-upgrade-to-the-v2-engine Glad to hear you’re trying it out!
ah, cool, that
worked on the pants repo, i’ll try it out on our own.
yah, i’ve been reading through the docs on upgrading to v2. been running into various issues because i just skimmed them at first 🙂
definitely excited about v2, pantsd and remote execution! thanks for all the work on it
Glad to hear you’re following along! Let us know when you do run into issues, we are really excited too about v2 and are eager to help people upgrade and to fix any issues folks run into