SF #726446: raise ValueError if width <= 0.
diff --git a/Lib/textwrap.py b/Lib/textwrap.py
index 03fcbc0..fdb95d7 100644
--- a/Lib/textwrap.py
+++ b/Lib/textwrap.py
@@ -197,6 +197,8 @@
         lines, but apart from that whitespace is preserved.
         """
         lines = []
+        if self.width <= 0:
+            raise ValueError("invalid width %r (must be > 0)" % self.width)
 
         while chunks: