8000 Merge branch 'release-0.4' · wumingcp-ps/msgpack-python@2481c64 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2481c64

Browse files
committed
Merge branch 'release-0.4'
2 parents 1cc3c57 + e3fea94 commit 2481c64

10 files changed

+52
-51
lines changed

ChangeLog.rst

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ Changes
183183

184184

185185
0.2.4
186-
=======
186+
=====
187187
:release date: 2012-12-22
188188

189189
Bugs fixed
@@ -192,19 +192,19 @@ Bugs fixed
192192
* Fix SEGV when object_hook or object_pairs_hook raise Exception. (#39)
193193

194194
0.2.3
195-
=======
195+
=====
196196
:release date: 2012-12-11
197197

198198
Changes
199199
-------
200200
* Warn when use_list is not specified. It's default value will be changed in 0.3.
201201

202202
Bugs fixed
203-
-----------
203+
----------
204204
* Can't pack subclass of dict.
205205

206206
0.2.2
207-
=======
207+
=====
208208
:release date: 2012-09-21
209209

210210
Changes
@@ -213,24 +213,24 @@ Changes
213213
object in single precision format.
214214

215215
Bugs fixed
216-
-----------
216+
----------
217217
* ``unpack()`` didn't restores gc state when it called with gc disabled.
218218
``unpack()`` doesn't control gc now instead of restoring gc state collectly.
219219
User can control gc state when gc cause performance issue.
220220

221221
* ``Unpacker``'s ``read_size`` option didn't used.
222222

223223
0.2.1
224-
=======
224+
=====
225225
:release date: 2012-08-20
226226

227227
Changes
228228
-------
229229
* Add ``max_buffer_size`` parameter to Unpacker. It limits internal buffer size
230230
and allows unpack data from untrusted source safely.
231231

232-
* Unpacker's buffer reallocation algorithm is less greedy now. It cause perforamce
233-
derease in rare case but memory efficient and don't allocate than ``max_buffer_size``.
232+
* Unpacker's buffer reallocation algorithm is less greedy now. It cause performance
233+
decrease in rare case but memory efficient and don't allocate than ``max_buffer_size``.
234234

235235
Bugs fixed
236236
----------
@@ -240,7 +240,7 @@ Bugs fixed
240240

241241

242242
0.2.0
243-
=======
243+
=====
244244
:release date: 2012-06-27
245245

246246
Changes
@@ -255,16 +255,16 @@ Bugs fixed
255255

256256

257257
0.1.13
258-
=======
258+
======
259259
:release date: 2012-04-21
260260

261261
New
262-
----
262+
---
263263
* Don't accept subtype of list and tuple as msgpack list. (Steeve Morin)
264264
It allows customize how it serialized with ``default`` argument.
265265

266266
Bugs fixed
267-
-----------
267+
----------
268268
* Fix wrong error message. (David Wolever)
269269
* Fix memory leak while unpacking when ``object_hook`` or ``list_hook`` is used.
270270
(Steeve Morin)
@@ -276,21 +276,21 @@ Other changes
276276

277277

278278
0.1.12
279-
=======
279+
======
280280
:release date: 2011-12-27
281281

282282
Bugs fixed
283-
-------------
283+
----------
284284

285285
* Re-enable packs/unpacks removed at 0.1.11. It will be removed when 0.2 is released.
286286

287287

288288
0.1.11
289-
=======
289+
======
290290
:release date: 2011-12-26
291291

292292
Bugs fixed
293-
-------------
293+
----------
294294

295295
* Include test code for Python3 to sdist. (Johan Bergström)
296296
* Fix compilation error on MSVC. (davidgaleano)
@@ -308,7 +308,7 @@ New feature
308308

309309

310310
0.1.9
311-
======
311+
=====
312312
:release date: 2011-01-29
313313

314314
New feature
@@ -322,16 +322,16 @@ Bugs fixed
322322
* Add MemoryError check.
323323

324324
0.1.8
325-
======
325+
=====
326326
:release date: 2011-01-10
327327

328328
New feature
329-
------------
329+
-----------
330330
* Support ``loads`` and ``dumps`` aliases for API compatibility with
331331
simplejson and pickle.
332332

333333
* Add *object_hook* and *list_hook* option to unpacker. It allows you to
334-
hook unpacing mapping type and array type.
334+
hook unpacking mapping type and array type.
335335

336336
* Add *default* option to packer. It allows you to pack unsupported types.
337337

@@ -343,13 +343,13 @@ Bugs fixed
343343

344344

345345
0.1.7
346-
======
346+
=====
347347
:release date: 2010-11-02
348348

349349
New feature
350-
------------
350+
-----------
351351
* Add *object_hook* and *list_hook* option to unpacker. It allows you to
352-
hook unpacing mapping type and array type.
352+
hook unpacking mapping type and array type.
353353

354354
* Add *default* option to packer. It allows you to pack unsupported types.
355355

README.rst

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
=======================
1+
======================
22
MessagePack for Python
3-
=======================
3+
======================
44

55
:author: INADA Naoki
66
:version: 0.4.6
@@ -11,21 +11,22 @@ MessagePack for Python
1111

1212

1313
What's this
14-
------------
14+
-----------
1515

16-
`MessagePack <http://msgpack.org/>`_ is a fast, compact binary serialization format, suitable for
17-
similar data to JSON. This package provides CPython bindings for reading and
18-
writing MessagePack data.
16+
`MessagePack <http://msgpack.org/>`_ is an efficient binary serialization format.
17+
It lets you exchange data among multiple languages like JSON.
18+
But it's faster and smaller.
19+
This package provides CPython bindings for reading and writing MessagePack data.
1920

2021
Install
21-
---------
22+
-------
2223

2324
::
2425

2526
$ pip install msgpack-python
2627

2728
PyPy
28-
^^^^^
29+
^^^^
2930

3031
msgpack-python provides pure python implementation. PyPy can use this.
3132

@@ -44,7 +45,7 @@ Community Edition or Express Edition can be used to build extension module.
4445

4546

4647
How to use
47-
-----------
48+
----------
4849

4950
One-shot pack & unpack
5051
^^^^^^^^^^^^^^^^^^^^^^
@@ -134,7 +135,7 @@ It is also possible to pack/unpack custom data types. Here is an example for
134135
key-value pairs.
135136

136137
Extended types
137-
^^^^^^^^^^^^^^^
138+
^^^^^^^^^^^^^^
138139

139140
It is also possible to pack/unpack custom data types using the **ext** type.
140141

@@ -166,7 +167,7 @@ Advanced unpacking control
166167

167168
As an alternative to iteration, ``Unpacker`` objects provide ``unpack``,
168169
``skip``, ``read_array_header`` and ``read_map_header`` methods. The former two
169-
read an entire message from the stream, respectively deserialising and returning
170+
read an entire message from the stream, respectively de-serialising and returning
170171
the result, or ignoring it. The latter two methods return the number of elements
171172
in the upcoming container, so that each element in an array, or key-value pair
172173
in a map, can be unpacked or skipped individually.
@@ -243,7 +244,7 @@ instead of `StopIteration`.
243244
`StopIteration` is used for iterator protocol only.
244245

245246
Note about performance
246-
------------------------
247+
----------------------
247248

248249
GC
249250
^^
@@ -253,7 +254,7 @@ This means unpacking may cause useless GC.
253254
You can use ``gc.disable()`` when unpacking large message.
254255

255256
use_list option
256-
^^^^^^^^^^^^^^^^
257+
^^^^^^^^^^^^^^^
257258
List is the default sequence type of Python.
258259
But tuple is lighter than list.
259260
You can use ``use_list=False`` while unpacking when performance is important.
@@ -264,7 +265,7 @@ Another way to unpacking such object is using ``object_pairs_hook``.
264265

265266

266267
Development
267-
------------
268+
-----------
268269

269270
Test
270271
^^^^

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ test_script:
2828
# only needed to support those cases.
2929
# Note that you must use the environment variable %PYTHON% to refer to
3030
# the interpreter you're using - Appveyor does not do anything special
31-
# to put the Python evrsion you want to use on PATH.
31+
# to put the Python version you want to use on PATH.
3232
- "build.cmd %PYTHON%\\python.exe setup.py build_ext -i"
3333
- "build.cmd %PYTHON%\\python.exe setup.py install"
3434
- "%PYTHON%\\python.exe -c \"import sys; print(hex(sys.maxsize))\""

docs/api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ API reference
2828
.. autoclass:: ExtType
2929

3030
exceptions
31-
-----------
31+
----------
3232

3333
These exceptions are accessible via `msgpack` package.
3434
(For example, `msgpack.OutOfData` is shortcut for `msgpack.exceptions.OutOfData`)

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
msgpack document
2-
==================
2+
================
33

44
`MessagePack <http://msgpack.org>`_ is a efficient format for inter
55
language data exchange.

msgpack/_packer.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ cdef class Packer(object):
6161
:param bool use_single_float:
6262
Use single precision float type for float. (default: False)
6363
:param bool autoreset:
64-
Reset buffer after each pack and return it's content as `bytes`. (default: True).
64+
Reset buffer after each pack and return its content as `bytes`. (default: True).
6565
If set this to false, use `bytes()` to get content and `.reset()` to clear buffer.
6666
:param bool use_bin_type:
6767
Use bin type introduced in msgpack spec 2.0 for bytes.
68-
It also enable str8 type for unicode.
68+
It also enables str8 type for unicode.
6969
:param bool strict_types:
7070
If set to true, types will be checked to be exact. Derived classes
7171
from serializeable types will not be serialized and will be
@@ -299,7 +299,7 @@ cdef class Packer(object):
299299
"""
300300
Pack *pairs* as msgpack map type.
301301
302-
*pairs* should sequence of pair.
302+
*pairs* should be a sequence of pairs.
303303
(`len(pairs)` and `for k, v in pairs:` should be supported.)
304304
"""
305305
cdef int ret = msgpack_pack_map(&self.pk, len(pairs))

msgpack/_unpacker.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ cdef class Unpacker(object):
272272
:param int max_buffer_size:
273273
Limits size of data waiting unpacked. 0 means system's INT_MAX (default).
274274
Raises `BufferFull` exception when it is insufficient.
275-
You shoud set this parameter when unpacking data from untrusted source.
275+
You should set this parameter when unpacking data from untrusted source.
276276
277277
:param int max_str_len:
278278
Limits max length of str. (default: 2**31-1)

msgpack/fallback.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class Unpacker(object):
164164
:param int max_buffer_size:
165165
Limits size of data waiting unpacked. 0 means system's INT_MAX (default).
166166
Raises `BufferFull` exception when it is insufficient.
167-
You shoud set this parameter when unpacking data from untrusted source.
167+
You should set this parameter when unpacking data from untrusted source.
168168
169169
:param int max_str_len:
170170
Limits max length of str. (default: 2**31-1)
@@ -214,7 +214,7 @@ def __init__(self, file_like=None, read_size=0, use_list=True,
214214
self.file_like = file_like
215215
self._feeding = False
216216

217-
#: array of bytes feeded.
217+
#: array of bytes fed.
218218
self._buffer = bytearray()
219219
#: Which position we currently reads
220220
self._buff_i = 0
@@ -646,17 +646,17 @@ class Packer(object):
646646
Convert user type to builtin type that Packer supports.
647647
See also simplejson's document.
648648
:param str encoding:
649-
Convert unicode to bytes with this encoding. (default: 'utf-8')
649+
Convert unicode to bytes with this encoding. (default: 'utf-8')
650650
:param str unicode_errors:
651651
Error handler for encoding unicode. (default: 'strict')
652652
:param bool use_single_float:
653653
Use single precision float type for float. (default: False)
654654
:param bool autoreset:
655-
Reset buffer after each pack and return it's content as `bytes`. (default: True).
655+
Reset buffer after each pack and return its content as `bytes`. (default: True).
656656
If set this to false, use `bytes()` to get content and `.reset()` to clear buffer.
657657
:param bool use_bin_type:
658658
Use bin type introduced in msgpack spec 2.0 for bytes.
659-
It also enable str8 type for unicode.
659+
It also enables str8 type for unicode.
660660
:param bool strict_types:
661661
If set to true, types will be checked to be exact. Derived classes
662662
from serializeable types will not be serialized and will be

test/test_extension.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def default(obj):
4242
typecode = 123 # application specific typecode
4343
data = obj.tostring()
4444
return ExtType(typecode, data)
45-
raise TypeError("Unknwon type object %r" % (obj,))
45+
raise TypeError("Unknown type object %r" % (obj,))
4646

4747
def ext_hook(code, data):
4848
print('ext_hook called', code, data)

test/test_pack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def testMapSize(sizes=[0, 5, 50, 1000]):
130130

131131

132132
class odict(dict):
133-
'''Reimplement OrderedDict to run test on Python 2.6'''
133+
"""Reimplement OrderedDict to run test on Python 2.6"""
134134
def __init__(self, seq):
135135
self._seq = seq
136136
dict.__init__(self, seq)

0 commit comments

Comments
 (0)
0