jaraco / pip-run

pip-run - dynamic dependency loader for Python
MIT License
136 stars 19 forks source link

`OSError: [Errno 63] File name too long` thrown for long Python arguments (e.g. long command string) #70

Closed vergenzt closed 1 year ago

vergenzt commented 1 year ago

To reproduce:

$ pip-run pyjwt -- -c 'print("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")'
Traceback (most recent call last):
  File "/Users/tim.vergenz/.local/bin/pip-run", line 8, in <module>
    sys.exit(run())
  File "/Users/tim.vergenz/.local/pipx/venvs/pip-run/lib/python3.10/site-packages/pip_run/__init__.py", line 15, in run
    pip_args.extend(scripts.DepsReader.search(py_args))
  File "/Users/tim.vergenz/.local/pipx/venvs/pip-run/lib/python3.10/site-packages/pip_run/scripts.py", line 73, in search
    return cls.try_read(next(files, None)).params()
  File "/usr/local/Cellar/python@3.10/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pathlib.py", line 1322, in is_file
    return S_ISREG(self.stat().st_mode)
  File "/usr/local/Cellar/python@3.10/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pathlib.py", line 1097, in stat
    return self._accessor.stat(self, follow_symlinks=follow_symlinks)
OSError: [Errno 63] File name too long: 'print("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")'

Traceback seems to indicate it's caused by the code that checks if pip-run is given a file: https://github.com/jaraco/pip-run/blob/12ad62189e2b49892dfe48275b6768455b137c3b/pip_run/scripts.py#L64-L73

jaraco commented 1 year ago

Thanks for the report. Should be fixed in 10.0.7.

vergenzt commented 1 year ago

Thanks!