Commit graph

73 commits

Author SHA1 Message Date
INADA Naoki
fc09da997c fallback: Update docstring. 2018-01-10 02:58:55 +09:00
INADA Naoki
43137d6bd2
Deprecate write_bytes option in Unpacker. (#262)
Fixes #197
2018-01-05 20:19:04 +09:00
Lorenzo Bolla
deeda31a88 Add unittests to document serialisation of tuples (#246)
Also, fix formatting of error message in case of tuple.
See https://github.com/msgpack/msgpack-python/issues/245
2017-09-30 16:23:55 +09:00
jfolz
f0f2c0b397 Packer accepts bytearray objects (#229) 2017-05-18 20:03:15 +09:00
jfolz
a8d9162ca6 Unpacker: add tell() (#227) 2017-04-30 02:33:20 +09:00
INADA Naoki
2481c64cf1 Merge branch 'release-0.4' 2017-01-12 18:17:00 +09:00
TW
e3fea94509 fix typos and other cosmetic issues (#214)
cosmetic issues:
- reST headlines' underline length needs to match the headline length
  (looks like somebody is / was using a proportional font)
- Cython code lines do not need to be terminated with a semicolon
- always use triple-double-quotes for docstrings
2017-01-11 12:04:23 +09:00
folz
2b63e9fbbb enable unpacking from memoryview 2016-06-13 15:37:33 +02:00
INADA Naoki
c16a1c6bdf fallback: Use bytearray as buffer 2016-05-24 07:32:30 +09:00
INADA Naoki
6b8919355d fallback: Use struct.unpack_from when possible 2016-05-24 02:46:29 +09:00
INADA Naoki
e9c42fa523 fallback: simplify write_bytes callback implementation 2016-05-22 13:31:01 +09:00
INADA Naoki
3322a76989 Remove _fb_ prefix 2016-05-22 11:08:20 +09:00
INADA Naoki
f421f59a28 fallback: Rewrite buffer from array of bytes to bytearray 2016-05-20 21:56:10 +09:00
folz
5860af953a refactor header packing for str and bin types 2016-05-04 11:01:27 +02:00
folz
0ec2e3534f fix problems associated with packing memoryviews
fix wrong length when packing multibyte memoryviews in fallback
add tests for memoryviews of different types and sizes and check contents of packed data
2016-05-03 16:55:14 +02:00
palaviv
7d2d46effc msgpack pack and unpack throws only exception that inherit from MsgpackBaseException. cython and fallback throws same exceptions 2016-02-12 11:00:39 +02:00
folz
31adc5a3c0 Support packing memoryview objects 2016-01-25 13:25:10 +01:00
INADA Naoki
8036cb4e0e Merge pull request #158 from methane/feature/strict-typecheck
Packer: check type strictly
2016-01-25 11:37:07 +09:00
INADA Naoki
b6e962d0a6 Merge pull request #163 from ThomasWaldmann/master
fix typos
2015-12-10 17:42:15 +09:00
Thomas Waldmann
9c6584ee10 fix typos 2015-12-09 13:53:42 +01:00
INADA Naoki
9b673279d3 strict_types should be last argument 2015-11-10 03:37:54 +09:00
INADA Naoki
1032ef9bf2 fallback unpacker: precise => strict 2015-11-10 03:33:50 +09:00
INADA Naoki
e9a47cbd35 Merge branch 'master' of https://github.com/faerot/msgpack-python into pramukta-default_function_on_int_overflow 2015-11-10 01:52:52 +09:00
Pramukta Kumar
10cd2d2ebf calling the default function upon integer overflow in the fallback routine 2015-03-17 15:05:04 -04:00
INADA Naoki
4576b94b6c fallback: Add some comment to Unpacker members. 2015-01-27 14:04:32 +09:00
Bas Westerbaan
a71a24d86a Fix #124
When using Unpacker as an iterator, after each yield, the internal
buffer (_fb_buffer) was compacted by reallocation (done by _fb_consume).
When dealing with a lot of small objects, this is very ineffecient.
Thus in commit 7eb371f827 the pure python
fallback only reallocated the complete buffer when the iteration stops.
When halfway there happens to be data missing in the buffer, we rollback
the buffer to the state before this failed call, and raise an OutOfData.
This rollback, done by _fb_rollback, did not consider the possibility
that the buffer was *not* reallocated.  This commit corrects that.
2015-01-26 20:34:31 +01:00
INADA Naoki
75ce78dd15 Add max_<type>_len option to unpacker. (fixes #97).
Fix build error on 32bit environment (fixes #102).
2015-01-25 01:41:21 +09:00
Xiaojie Lin
d5e9ac9316 add support for pypy3 2014-11-14 14:47:54 +11:00
Bas Westerbaan
0532ea87fb fallback: fix BufferFull with sloppy consume 2014-06-15 22:45:30 +02:00
Bas Westerbaan
b334d441c3 fallback: _fb_read: do a big read, when we need a big read 2014-06-14 18:42:02 +02:00
Bas Westerbaan
952eb9fc53 fallback: add some comments to _fb_read 2014-06-14 18:34:17 +02:00
Bas Westerbaan
7eb371f827 fallback: do not reset the buffer completely in between of iterations 2014-06-14 18:30:38 +02:00
Bas Westerbaan
ba8cf1c402 fallback: _fb_consume: improve performance with pypy 2014-06-14 18:26:30 +02:00
Bas Westerbaan
56cf384159 fallback: set default read_size to 4096 2014-06-14 18:25:57 +02:00
Bas Westerbaan
67391fd60e fallback: add missing update of _fb_buf_n 2014-06-14 18:25:34 +02:00
faerot
b877ce2afa precise_mode instead of distinguish_tuple
When precise_mode flag is set, serialization will be as precise as
possible - type checks will be exact (type(..) is ... instead of
isinstance(..., ...) and tuple will be treated as undefined type. This
mode is to make accurate object serialization possible.
2014-05-22 16:45:26 +03:00
faerot
3b933f0966 added distinguish_tuple argument to Packer
This will make precise python types serialization possible.
2014-05-22 11:32:54 +03:00
INADA Naoki
ef5d93d4ea Fix size limit on pack_array_header and pack_map_header. 2014-03-26 11:05:53 +09:00
INADA Naoki
eb3537ab50 Merge branch 'pr/82' 2014-02-17 04:07:16 +09:00
INADA Naoki
7effb4aac6 fix 2014-02-17 04:05:04 +09:00
Sergey Zhuravlev
11a3b1561a fixed support of python3 2014-02-12 23:09:23 +04:00
Wouter Bolsterlee
77046b839d Always raise TypeError for wrong argument types
The code that checks whether hooks are callable() (and some other type
checks) should always raise TypeError on failure. Before this change,
both ValueError and TypeError were used in an inconsistent way (C
extension and Python implementation were not the same).
2014-02-11 20:42:58 +01:00
Sergey Zhuravlev
48ca2d700d Added support of bytearrays to msgpack/fallback.py 2013-12-15 16:22:39 +00:00
INADA Naoki
e3fee4db5f fallback: support packing ExtType 2013-10-21 00:59:22 +09:00
INADA Naoki
aa68c9b833 fallback: Support pack_ext_type. 2013-10-20 15:40:20 +09:00
INADA Naoki
7123341ca8 code refactoring. 2013-10-20 14:34:36 +09:00
INADA Naoki
d9439204c7 Add ext type support to fallback.Unpacker. 2013-10-17 11:29:36 +09:00
INADA Naoki
85eaff344b Add bin type support for fallback Unpacker. 2013-10-17 09:15:19 +09:00
INADA Naoki
84f6b10019 Add bin type support to pure Python packer. 2013-10-17 08:52:59 +09:00
INADA Naoki
171c538113 refactoring. 2013-10-17 08:44:25 +09:00