This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients cheryl.sabella, terry.reedy
Date 2018-12-28.06:10:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1545977442.44.0.762176637903.issue35591@roundup.psfhosted.org>
In-reply-to
Content
Thanks for reporting this.  It is easy to trigger.  And after a bit of analysis, easy to fix.

self.bell is set as top.bell in searchbase.SearchDialogBase.create_widgets().  The latter is called by SDB.open(), which is called for Find, Find-again if there is no previously defined pattern, and Find-in-files.  It is not called by Find-selection as it uses the selection as the pattern.

The bell only sounds if the selection is not found anywhere else in the editor.
                if selfirst == first and sellast == last:
                    self.bell()
If the selection is found elsewhere, the copy is then tagged with the selection tag, so when the original is found, the condition is not true.  I consider it a bug that the selection tag is used instead of the 'found' tag, but the above depends on it being moved.

The purpose of creating and calling self.bell instead of top.bell is so bell can be mocked when testing, both to detect the call and suppress noise when testing.  Binding self.bell to root.bell in __init__ instead of to top.bell in create_widgets should work fine.
History
Date User Action Args
2018-12-28 06:10:44terry.reedysetrecipients: + terry.reedy, cheryl.sabella
2018-12-28 06:10:42terry.reedysetmessageid: <1545977442.44.0.762176637903.issue35591@roundup.psfhosted.org>
2018-12-28 06:10:42terry.reedylinkissue35591 messages
2018-12-28 06:10:42terry.reedycreate