Open abielr opened 12 years ago
Please merge, this is required by musicbrainz-bot (https://github.com/murdos/musicbrainz-bot)
Also having a similar problem. Buttons outside of a form inspected by #select_form
are causing errors to be raised.
@jammus Sadly, it's clear by now that Mechanize for Python is not being maintained. This probably won't be fixed unless someone else steps up to the plate. Meanwhile here's a monkey-patch fix that you can use: https://stackoverflow.com/a/15188268
@intgr That's really sad, mechanize "was" good project.Well atleast that fixed mine problem for now
Thank you for your contribution to mechanize!
Following the process in #117, future work on mechanize will be occurring here: https://github.com/python-mechanize/mechanize.
Please re-file your PR there (where it will get attention, and hopefully merged)
Stop mechanize from crashing with an AttributeError when attempting to select a form a SubmitControl that has no value and is also disabled.
When mechanize encounters a SubmitControl with no value (such as an ImageControl) it attempts to set the value to a blank string. This fails if the control is disabled (mechanize raises an AttributeError). This patch temporarily sets disabled to False in this situation and then immediately resets it to True after the blank string has been assigned to value.