Fix for disabled SubmitControl objects with no value#58
Conversation
… form with 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. 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.
|
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 |
|
@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. |
|
@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: 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.