Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create_subprocess doesn't work with PathLike objects #90

Closed
JelleZijlstra opened this issue May 11, 2017 · 3 comments
Closed

create_subprocess doesn't work with PathLike objects #90

JelleZijlstra opened this issue May 11, 2017 · 3 comments

Comments

@JelleZijlstra
Copy link
Contributor

  • uvloop version: 0.8.0
  • Python version: 3.6.1
  • Platform: Ubuntu
  • Can you reproduce the bug with PYTHONASYNCIODEBUG in env?: Yes

The following test script fails as follows:

import asyncio
from pathlib import Path
import uvloop

async def make_process():
    await asyncio.subprocess.create_subprocess_exec('ls', cwd=Path('/tmp'))

asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
asyncio.get_event_loop().run_until_complete(make_process())
  File "uvloop/loop.pyx", line 2164, in __subprocess_run (uvloop/loop.c:39415)
  File "uvloop/handles/process.pyx", line 549, in uvloop.loop.UVProcessTransport.new (uvloop/loop.c:93764)
  File "uvloop/handles/process.pyx", line 49, in uvloop.loop.UVProcess._init (uvloop/loop.c:84744)
  File "uvloop/handles/process.pyx", line 38, in uvloop.loop.UVProcess._init (uvloop/loop.c:84464)
  File "uvloop/handles/process.pyx", line 233, in uvloop.loop.UVProcess._init_options (uvloop/loop.c:87896)
ValueError: cwd must be a str or bytes object

This works fine with vanilla asyncio. Fixing the bug is probably just a matter of calling os.fspath/PyOS_FSPath somewhere.

1st1 added a commit that referenced this issue Nov 13, 2017
@1st1
Copy link
Member

1st1 commented Nov 13, 2017

Fixed in master. Will be in the next uvloop release (0.9.0) soon.

@1st1 1st1 closed this as completed Nov 13, 2017
@JelleZijlstra
Copy link
Contributor Author

Thanks!

@1st1
Copy link
Member

1st1 commented Nov 27, 2017

Please try uvloop v0.9.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants