Bug 101716

Summary: test/name-test/*.py not compatible with Python 3
Product: dbus Reporter: Simon McVittie <smcv>
Component: coreAssignee: Simon McVittie <smcv>
Status: RESOLVED FIXED QA Contact: D-Bus Maintainers <dbus>
Severity: minor    
Priority: medium CC: smcv
Version: git masterKeywords: patch
Hardware: Other   
OS: All   
Whiteboard: review+
i915 platform: i915 features:
Attachments: test/name-test: Be compatible with Python 3

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]:
-----------------------------------------------------------------

Yes.
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.