GW150914.rpar gallery example assumes "python" is python2

Create issue
Issue #2405 resolved
Roland Haas created an issue

The gallery example uses a python script parfile whose first line is

#!/usr/bin/env python

but the script only works with python2 and fails with python3

python3 GW150914.rpar
Traceback (most recent call last):
  File "GW150914.rpar", line 160, in <module>
    if isinstance(val, (int, long, float, complex, str)):
NameError: name 'long' is not defined

Comments (6)

  1. Roland Haas reporter

    One thing that should be fixed: the pull request had “python3” in the “#!” line which is just as bad as what was there before, as it will now fail unless python3 exists. It tooks like a leftover from testing (and forcing python3) to me.

    A solution would have been to change “/usr/bin/env python” to “/usr/bin/env python2” since python provably existed and the name “python2” exists even on clusters (eg BW) that natively only offer python2.

    Given that the script now does seems to support running as both python2 and python3 code I think the “#!” line could remain unchanged.

    Fine to apply otherwise.

  2. Barry Wardell

    This has now been merged after removing the explicit dependence on python3 so that it also still works with python2.

  3. Log in to comment