Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-22399

Installed Python scripts assume python2 is the default

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 7.4.0
    • 8.0.0
    • Init system
    • None

    Description

      Python scripts rely on the operating system's default version of Python, but syntactically they require Python2. One example is /opt/HPCCSystems/sbin/cluster_script.py:

      #!/usr/bin/env python
      
      import sys
      import os
      import os.path
      import getopt
      import Queue
      import time
      import datetime
      import logging
      import ConfigParser
      import signal
      

      The module names Queue and ConfigParser are specific to Python2. The Python3 versions are 'queue' and 'configparser'. The shebang line indicates that we'll accept whatever version of Python the OS is referencing. The upshot is that if a user has set Python3 as the default then this script will fail.

      This could be solved by either explicitly requiring Python2 in the shebang, or simply via documentation.

      Attachments

        Activity

          People

            mckellyln Mark Kelly
            dcamper Dan S. Camper
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: