Update python code for python 3.8 or higher compatibility

Changes:
     - Update shebang directive to use python3 explicitly.
     - remove preexec_fn feature which is deprecated in higher
       python version 3.8 and above.
     - bufsize fix, from documentation bufsize 1 means line buffered
      (only usable if universal_newlines=True i.e., in a text mode)
      refer: https://docs.python.org/3/library/subprocess.html
     - Fix SyntaxWarning: "is" with "=="

Change-Id: Ib96c1ba8c2327d6774d0d731b48ca7e61a4a297a
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/data/Palmetto.py b/data/Palmetto.py
index 05a14a1..24842de 100755
--- a/data/Palmetto.py
+++ b/data/Palmetto.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python3
 
 HOME_PATH = './'
 CACHE_PATH = '/var/cache/obmc/'
diff --git a/data/Witherspoon.py b/data/Witherspoon.py
index d5dab6a..e106eb9 100755
--- a/data/Witherspoon.py
+++ b/data/Witherspoon.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!/usr/bin/env python3
 
 # System states
 # state can change to next state in 2 ways:
diff --git a/data/ipmi_raw_cmd_table.py b/data/ipmi_raw_cmd_table.py
index 2be3dac..c6af003 100644
--- a/data/ipmi_raw_cmd_table.py
+++ b/data/ipmi_raw_cmd_table.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 r"""
 IPMI raw commands table:
diff --git a/data/ipmi_rest_fru_field_map.py b/data/ipmi_rest_fru_field_map.py
index 80f8479..0ada176 100644
--- a/data/ipmi_rest_fru_field_map.py
+++ b/data/ipmi_rest_fru_field_map.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 r"""
 IPMI REST FRU field mapping:
diff --git a/data/ipmi_variable.py b/data/ipmi_variable.py
index 64aae68..b9958ed 100644
--- a/data/ipmi_variable.py
+++ b/data/ipmi_variable.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 
 r"""
 Contains channel-related constants.
diff --git a/data/model.py b/data/model.py
index 27a744a..de5ca9a 100755
--- a/data/model.py
+++ b/data/model.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python -u
+#!/usr/bin/env python3 -u
 import sys
 from robot.libraries.BuiltIn import BuiltIn
 import imp
diff --git a/data/pel_variables.py b/data/pel_variables.py
index f5aa729..aec1b8b 100644
--- a/data/pel_variables.py
+++ b/data/pel_variables.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 
 r"""
 Contains PEL related constants.
diff --git a/data/pldm_variables.py b/data/pldm_variables.py
index f3f8ce9..c5407d6 100755
--- a/data/pldm_variables.py
+++ b/data/pldm_variables.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 
 r"""
 Contains PLDM-related constants.
diff --git a/data/vpd_variables.py b/data/vpd_variables.py
index 3512776..dc310c8 100644
--- a/data/vpd_variables.py
+++ b/data/vpd_variables.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 
 r"""
 Contains VPD related constants.