I am a developer of a large graphical application and we have a website for tracking bugs. Anyone can post a new bug to the bug tracking site. We can detect certain crashes in our desktop application (that is, an unhandled exception), and in such cases we would like to open the submit-new-bug form in a user-predefined browser, adding any information that we can collect about the crash to some form fields , We can either get the submit-new-bug form using the GET or POST http methods, and we can provide default field values ββfor this form. So on the http server side, everything is fine.
So far, we can successfully open the URL by passing the default values ββas GET parameters to the URL using the webbrowser module from the Python standard library. However, there are some limitations to this method, such as the maximum allowable URL length for some browsers ( especially MS IE ). The webbrowser module does not seem to have a way to request a URL using POST. OTOH is the urllib2 module which provides the urllib2 type of control, but AFAIK does not allow the user to open the resulting page in urllib2 .
Is there any way to get this mixed behavior we want (to have precise control over urllib2 with higher level webbrowser )?
PS: We thought about the possibility of retreiving by URL with urllib2 , saving its contents to a temporary file and opening the file with webbrowser - webbrowser . This is a slightly unpleasant solution, in which case we will have to deal with other issues, such as relative URLs. Is there a better solution?
source share