From: Michael R. Crusoe <michael.crusoe@gmail.com>
Subject: Upgrade from Python2 to Python 3
--- a/build/gprof2dot.py
+++ b/build/gprof2dot.py
@@ -1,4 +1,4 @@
-#!/opt/python-2.5/bin/python
+#!/usr/bin/python3
 #
 # Copyright 2008-2009 Jose Fonseca
 #
@@ -40,7 +40,7 @@
 
 
 def times(x):
-    return u"%u\xd7" % (x,)
+    return "%u\xd7" % (x,)
 
 def percentage(p):
     return "%.02f%%" % (p*100.0,)
@@ -245,8 +245,8 @@
     def validate(self):
         """Validate the edges."""
 
-        for function in self.functions.itervalues():
-            for callee_id in function.calls.keys():
+        for function in self.functions.values():
+            for callee_id in list(function.calls.keys()):
                 assert function.calls[callee_id].callee_id == callee_id
                 if callee_id not in self.functions:
                     sys.stderr.write('warning: call to undefined function %s from function %s\n' % (str(callee_id), function.name))
@@ -257,11 +257,11 @@
 
         # Apply the Tarjan's algorithm successively until all functions are visited
         visited = set()
-        for function in self.functions.itervalues():
+        for function in self.functions.values():
             if function not in visited:
                 self._tarjan(function, 0, [], {}, {}, visited)
         cycles = []
-        for function in self.functions.itervalues():
+        for function in self.functions.values():
             if function.cycle is not None and function.cycle not in cycles:
                 cycles.append(function.cycle)
         self.cycles = cycles
@@ -284,7 +284,7 @@
         order += 1
         pos = len(stack)
         stack.append(function)
-        for call in function.calls.itervalues():
+        for call in function.calls.values():
             callee = self.functions[call.callee_id]
             # TODO: use a set to optimize lookup
             if callee not in orders:
@@ -308,10 +308,10 @@
         for cycle in self.cycles:
             cycle_totals[cycle] = 0.0
         function_totals = {}
-        for function in self.functions.itervalues():
+        for function in self.functions.values():
             function_totals[function] = 0.0
-        for function in self.functions.itervalues():
-            for call in function.calls.itervalues():
+        for function in self.functions.values():
+            for call in function.calls.values():
                 if call.callee_id != function.id:
                     callee = self.functions[call.callee_id]
                     function_totals[callee] += call[event]
@@ -319,8 +319,8 @@
                         cycle_totals[callee.cycle] += call[event]
 
         # Compute the ratios
-        for function in self.functions.itervalues():
-            for call in function.calls.itervalues():
+        for function in self.functions.values():
+            for call in function.calls.values():
                 assert call.ratio is None
                 if call.callee_id != function.id:
                     callee = self.functions[call.callee_id]
@@ -341,10 +341,10 @@
 
         # Sanity checking
         assert outevent not in self
-        for function in self.functions.itervalues():
+        for function in self.functions.values():
             assert outevent not in function
             assert inevent in function
-            for call in function.calls.itervalues():
+            for call in function.calls.values():
                 assert outevent not in call
                 if call.callee_id != function.id:
                     assert call.ratio is not None
@@ -352,13 +352,13 @@
         # Aggregate the input for each cycle 
         for cycle in self.cycles:
             total = inevent.null()
-            for function in self.functions.itervalues():
+            for function in self.functions.values():
                 total = inevent.aggregate(total, function[inevent])
             self[inevent] = total
 
         # Integrate along the edges
         total = inevent.null()
-        for function in self.functions.itervalues():
+        for function in self.functions.values():
             total = inevent.aggregate(total, function[inevent])
             self._integrate_function(function, outevent, inevent)
         self[outevent] = total
@@ -369,7 +369,7 @@
         else:
             if outevent not in function:
                 total = function[inevent]
-                for call in function.calls.itervalues():
+                for call in function.calls.values():
                     if call.callee_id != function.id:
                         total += self._integrate_call(call, outevent, inevent)
                 function[outevent] = total
@@ -390,7 +390,7 @@
             total = inevent.null()
             for member in cycle.functions:
                 subtotal = member[inevent]
-                for call in member.calls.itervalues():
+                for call in member.calls.values():
                     callee = self.functions[call.callee_id]
                     if callee.cycle is not cycle:
                         subtotal += self._integrate_call(call, outevent, inevent)
@@ -399,9 +399,9 @@
             
             # Compute the time propagated to callers of this cycle
             callees = {}
