From 5e9620198c2754f2cc0c0a97519837b15ee9af3f Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 2 May 2011 18:18:04 +0000 Subject: [PATCH] fix for a privately reported bug ("AttributeError: item is disabled") --- lib/core/option.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/core/option.py b/lib/core/option.py index f9d5f7e03..7034fc671 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -465,7 +465,11 @@ def __findPageForms(): for form in forms: for control in form.controls: if hasattr(control, 'items'): - control.items[0].selected = True + # if control has selectable items select first non-disabled + for item in control.items: + if not item.disabled: + item.selected = True + break request = form.click() url = urldecode(request.get_full_url(), kb.pageEncoding) method = request.get_method()