gh-114272: Fix or skip tests that fail due to spaces in paths (GH-114451)

This commit is contained in:
Steve Dower 2024-01-25 00:38:34 +00:00 committed by GitHub
parent d5c21c12c1
commit c63c6142f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 45 additions and 25 deletions

View file

@ -207,7 +207,7 @@ class SubprocessMixin:
def test_kill_issue43884(self):
if sys.platform == 'win32':
blocking_shell_command = f'{sys.executable} -c "import time; time.sleep(2)"'
blocking_shell_command = f'"{sys.executable}" -c "import time; time.sleep(2)"'
else:
blocking_shell_command = 'sleep 1; sleep 1'
creationflags = 0
@ -745,7 +745,10 @@ class SubprocessMixin:
def test_create_subprocess_env_shell(self) -> None:
async def main() -> None:
cmd = f'''{sys.executable} -c "import os, sys; sys.stdout.write(os.getenv('FOO'))"'''
executable = sys.executable
if sys.platform == "win32":
executable = f'"{executable}"'
cmd = f'''{executable} -c "import os, sys; sys.stdout.write(os.getenv('FOO'))"'''
env = os.environ.copy()
env["FOO"] = "bar"
proc = await asyncio.create_subprocess_shell(