]> granicus.if.org Git - python/commitdiff
(Merge 3.2) Issue #13913: normalize utf-8 codec name in UTF-8 decoder
authorVictor Stinner <victor.stinner@haypocalc.com>
Tue, 14 Feb 2012 00:18:10 +0000 (01:18 +0100)
committerVictor Stinner <victor.stinner@haypocalc.com>
Tue, 14 Feb 2012 00:18:10 +0000 (01:18 +0100)
1  2 
Objects/unicodeobject.c

index 67336bf9f19b7201749c866f041f11ac7ad253cd,70856f54552c2510685cbcd9cfd945b84148c98f..07d3eb85696194f288c1b54f7bc0159aa1d87f08
@@@ -4792,14 -2760,13 +4792,14 @@@ decode_utf8_errors(const char *starts
          continue;
  
        utf8Error:
 -        outpos = p-PyUnicode_AS_UNICODE(unicode);
          if (unicode_decode_call_errorhandler(
                  errors, &errorHandler,
-                 "utf8", errmsg,
+                 "utf-8", errmsg,
                  &starts, &e, &startinpos, &endinpos, &exc, &s,
 -                &unicode, &outpos, &p))
 +                &unicode, &i))
              goto onError;
 +        /* Update data because unicode_decode_call_errorhandler might have
 +           re-created or resized the unicode object. */
          aligned_end = (const char *) ((size_t) e & ~LONG_PTR_MASK);
      }
      if (consumed)