apart from IOError as e: if e.errno == errno.EACCES: return "some default information" # Not a authorization mistake. elevateHaving said that, if you want to utilize the made collection a number of situations Later on, It truly is advisable to develop an explicit listing in the first place. Have a look at my update, It is really now a little better