-            for function in self.functions.itervalues():
+            for function in self.functions.values():
                 if function.cycle is not cycle:
-                    for call in function.calls.itervalues():
+                    for call in function.calls.values():
                         callee = self.functions[call.callee_id]
                         if callee.cycle is cycle:
                             try:
@@ -412,7 +412,7 @@
             for member in cycle.functions:
                 member[outevent] = outevent.null()
 
-            for callee, call_ratio in callees.iteritems():
+            for callee, call_ratio in callees.items():
                 ranks = {}
                 call_ratios = {}
                 partials = {}
@@ -427,7 +427,7 @@
     def _rank_cycle_function(self, cycle, function, rank, ranks):
         if function not in ranks or ranks[function] > rank:
             ranks[function] = rank
-            for call in function.calls.itervalues():
+            for call in function.calls.values():
                 if call.callee_id != function.id:
                     callee = self.functions[call.callee_id]
                     if callee.cycle is cycle:
@@ -436,7 +436,7 @@
     def _call_ratios_cycle(self, cycle, function, ranks, call_ratios, visited):
         if function not in visited:
             visited.add(function)
-            for call in function.calls.itervalues():
+            for call in function.calls.values():
                 if call.callee_id != function.id:
                     callee = self.functions[call.callee_id]
                     if callee.cycle is cycle:
@@ -447,7 +447,7 @@
     def _integrate_cycle_function(self, cycle, function, partial_ratio, partials, ranks, call_ratios, outevent, inevent):
         if function not in partials:
             partial = partial_ratio*function[inevent]
-            for call in function.calls.itervalues():
+            for call in function.calls.values():
                 if call.callee_id != function.id:
                     callee = self.functions[call.callee_id]
                     if callee.cycle is not cycle:
@@ -474,7 +474,7 @@
         """Aggregate an event for the whole profile."""
 
         total = event.null()
-        for function in self.functions.itervalues():
+        for function in self.functions.values():
             try:
                 total = event.aggregate(total, function[event])
             except UndefinedEvent:
@@ -484,11 +484,11 @@
     def ratio(self, outevent, inevent):
         assert outevent not in self
         assert inevent in self
-        for function in self.functions.itervalues():
+        for function in self.functions.values():
             assert outevent not in function
             assert inevent in function
             function[outevent] = ratio(function[inevent], self[inevent])
-            for call in function.calls.itervalues():
+            for call in function.calls.values():
                 assert outevent not in call
                 if inevent in call:
                     call[outevent] = ratio(call[inevent], self[inevent])
@@ -498,13 +498,13 @@
         """Prune the profile"""
 
         # compute the prune ratios
-        for function in self.functions.itervalues():
+        for function in self.functions.values():
             try:
                 function.weight = function[TOTAL_TIME_RATIO]
             except UndefinedEvent:
                 pass
 
-            for call in function.calls.itervalues():
+            for call in function.calls.values():
                 callee = self.functions[call.callee_id]
 
                 if TOTAL_TIME_RATIO in call:
@@ -518,24 +518,24 @@
                         pass
 
         # prune the nodes
-        for function_id in self.functions.keys():
+        for function_id in list(self.functions.keys()):
             function = self.functions[function_id]
             if function.weight is not None:
                 if function.weight < node_thres:
                     del self.functions[function_id]
 
         # prune the egdes
-        for function in self.functions.itervalues():
-            for callee_id in function.calls.keys():
+        for function in self.functions.values():
+            for callee_id in list(function.calls.keys()):
                 call = function.calls[callee_id]
                 if callee_id not in self.functions or call.weight is not None and call.weight < edge_thres:
                     del function.calls[callee_id]
     
     def dump(self):
-        for function in self.functions.itervalues():
+        for function in self.functions.values():
             sys.stderr.write('Function %s:\n' % (function.name,))
             self._dump_events(function.events)
-            for call in function.calls.itervalues():
+            for call in function.calls.values():
                 callee = self.functions[call.callee_id]
                 sys.stderr.write('  Call %s:\n' % (callee.name,))
                 self._dump_events(call.events)
@@ -546,7 +546,7 @@
                 sys.stderr.write('  Function %s\n' % (function.name,))
 
     def _dump_events(self, events):
-        for event, value in events.iteritems():
+        for event, value in events.items():
             sys.stderr.write('    %s: %s\n' % (event.name, event.format(value)))
 
 
@@ -630,7 +630,7 @@
         return self.__eof
 
 
