From: Raymond Hettinger Date: Mon, 21 Jul 2014 04:26:04 +0000 (-0700) Subject: Issue #21868: Prevent turtle crash due to invalid undo buffer size. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b606d45fb26d38ba00b06a4349fd05172ba9e12c;p=python Issue #21868: Prevent turtle crash due to invalid undo buffer size. --- diff --git a/Lib/lib-tk/turtle.py b/Lib/lib-tk/turtle.py index 6a9071594f..75673a4bcb 100644 --- a/Lib/lib-tk/turtle.py +++ b/Lib/lib-tk/turtle.py @@ -2499,7 +2499,7 @@ class RawTurtle(TPen, TNavigator): Example (for a Turtle instance named turtle): >>> turtle.setundobuffer(42) """ - if size is None: + if size is None or size <= 0: self.undobuffer = None else: self.undobuffer = Tbuffer(size) diff --git a/Misc/ACKS b/Misc/ACKS index 27be9493f0..2dc0e779dd 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -235,6 +235,7 @@ Ingrid Cheung Albert Chin-A-Young Adal Chiriliuc Matt Chisholm +Lita Cho Anders Chrigström Tom Christiansen Renee Chu diff --git a/Misc/NEWS b/Misc/NEWS index 9ba62e8780..0181a4614e 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -16,6 +16,9 @@ Library - Issue #22017: Correct reference counting errror in the initialization of the _warnings module. +- Issue #21868: Prevent turtle crash when undo buffer set to a value less + than one. + - Issue #21044: tarfile.open() now handles fileobj with an integer 'name' attribute. Based on patch by Martin Panter.