[Python-checkins] cpython (2.7): Issue #21868: Prevent turtle crash due to invalid undo buffer size.
raymond.hettinger
python-checkins at python.org
Mon Jul 21 06:26:14 CEST 2014
http://hg.python.org/cpython/rev/847a0e74c4cc
changeset: 91739:847a0e74c4cc
branch: 2.7
parent: 91736:393bf4d748d4
user: Raymond Hettinger <python at rcn.com>
date: Sun Jul 20 21:26:04 2014 -0700
summary:
Issue #21868: Prevent turtle crash due to invalid undo buffer size.
files:
Lib/lib-tk/turtle.py | 2 +-
Misc/ACKS | 1 +
Misc/NEWS | 3 +++
3 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/Lib/lib-tk/turtle.py b/Lib/lib-tk/turtle.py
--- a/Lib/lib-tk/turtle.py
+++ b/Lib/lib-tk/turtle.py
@@ -2499,7 +2499,7 @@
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
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -235,6 +235,7 @@
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
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -16,6 +16,9 @@
- 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.
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list