mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-19 21:18:23 +01:00
Revert "(python) Change error message for unicode is passed but no encoding is"
This reverts commit bd73742552cf16592662a7ec5ba3608888081131.
This commit is contained in:
parent
bd73742552
commit
709d0cc33e
@ -1,3 +1,13 @@
|
|||||||
|
0.1.10
|
||||||
|
======
|
||||||
|
:release date: NOT RELEASED YET
|
||||||
|
|
||||||
|
New feature
|
||||||
|
-----------
|
||||||
|
* Add ``encoding`` and ``unicode_erros`` option to packer and unpacker.
|
||||||
|
When this option is specified, (un)packs unicode object instead of bytes.
|
||||||
|
This enables using msgpack as a replacement of json.
|
||||||
|
|
||||||
0.1.9
|
0.1.9
|
||||||
======
|
======
|
||||||
:release date: 2011-01-29
|
:release date: 2011-01-29
|
||||||
|
@ -120,7 +120,7 @@ cdef class Packer(object):
|
|||||||
ret = msgpack_pack_raw_body(&self.pk, rawval, len(o))
|
ret = msgpack_pack_raw_body(&self.pk, rawval, len(o))
|
||||||
elif PyUnicode_Check(o):
|
elif PyUnicode_Check(o):
|
||||||
if not self.encoding:
|
if not self.encoding:
|
||||||
raise TypeError("Can't pack unicode object: No encoding is specified")
|
raise TypeError("Can't encode utf-8 no encoding is specified")
|
||||||
o = PyUnicode_AsEncodedString(o, self.encoding, self.unicode_errors)
|
o = PyUnicode_AsEncodedString(o, self.encoding, self.unicode_errors)
|
||||||
rawval = o
|
rawval = o
|
||||||
ret = msgpack_pack_raw(&self.pk, len(o))
|
ret = msgpack_pack_raw(&self.pk, len(o))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user