-XML_ELEMENT_START, XML_ELEMENT_END, XML_CHARACTER_DATA, XML_EOF = range(4)
+XML_ELEMENT_START, XML_ELEMENT_END, XML_CHARACTER_DATA, XML_EOF = list(range(4))
 
 
 class XmlToken:
@@ -698,7 +698,7 @@
                 self.tokens.append(token)
             self.character_data = ''
     
-    def next(self):
+    def __next__(self):
         size = 16*1024
         while self.index >= len(self.tokens) and not self.final:
             self.tokens = []
@@ -707,7 +707,7 @@
             self.final = len(data) < size
             try:
                 self.parser.Parse(data, self.final)
-            except xml.parsers.expat.ExpatError, e:
+            except xml.parsers.expat.ExpatError as e:
                 #if e.code == xml.parsers.expat.errors.XML_ERROR_NO_ELEMENTS:
                 if e.code == 3:
                     pass
@@ -744,7 +744,7 @@
         self.consume()
     
     def consume(self):
-        self.token = self.tokenizer.next()
+        self.token = next(self.tokenizer)
 
     def match_element_start(self, name):
         return self.token.type == XML_ELEMENT_START and self.token.name_or_data == name
@@ -813,7 +813,7 @@
         """Extract a structure from a match object, while translating the types in the process."""
         attrs = {}
         groupdict = mo.groupdict()
-        for name, value in groupdict.iteritems():
+        for name, value in groupdict.items():
             if value is None:
                 value = None
             elif self._int_re.match(value):
@@ -986,10 +986,10 @@
         profile[TIME] = 0.0
         
         cycles = {}
-        for index in self.cycles.iterkeys():
+        for index in self.cycles.keys():
             cycles[index] = Cycle()
 
-        for entry in self.functions.itervalues():
+        for entry in self.functions.values():
             # populate the function
             function = Function(entry.index, entry.name)
             function[TIME] = entry.self
@@ -1031,7 +1031,7 @@
 
             profile[TIME] = profile[TIME] + function[TIME]
 
-        for cycle in cycles.itervalues():
+        for cycle in cycles.values():
             profile.add_cycle(cycle)
 
         # Compute derived events
@@ -1185,7 +1185,7 @@
                 position = int(position)
             self.last_positions[i] = position
 
-        events = map(float, events)
+        events = list(map(float, events))
 
         if calls is None:
             function[SAMPLES] += events[0] 
@@ -1382,7 +1382,7 @@
             self.update_subentries_dict(callees_total, callees)
     
     def update_subentries_dict(self, totals, partials):
-        for partial in partials.itervalues():
+        for partial in partials.values():
             try:
                 total = totals[partial.id]
             except KeyError:
@@ -1404,7 +1404,7 @@
         
         # populate the profile
         profile[SAMPLES] = 0
-        for _callers, _function, _callees in self.entries.itervalues():
+        for _callers, _function, _callees in self.entries.values():
             function = Function(_function.id, _function.name)
             function[SAMPLES] = _function.samples
             profile.add_function(function)
@@ -1416,10 +1416,10 @@
                 function.module = os.path.basename(_function.image)
 
             total_callee_samples = 0
-            for _callee in _callees.itervalues():
+            for _callee in _callees.values():
                 total_callee_samples += _callee.samples
 
-            for _callee in _callees.itervalues():
+            for _callee in _callees.values():
                 if not _callee.self:
                     call = Call(_callee.id)
                     call[SAMPLES2] = _callee.samples
@@ -1552,7 +1552,7 @@
         functions = {}
 
         # build up callgraph
-        for id, trace in self.traces.iteritems():
+        for id, trace in self.traces.items():
             if not id in self.samples: continue
             mtime = self.samples[id][0]
             last = None
@@ -1681,7 +1681,7 @@
         profile = Profile()
         
         profile[SAMPLES] = 0
-        for id, object in objects.iteritems():
+        for id, object in objects.items():
             # Ignore fake objects (process names, modules, "Everything", "kernel", etc.)
             if object['self'] == 0:
                 continue
@@ -1691,7 +1691,7 @@
             profile.add_function(function)
             profile[SAMPLES] += function[SAMPLES]
 
-        for id, node in nodes.iteritems():
+        for id, node in nodes.items():
             # Ignore fake calls
             if node['self'] == 0:
                 continue
@@ -1805,7 +1805,7 @@
                 
         profile = Profile()
         profile[SAMPLES] = 0
