This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
| Author | Roy Williams |
|---|---|
| Recipients | Roy Williams |
| Date | 2017年11月06日.17:27:25 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1509989245.86.0.213398074469.issue31961@psf.upfronthosting.co.za> |
| In-reply-to |
| Content | |
|---|---|
Repro:
```python
from pathlib import Path
import subprocess
subprocess.run([Path('/bin/ls')]) # Works Fine
subprocess.run(Path('/bin/ls')) # Fails
```
The problem seems to originate from here:
https://github.com/python/cpython/blob/master/Lib/subprocess.py#L1237-L1240
This file auspiciously avoids importing pathlib, which I'm guessing is somewhat intentional? Would the correct fix be to check for the existence of a `__fspath__` attribute as per https://www.python.org/dev/peps/pep-0519/ ? |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2017年11月06日 17:27:25 | Roy Williams | set | recipients: + Roy Williams |
| 2017年11月06日 17:27:25 | Roy Williams | set | messageid: <1509989245.86.0.213398074469.issue31961@psf.upfronthosting.co.za> |
| 2017年11月06日 17:27:25 | Roy Williams | link | issue31961 messages |
| 2017年11月06日 17:27:25 | Roy Williams | create | |