FS#41184 - [apitrace] 5.0-1 Crashes with Python SyntaxError

Attached to Project: Community Packages
Opened by Hannes Dinter (cdo) - Sunday, 13 July 2014, 14:56 GMT
Last edited by Laurent Carlier (lordheavy) - Sunday, 03 August 2014, 01:15 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Laurent Carlier (lordheavy)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
When trying to use 'apitrace diff', a Python SyntaxError is raised.

Package versions:
apitrace 5.0-1
Python 3.4.1

Steps to reproduce:
sudo pacman -S apitrace
apitrace help diff

Result:
File "/usr/bin/../lib/apitrace/scripts/tracediff.py", line 298
raise ValueError, 'unknown tag %s' % (tag,)
^
SyntaxError: invalid syntax
This task depends upon

Closed by  Laurent Carlier (lordheavy)
Sunday, 03 August 2014, 01:15 GMT
Reason for closing:  Fixed
Additional comments about closing:  apitrace-5.0-2
Comment by Hannes Dinter (cdo) - Sunday, 13 July 2014, 15:02 GMT
In the file
/usr/lib/apitrace/scripts/tracediff.py
it says
#!/usr/bin/env python
although in the package details, it lists python2 (not 3) as a dependency.
(Which is in accordance with the upstream installation requirements: https://github.com/apitrace/apitrace/blob/master/INSTALL.markdown)

Edit: however, simply changing that line into
#!/usr/bin/env python2
does not resolve the issue.
Comment by Hannes Dinter (cdo) - Friday, 18 July 2014, 00:04 GMT
Found the solution:

The call to the "python" executable is hard-coded in the following source files:
cli/cli_diff.cpp
cli/cli_diff_images.cpp
cli/cli_diff_state.cpp

After changing the related strings to "python2" and rebuilding, everything works like a charm.

Loading...