os.path usage and printing to stdout instead of stderr