Browsing: error handling in Python