Index: src/sas/sascalc/dataloader/file_reader_base_class.py
===================================================================
--- src/sas/sascalc/dataloader/file_reader_base_class.py	(revision 26183bf39f591b65862edf2ed585facd5048ffdf)
+++ src/sas/sascalc/dataloader/file_reader_base_class.py	(revision 7b50f14eb38e44aca64b1a233e5b996b05f5dc0c)
@@ -6,4 +6,5 @@
 
 import os
+import sys
 import re
 import logging
@@ -18,4 +19,10 @@
 logger = logging.getLogger(__name__)
 
+if sys.version_info[0] < 3:
+    def decode(s):
+        return s
+else:
+    def decode(s):
+        return s.decode() if isinstance(s, bytes) else s
 
 class FileReader(object):
@@ -85,5 +92,5 @@
         """
         #return self.f_open.readline()
-        return self.f_open.readline().decode()
+        return decode(self.f_open.readline())
 
     def nextlines(self):
@@ -93,5 +100,5 @@
         for line in self.f_open:
             #yield line
-            yield line.decode()
+            yield decode(line)
 
     def readall(self):
@@ -100,5 +107,5 @@
         """
         #return self.f_open.read()
-        return self.f_open.read().decode()
+        return decode(self.f_open.read())
 
     def handle_error_message(self, msg):
Index: src/sas/sascalc/dataloader/readers/cansas_reader_HDF5.py
===================================================================
--- src/sas/sascalc/dataloader/readers/cansas_reader_HDF5.py	(revision 5c5e7fdac0faa6de24aaa0145fd07b5e6d76a5af)
+++ src/sas/sascalc/dataloader/readers/cansas_reader_HDF5.py	(revision 7b50f14eb38e44aca64b1a233e5b996b05f5dc0c)
@@ -9,13 +9,10 @@
 import sys
 
-from sas.sascalc.dataloader.data_info import plottable_1D, plottable_2D,\
+from ..data_info import plottable_1D, plottable_2D,\
     Data1D, Data2D, DataInfo, Process, Aperture, Collimation, \
     TransmissionSpectrum, Detector
-from sas.sascalc.dataloader.data_info import combine_data_info_with_plottable
-from sas.sascalc.dataloader.loader_exceptions import FileContentsException, DefaultReaderException
-from sas.sascalc.dataloader.file_reader_base_class import FileReader
-
-def decode(s):
-    return s.decode() if isinstance(s, bytes) else s
+from ..data_info import combine_data_info_with_plottable
+from ..loader_exceptions import FileContentsException, DefaultReaderException
+from ..file_reader_base_class import FileReader, decode
 
 def h5attr(node, key, default=None):
@@ -135,6 +132,6 @@
             # Get all information for the current key
             value = data.get(key)
-            classname = h5attr(value, u'canSAS_class')
-            if classname is None:
+            class_name = h5attr(value, u'canSAS_class')
+            if class_name is None:
                 class_name = h5attr(value, u'NX_class')
             if class_name is not None:
@@ -240,5 +237,5 @@
                             run_dict = {data_point: run_name}
                             self.current_datainfo.run_name = run_dict
-                        except:
+                        except Exception:
                             pass
                     elif key == u'title':
Index: src/sas/sascalc/dataloader/readers/xml_reader.py
===================================================================
--- src/sas/sascalc/dataloader/readers/xml_reader.py	(revision 5a6a84ed75b6c5d08074f088a4edb6aecc42a3ae)
+++ src/sas/sascalc/dataloader/readers/xml_reader.py	(revision 7b50f14eb38e44aca64b1a233e5b996b05f5dc0c)
@@ -20,5 +20,5 @@
 from lxml.builder import E
 
-from sas.sascalc.dataloader.file_reader_base_class import FileReader
+from ..file_reader_base_class import FileReader, decode
 
 logger = logging.getLogger(__name__)
@@ -153,6 +153,6 @@
         Converts an etree element into a string
         """
-        return etree.tostring(elem, pretty_print=pretty_print,
-                              encoding=encoding).decode()
+        return decode(etree.tostring(elem, pretty_print=pretty_print,
+                                     encoding=encoding))
 
     def break_processing_instructions(self, string, dic):
Index: test/sasdataloader/test/utest_cansas.py
===================================================================
--- test/sasdataloader/test/utest_cansas.py	(revision 56dac0b59c1ff00fd177b44e1b6717103111f0cf)
+++ test/sasdataloader/test/utest_cansas.py	(revision 7b50f14eb38e44aca64b1a233e5b996b05f5dc0c)
@@ -4,8 +4,11 @@
 import os
 import sys
-from io import StringIO
 import unittest
 import logging
 import warnings
+if sys.version_info[0] >= 3:
+    from io import StringIO
+else:
+    from StringIO import StringIO
 
 from lxml import etree
