[Reportbug-maint] Bug#535789: reportbug crash when trying to detach a not attached file

Rodrigo Campos rodrigo at sdfg.com.ar
Sat Jul 11 17:17:26 UTC 2009

I like more the fix that lets you change your mind and not detach anything
also :)

Sorry, but I have one question about the fix you did. You used:

	if filetodetach != '' and filetodetach in attachments

to avoid the crash.

But if I'm not wrong "filetodetach == ''" could not happend (because if the user
click 'enter', filetodetach is None, so perhaps the check should be if its
different to None) and even if it happens, its not in the list (nor
None or ''), so it will fail the other check (filetodetach in attachments).

Also, if you forget about context and just think "What do I need to know if I
want to safely remove an element from a list ?", you need to know that the
element is in the list, if it is, you can safely remove it. So that is all you
need to check (you can have other check to give a better error, but the ui.menu
function is doing that already if I'm not wrong).

So that "if filetodetach != ''" check is not needed (again, if I'm not wrong :).

PS: sorry for not repliying your mail, I don't know why the BTS didn't email me
this, I thought it would email me any answer to a bug I have reported.



More information about the Reportbug-maint mailing list