Thank you for your previous responses. I am still having this difficulty: >>> filename = os.path.join(os.getcwd(), os.listdir(os.getcwd())[0]) >>> filename 'd:\\tmp2\\???????' >>> os.path.isfile(filename) 0 The file, 'd:\\tmp2\\???????', is a text file which I created for testing this problem. Any ideas why os.path.isfile function does not recognize this file?