May-31-2018, 08:07 AM
It is because you are creating a new list items in the process method and iterate over all of that items. Change the method to:
def process(item): print "Sleeping 2 sec from thread %s \n" % item time.sleep(1) #i=len(items) print "Finished sleeping from thread %s \n" % item try: base_path = '/ai2/data/dev/admin/inf/*{}*' search_path = base_path.format(item) for f in glob.glob(search_path): print ("The directory path is:") print f except: print('error with pattern')