-        for _function, _callees in self.entries.itervalues():
+        for _function, _callees in self.entries.values():
             function = Function(_function.id, _function.name)
             function[SAMPLES] = _function.samples
             profile.add_function(function)
@@ -1814,7 +1814,7 @@
             if _function.image:
                 function.module = os.path.basename(_function.image)
 
-            for _callee in _callees.itervalues():
+            for _callee in _callees.values():
                 call = Call(_callee.id)
                 call[SAMPLES] = _callee.samples
                 function.add_call(call)
@@ -1852,7 +1852,7 @@
             lineterminator = '\r\n',
             quoting = csv.QUOTE_NONE)
         it = iter(reader)
-        row = reader.next()
+        row = next(reader)
         self.parse_header(row)
         for row in it:
             self.parse_row(row)
@@ -1874,7 +1874,7 @@
 
     def parse_row(self, row):
         fields = {}
-        for name, column in self.column.iteritems():
+        for name, column in self.column.items():
             value = row[column]
             for factory in int, float:
                 try:
@@ -2201,7 +2201,8 @@
         self.profile = Profile()
         self.function_ids = {}
 
-    def get_function_name(self, (filename, line, name)):
+    def get_function_name(self, xxx_todo_changeme):
+        (filename, line, name) = xxx_todo_changeme
         module = os.path.splitext(filename)[0]
         module = os.path.basename(module)
         return "%s:%d:%s" % (module, line, name)
@@ -2222,18 +2223,18 @@
     def parse(self):
         self.profile[TIME] = 0.0
         self.profile[TOTAL_TIME] = self.stats.total_tt
-        for fn, (cc, nc, tt, ct, callers) in self.stats.stats.iteritems():
+        for fn, (cc, nc, tt, ct, callers) in self.stats.stats.items():
             callee = self.get_function(fn)
             callee.called = nc
             callee[TOTAL_TIME] = ct
             callee[TIME] = tt
             self.profile[TIME] += tt
             self.profile[TOTAL_TIME] = max(self.profile[TOTAL_TIME], ct)
-            for fn, value in callers.iteritems():
+            for fn, value in callers.items():
                 caller = self.get_function(fn)
                 call = Call(callee.id)
                 if isinstance(value, tuple):
-                    for i in xrange(0, len(value), 4):
+                    for i in range(0, len(value), 4):
                         nc, cc, tt, ct = value[i:i+4]
                         if CALLS in call:
                             call[CALLS] += cc
@@ -2426,7 +2427,7 @@
         self.attr('node', fontname=fontname, shape="box", style="filled", fontcolor="white", width=0, height=0)
         self.attr('edge', fontname=fontname)
 
-        for function in profile.functions.itervalues():
+        for function in profile.functions.values():
             labels = []
             if function.process is not None:
                 labels.append(function.process)
@@ -2438,7 +2439,7 @@
                     label = event.format(function[event])
                     labels.append(label)
             if function.called is not None:
-                labels.append(u"%u\xd7" % (function.called,))
+                labels.append("%u\xd7" % (function.called,))
 
             if function.weight is not None:
                 weight = function.weight
@@ -2453,7 +2454,7 @@
                 fontsize = "%.2f" % theme.node_fontsize(weight),
             )
 
-            for call in function.calls.itervalues():
+            for call in function.calls.values():
                 callee = profile.functions[call.callee_id]
 
                 labels = []
@@ -2514,7 +2515,7 @@
             return
         self.write(' [')
         first = True
-        for name, value in attrs.iteritems():
+        for name, value in attrs.items():
             if first:
                 first = False
             else:
@@ -2527,7 +2528,7 @@
     def id(self, id):
         if isinstance(id, (int, float)):
             s = str(id)
-        elif isinstance(id, basestring):
+        elif isinstance(id, str):
             if id.isalnum() and not id.startswith('0x'):
                 s = id
             else:
@@ -2536,8 +2537,9 @@
             raise TypeError
         self.write(s)
 
-    def color(self, (r, g, b)):
+    def color(self, xxx_todo_changeme1):
 
+        (r, g, b) = xxx_todo_changeme1
         def float2int(f):
             if f <= 0.0:
                 return 0
@@ -2753,7 +2755,7 @@
         profile = self.profile
         profile.prune(self.options.node_thres/100.0, self.options.edge_thres/100.0)
 
-        for function in profile.functions.itervalues():
+        for function in profile.functions.values():
             function.name = self.compress_function_name(function.name)
 
         dot.graph(profile, self.theme)
