Skip to content

Commit 3ffc759

Browse files
committed
Revert "(python) Change error message for unicode is passed but no encoding is"
This reverts commit bd73742.
1 parent 36b0c2d commit 3ffc759

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

ChangeLog.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
0.1.10
2+
======
3+
:release date: NOT RELEASED YET
4+
5+
New feature
6+
-----------
7+
* Add ``encoding`` and ``unicode_erros`` option to packer and unpacker.
8+
When this option is specified, (un)packs unicode object instead of bytes.
9+
This enables using msgpack as a replacement of json.
10+
111
0.1.9
212
======
313
:release date: 2011-01-29

msgpack/_msgpack.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ cdef class Packer(object):
120120
ret = msgpack_pack_raw_body(&self.pk, rawval, len(o))
121121
elif PyUnicode_Check(o):
122122
if not self.encoding:
123-
raise TypeError("Can't pack unicode object: No encoding is specified")
123+
raise TypeError("Can't encode utf-8 no encoding is specified")
124124
o = PyUnicode_AsEncodedString(o, self.encoding, self.unicode_errors)
125125
rawval = o
126126
ret = msgpack_pack_raw(&self.pk, len(o))

0 commit comments

Comments
 (0)