Backed out r65069, pending fixing it in Windows.
diff --git a/Objects/stringlib/formatter.h b/Objects/stringlib/formatter.h
index d8cb171..b964435 100644
--- a/Objects/stringlib/formatter.h
+++ b/Objects/stringlib/formatter.h
@@ -741,6 +741,10 @@
     /* first, do the conversion as 8-bit chars, using the platform's
        snprintf.  then, if needed, convert to unicode. */
 
+    /* 'F' is the same as 'f', per the PEP */
+    if (type == 'F')
+        type = 'f';
+
     x = PyFloat_AsDouble(value);
 
     if (x == -1.0 && PyErr_Occurred())
@@ -754,12 +758,8 @@
 
     if (precision < 0)
         precision = 6;
-    if ((type == 'f' || type == 'F') && (fabs(x) / 1e25) >= 1e25) {
-	if (type == 'f')
-	    type = 'g';
-	else
-	    type = 'G';
-    }
+    if (type == 'f' && (fabs(x) / 1e25) >= 1e25)
+        type = 'g';
 
     /* cast "type", because if we're in unicode we need to pass a
        8-bit char.  this is safe, because we've restricted what "type"
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index b161c8c..793cc88 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -4320,12 +4320,8 @@
 	}
 	if (prec < 0)
 		prec = 6;
-	if ((type == 'f' || type == 'F') && (fabs(x) / 1e25) >= 1e25) {
-		if (type == 'f')
-			type = 'g';
-		else
-			type = 'G';
-	}
+	if (type == 'f' && fabs(x)/1e25 >= 1e25)
+		type = 'g';
 	/* Worst case length calc to ensure no buffer overrun:
 
 	   'g' formats:
@@ -4344,8 +4340,7 @@
 	*/
 	if (((type == 'g' || type == 'G') &&
               buflen <= (size_t)10 + (size_t)prec) ||
-	    ((type == 'f' || type == 'F') &&
-	      buflen <= (size_t)53 + (size_t)prec)) {
+	    (type == 'f' && buflen <= (size_t)53 + (size_t)prec)) {
 		PyErr_SetString(PyExc_OverflowError,
 			"formatted float is too long (precision too large?)");
 		return -1;
@@ -4915,6 +4910,8 @@
 			case 'F':
 			case 'g':
 			case 'G':
+				if (c == 'F')
+					c = 'f';
 				pbuf = formatbuf;
 				len = formatfloat(pbuf, sizeof(formatbuf),
 						  flags, prec, c, v);
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index a885ff0..a62e929 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -8191,12 +8191,8 @@
 	return -1;
     if (prec < 0)
 	prec = 6;
-    if ((type == 'f' || type == 'F') && (fabs(x) / 1e25) >= 1e25) {
-        if (type == 'f')
-            type = 'g';
-        else
-            type = 'G';
-    }
+    if (type == 'f' && (fabs(x) / 1e25) >= 1e25)
+	type = 'g';
     /* Worst case length calc to ensure no buffer overrun:
 
        'g' formats:
@@ -8215,8 +8211,7 @@
     */
     if (((type == 'g' || type == 'G') && 
           buflen <= (size_t)10 + (size_t)prec) ||
-	((type == 'f' || type == 'F')  &&
-          buflen <= (size_t)53 + (size_t)prec)) {
+	(type == 'f' && buflen <= (size_t)53 + (size_t)prec)) {
 	PyErr_SetString(PyExc_OverflowError,
 			"formatted float is too long (precision too large?)");
 	return -1;
@@ -8709,6 +8704,8 @@
 	    case 'F':
 	    case 'g':
 	    case 'G':
+		if (c == 'F')
+			c = 'f';
 		pbuf = formatbuf;
 		len = formatfloat(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE),
 			flags, prec, c, v);