--- a/setup/install.perl
+++ b/setup/install.perl
@@ -880,7 +880,7 @@
 
     if ($HAVE{PYTHON}) {
         chdir "$Bin/.." or die "cannot cd '$Bin/..'";
-        my $cmd = "python setup.py install";
+        my $cmd = "python3 setup.py install";
         $cmd .= ' --user' unless (linux_root());
         print `$cmd`;
         if ($?) {
--- a/test/dbgap-mount/py/test/__init__.py
+++ b/test/dbgap-mount/py/test/__init__.py
@@ -2,6 +2,6 @@
 #
 
 
-from base import *
-from test import *
-from utils import *
+from .base import *
+from .test import *
+from .utils import *
--- a/test/dbgap-mount/py/test/test.py
+++ b/test/dbgap-mount/py/test/test.py
@@ -5,8 +5,8 @@
 import gc
 
 import platform
-import base
-import utils
+from . import base
+from . import utils
 
 class Test ( base.Base ):
 
--- a/test/samline/bx_tag_test.py
+++ b/test/samline/bx_tag_test.py
@@ -1,4 +1,4 @@
-#!/opt/python-all/bin/python
+#!/usr/bin/python3
 from sam import *
 
 REF   = "NC_011752.1"
@@ -7,7 +7,7 @@
 
 def load( L ) :
     R1 = bam_load( L, CSRA1, "--make-spots-with-secondary -E0 -Q0" )
-    print "bam-load = %d"%( R1 )
+    print("bam-load = %d"%( R1 ))
 
 def load_and_print( L ) :
     load( L )
--- a/test/samline/ca_test.py
+++ b/test/samline/ca_test.py
@@ -1,12 +1,12 @@
-#!/opt/python-all/bin/python
+#!/usr/bin/python3
 from sam import *
 
 def dump( acc ) :
-    print "%s.SEQ"%(acc)
+    print("%s.SEQ"%(acc))
     vdb_dump( acc, "-C SPOT_ID,READ -l0 -f tab" )
-    print "%s.PRIM"%( acc )
+    print("%s.PRIM"%( acc ))
     vdb_dump( acc, "-T PRIMARY_ALIGNMENT -C ALIGN_ID,READ -l0, -f tab" )
-    print "%s.SEC"%( acc )
+    print("%s.SEC"%( acc ))
     vdb_dump( acc, "-T SECONDARY_ALIGNMENT -C ALIGN_ID,READ -l0 -f tab" )
 
 REF   = "NC_011752.1"
@@ -17,14 +17,14 @@
 def load_sort( L ) :
     R1 = bam_load( L, CSRA1, "--make-spots-with-secondary -L 3 -E0 -Q0" )
     if R1 == 1 :
-        print "bam-load = OK"
+        print("bam-load = OK")
         R2 = sra_sort( CSRA1, CSRA2 )
         if R2 == 1 :
-            print "sra-sort = OK"
+            print("sra-sort = OK")
         else :
-            print "sra-sort = FAILED"
+            print("sra-sort = FAILED")
     else :
-        print "bam-load = FAILED"
+        print("bam-load = FAILED")
         
 def load_sort_print( L ) :
     load_sort( L )
@@ -33,8 +33,8 @@
 
 
 def test1() :
-    print "test #1 --------------------------------------------------"
-    print "...having a single recondary alignmnet without a primary it belongs to"
+    print("test #1 --------------------------------------------------")
+    print("...having a single recondary alignmnet without a primary it belongs to")
     A1 = make_prim( "A1", 0, REF, ALIAS, 17000, 20, "60M" )
     A2 = make_prim( "A2", 0, REF, ALIAS, 12500, 20, "50M" )
     A1.pair_with( A2 )
@@ -51,9 +51,9 @@
 
 # the resulting X.CSRA and S.CSRA produce errors in seq_restore_read_impl2
 def test2() :
-    print "test #2 --------------------------------------------------"
-    print "...having a pair of a prim. and a sec. alignment"
-    print "= SEQUENCE-table cannot reconstruct READ"
+    print("test #2 --------------------------------------------------")
+    print("...having a pair of a prim. and a sec. alignment")
+    print("= SEQUENCE-table cannot reconstruct READ")
     A1 = make_prim( "A1", 0, REF, ALIAS, 17000, 20, "60M" )
     A2 = make_sec( "A2", 0, REF, ALIAS, 12500, 20, "50M" )
     A1.pair_with( A2 )
@@ -63,7 +63,7 @@
 # the resulting X.CSRA produces errors in seq_restore_read_impl2
 # but S.CSRA sefaults in vdb-dump!
 def test3() :
-    print "test #3 --------------------------------------------------"
+    print("test #3 --------------------------------------------------")
     A1 = make_prim( "A1", 0, REF, ALIAS, 1000, 20, "53M" )
     A2 = make_sec( "A2", 0, REF, ALIAS, 3500, 20, "50M" )
     A1.pair_with( A2 )
--- a/test/samline/sam.py
+++ b/test/samline/sam.py
@@ -58,11 +58,11 @@
 def print_file( filename ) :
     s = load_file( filename )
     if len( s ) > 0 :
-        print s
+        print(s)
 
 def print_txt( txt ) :
     if len( txt ) > 0 :
-        print txt
+        print(txt)
 
 def print_txt_list( list ) :
     for a in list :
@@ -144,7 +144,7 @@
     try :
         cmd = "vdb-dump %s %s"%( accession, params )
         txt = subprocess.check_output( cmd, stderr=subprocess.STDOUT, shell=True )
-        print txt
+        print(txt)
         return 1
     except :
         pass
@@ -154,7 +154,7 @@
     try :
         cmd = "sam-dump %s %s"%( accession, params )
         txt = subprocess.check_output( cmd, stderr=subprocess.STDOUT, shell=True )
-        print txt
+        print(txt)
         return 1
     except :
         pass
@@ -218,7 +218,7 @@
 def extract_headers( list ) :
     reflist = make_refdict( list )
     res = [ "@HD\tVN:1.3" ]
-    for k, v in reflist.items():
+    for k, v in list(reflist.items()):
         l = ref_len( v )
         res.append( "@SQ\tSN:%s\tAS:%s\tLN:%d"%( k, k, l ) )
     return res
@@ -231,7 +231,7 @@
 def produce_config( list ) :
     reflist = make_refdict( list )
     res = []
-    for k, v in reflist.items():
+    for k, v in list(reflist.items()):
         if k != "*" and k != "-" :
             res.append( "%s\t%s"%( k, v ) )
     return res
@@ -250,9 +250,9 @@
 ---------------------------------------------------------------'''
 def print_sam( list ):
     for s in extract_headers( list ) :
-        print s
+        print(s)
     for s in list :
-        print s
+        print(s)
 
 '''---------------------------------------------------------------
 helper function: save a list of SAM-objects as file
--- a/test/sra-pileup/check_skiplist.py
+++ b/test/sra-pileup/check_skiplist.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 import subprocess
 import sys
--- a/test/sra-pileup/test_all_sam_dump_has_spotgroup.py
+++ b/test/sra-pileup/test_all_sam_dump_has_spotgroup.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 import sys, getopt, subprocess, multiprocessing
 
--- a/test/sra-pileup/test_diff_fastq_dump_vs_sam_dump.py
+++ b/test/sra-pileup/test_diff_fastq_dump_vs_sam_dump.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
 
 import sys, getopt, subprocess, multiprocessing
 
--- a/test/tarballs/test-tarballs.sh
+++ b/test/tarballs/test-tarballs.sh
@@ -55,7 +55,7 @@
 
 case $(uname) in
 Linux)
-    python -mplatform | grep -q Ubuntu && OS=ubuntu64 || OS=centos_linux64
+    python3 -mplatform | grep -q Ubuntu && OS=ubuntu64 || OS=centos_linux64
     TOOLS="${TOOLS} pacbio-load remote-fuser"
     realpath() {
         readlink -f $1
--- a/tools/fasterq-dump/fastq-diff.py
+++ b/tools/fasterq-dump/fastq-diff.py
@@ -1,10 +1,10 @@
-#! /usr/bin/env python
+#!/usr/bin/python3
 
 import sys
 import os
 import stat
 import datetime
-from itertools import izip
+
 
 def perform( fn1, fn2 ) :
     print( "comparing: " )
@@ -14,7 +14,7 @@
     A = [ "", "", "", "" ]
     B = [ "", "", "", "" ]
     with open( fn1 ) as f1, open( fn2 ) as f2 :
-        for L1, L2 in izip( f1, f2 ) :
+        for L1, L2 in zip( f1, f2 ) :
             A[ ln ] = L1.strip()
             B[ ln ] = L2.strip()
             ln += 1
