summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2007-08-17 16:23:21 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2007-08-17 16:23:21 (GMT)
commit19e62387b9bd70fb4f3212db55872454f903229e (patch)
tree20bac6c465ef21215733e99a08cdce04cd364ef7
parent8d991ed2e1bbb2b4f25d01eae82c5123c168aa6d (diff)
downloadcpython-19e62387b9bd70fb4f3212db55872454f903229e.zip
cpython-19e62387b9bd70fb4f3212db55872454f903229e.tar.gz
cpython-19e62387b9bd70fb4f3212db55872454f903229e.tar.bz2
Fix stupid typo in Lib/encodings/utf_32.py which led to failing tests
on big endian machines. Update documentation: UTF-32 codecs will be in 2.6.
-rw-r--r--Doc/c-api/concrete.rst9
-rw-r--r--Lib/encodings/utf_32.py2
2 files changed, 8 insertions, 3 deletions
diff --git a/Doc/c-api/concrete.rst b/Doc/c-api/concrete.rst
index eda56a5..f4472a7 100644
--- a/Doc/c-api/concrete.rst
+++ b/Doc/c-api/concrete.rst
@@ -1434,7 +1434,7 @@ These are the UTF-32 codec APIs:
Return *NULL* if an exception was raised by the codec.
- .. versionadded:: 3.0
+ .. versionadded:: 2.6
.. cfunction:: PyObject* PyUnicode_DecodeUTF32Stateful(const char *s, Py_ssize_t size, const char *errors, int *byteorder, Py_ssize_t *consumed)
@@ -1445,7 +1445,7 @@ These are the UTF-32 codec APIs:
by four) as an error. Those bytes will not be decoded and the number of bytes
that have been decoded will be stored in *consumed*.
- .. versionadded:: 3.0
+ .. versionadded:: 2.6
.. cfunction:: PyObject* PyUnicode_EncodeUTF32(const Py_UNICODE *s, Py_ssize_t size, const char *errors, int byteorder)
@@ -1466,6 +1466,8 @@ These are the UTF-32 codec APIs:
Return *NULL* if an exception was raised by the codec.
+ .. versionadded:: 2.6
+
.. cfunction:: PyObject* PyUnicode_AsUTF32String(PyObject *unicode)
@@ -1473,6 +1475,9 @@ These are the UTF-32 codec APIs:
string always starts with a BOM mark. Error handling is "strict". Return
*NULL* if an exception was raised by the codec.
+ .. versionadded:: 2.6
+
+
These are the UTF-16 codec APIs:
.. % --- UTF-16 Codecs ------------------------------------------------------ */
diff --git a/Lib/encodings/utf_32.py b/Lib/encodings/utf_32.py
index 622f84b..4bbd22a 100644
--- a/Lib/encodings/utf_32.py
+++ b/Lib/encodings/utf_32.py
@@ -125,7 +125,7 @@ class StreamReader(codecs.StreamReader):
if byteorder == -1:
self.decode = codecs.utf_32_le_decode
elif byteorder == 1:
- self.decode = codecs.utf_32_le_decode
+ self.decode = codecs.utf_32_be_decode
elif consumed>=4:
raise UnicodeError,"UTF-32 stream does not start with BOM"
return (object, consumed)