Bug 101716 - test/name-test/*.py not compatible with Python 3
Summary: test/name-test/*.py not compatible with Python 3
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: git master
Hardware: Other All
: medium minor
Assignee: Simon McVittie
QA Contact: D-Bus Maintainers
Whiteboard: review+
Keywords: patch
Depends on:
Reported: 2017-07-07 11:12 UTC by Simon McVittie
Modified: 2017-07-07 12:28 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:

test/name-test: Be compatible with Python 3 (2.82 KB, patch)
2017-07-07 11:18 UTC, Simon McVittie
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Simon McVittie 2017-07-07 11:12:15 UTC
Some of our optionally-run build-time tests use #!/usr/bin/env python, and we actually run them under PYTHON as auto-detected by configure.ac. However, they use Python 2 syntax.

This is not going to work if PATH contains python3 but not python (which turns out to be the case for current Debian autobuilders), or if /usr/bin/python is Python 3 (which is a terrible idea[1], but Arch Linux does it anyway).

It turns out this is trivial to fix.

[1] https://www.python.org/dev/peps/pep-0394/
Comment 1 Simon McVittie 2017-07-07 11:18:34 UTC
Created attachment 132491 [details] [review]
test/name-test: Be compatible with Python 3

configure.ac will detect PYTHON=python3 if there is no python
executable in the PATH.
Comment 2 Simon McVittie 2017-07-07 11:18:54 UTC
This is so trivial that I'm inclined to apply it to 1.10 as well as master.
Comment 3 Philip Withnall 2017-07-07 11:48:06 UTC
Comment on attachment 132491 [details] [review]
test/name-test: Be compatible with Python 3

Review of attachment 132491 [details] [review]:

Comment 4 Simon McVittie 2017-07-07 12:28:03 UTC
Thanks, fixed in git for 1.10.22 and 1.11.16

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.