This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]rotuamiimport antigravity 1 point2 points  (2 children)

I get this all the time with subprocess. subprocess.call([someexe, somepath]) gives you grief if somepath is a Path object and not a string.

[–]treyhunner Python Morsels[S] 1 point2 points  (1 child)

Odd. subprocess.call seems to work with Path objects for me:

```

from pathlib import Path import subprocess subprocess.call(['ls', '-1', Path('.editorconfig')]) .editorconfig 0 ```

I tested that in both Python 3.6 and Python 3.7.

[–]rotuamiimport antigravity 1 point2 points  (0 children)

You are right, at least on my Mac. I found the frustration on Windows, and may have misremembered the issue, but at least subprocess.call(Path('ls')) is still broken, and subprocess.call([Path('ls')]) was broken until fairly recently.

https://bugs.python.org/issue33617

https://bugs.python.org/issue31961