Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Accept path-like objects in subprocess arguments
* Also add subprocess test case using Path object * uvloop already handles path-like cwd correctly, so I just copy-and-pasted the same logic to _init_args() method. * The standard library uses "isinstance(obj, os.PathLike)" to check if an object is path-like, but os.PathLike exists as of Python 3.6. Since uvloop needs to support Python 3.5, we should use manual check for existence of the __fspath__ attribute. * According to the official Python documentation: - https://docs.python.org/3/library/subprocess.html#subprocess.Popen The subprocess.Popen() constructor support path-like objects since Python 3.6 on POSIX and since Python 3.8 on Windows. - https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.subprocess_exec This page does not mention about path-like objects, but as of Python 3.8, it DOES support path-like objects.
- Loading branch information