mkocher <[email protected]> added the comment:
There also appears to be an issue when args are provided as a `pathlib.Path`
instance.
Python 3.9.2 | packaged by conda-forge | (default, Feb 21 2021, 05:02:20)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.22.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from subprocess import Popen
In [2]: from pathlib import Path
In [3]: p = Path('/usr/local/bin/gtrue')
In [4]: x = Popen(p)
In [5]: repr(x)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-5-5091dd558c19> in <module>
----> 1 repr(x)
~/opt/miniconda3/envs/core/lib/python3.9/subprocess.py in __repr__(self)
990 obj_repr = (
991 f"<{self.__class__.__name__}: "
--> 992 f"returncode: {self.returncode} args: {list(self.args)!r}>"
993 )
994 if len(obj_repr) > 80:
TypeError: 'PosixPath' object is not iterable
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue43776>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com