summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2014-07-21 04:26:04 (GMT)
committerRaymond Hettinger <python@rcn.com>2014-07-21 04:26:04 (GMT)
commitb606d45fb26d38ba00b06a4349fd05172ba9e12c (patch)
tree14a4b625b8f5f4b7830260a620bf869f6e5c8256
parente2d1e64a1ffd04a274e911c53fd9ee00a4943f6c (diff)
downloadcpython-b606d45fb26d38ba00b06a4349fd05172ba9e12c.zip
cpython-b606d45fb26d38ba00b06a4349fd05172ba9e12c.tar.gz
cpython-b606d45fb26d38ba00b06a4349fd05172ba9e12c.tar.bz2
Issue #21868: Prevent turtle crash due to invalid undo buffer size.
-rw-r--r--Lib/lib-tk/turtle.py2
-rw-r--r--Misc/ACKS1
-rw-r--r--Misc/NEWS3
3 files changed, 5 insertions, 1 deletions
diff --git a/Lib/lib-tk/turtle.py b/Lib/lib-tk/turtle.py
index 6a90715..75673a4 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 27be949..2dc0e77 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 9ba62e8..0181a46 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.