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-Tag: v2.7.9rc1~359 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b606d45fb26d38ba00b06a4349fd05172ba9e12c;p=thirdparty%2FPython%2Fcpython.git 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 6a9071594fb3..75673a4bcb81 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 27be9493f08c..2dc0e779ddba 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 9ba62e878069..0181a4614ee3 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.