Tests: python: path-like object introduced in python 3.6
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 27 Jun 2023 17:33:18 +0000 (17:33 +0000)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 27 Jul 2023 17:51:02 +0000 (13:51 -0400)
commit8a5e382450359a884bbe594547dfb810e9196d0e
tree71bc691686a189e9785a86ef421750df39f6da99
parentca400a290a3e98e9f2578d4cbaede87019f2ee94
Tests: python: path-like object introduced in python 3.6

Prior to python 3.6 the os.path() function expected a string or bytes
object for the pathname. Use a compat method to convert the path-like
object to a string on interpreters that lack PEP-519 [1] support.

Traceback (most recent call last):
  File "tests/regression/tools/context/test_ust.py", line 156, in <module>
    tap, test_env, lttngtest.VpidContextType(), lambda test_app: test_app.vpid
  File "tests/regression/tools/context/test_ust.py", line 114, in test_static_context
    test_app = test_env.launch_wait_trace_test_application(50)
  File "tests/utils/lttngtest/environment.py", line 541, in launch_wait_trace_test_application
    wait_before_exit_file_path,
  File "tests/utils/lttngtest/environment.py", line 163, in __init__
    self._wait_for_file_to_be_created(pathlib.Path(app_ready_file_path))
  File "tests/utils/lttngtest/environment.py", line 168, in _wait_for_file_to_be_created
    if os.path.exists(sync_file_path):
  File "/usr/lib/python3.5/genericpath.py", line 19, in exists
    os.stat(path)
TypeError: argument should be string, bytes or integer, not PosixPath

[1] https://peps.python.org/pep-0519/

Change-Id: I783e36f61223d44667294ccbf4b3aec5bff68701
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/utils/lttngtest/environment.py
This page took 0.024375 seconds and 4 git commands to generate.