"ib" should be "boundary"; reported by Neal Norwitz.
diff --git a/Lib/cgi.py b/Lib/cgi.py
index 19304af..9ad6758 100755
--- a/Lib/cgi.py
+++ b/Lib/cgi.py
@@ -248,7 +248,7 @@
         boundary = pdict['boundary']
     if not valid_boundary(boundary):
         raise ValueError,  ('Invalid boundary in multipart form: %s'
-                            % `ib`)
+                            % `boundary`)
 
     nextpart = "--" + boundary
     lastpart = "--" + boundary + "--"