Skip to content

Fails if python is Python3 #36

@Keith-S-Thompson

Description

@Keith-S-Thompson

The first line of vigil is

#!/usr/bin/env python

On my system (Ubuntu 22.04.1 LTS), /usr/bin/python is a symlink to python3, and since vigil uses Python2-specific constructs, it fails.

I have a patch that adds parentheses to all the print statements, making the code compatible with both Python2 and Python3. I'll create a pull request in a moment.

Another solution would be to change the first line to

#!/usr/bin/env python2

but that would fail on systems that don't have Python2 installed, or that don't call it python2.

I see there's another pending PR that converts the code to Python3. I note that that could break on older systems where python is Python2.

I use Vigil for one of the entries in my fizzbuzz-polyglot project. My current workaround is to manually change the first line to #!/usr/bin/env python2.

This is, on multiple levels, not a critical issue for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions