Commit Graph

110 Commits

Author SHA1 Message Date
Shane Harvey
ea8cb6c209 PYTHON-1329 Send/receive commands as OP_MSG
Don't use $query with OP_MSG.
Support compression with OP_MSG.
2018-06-21 15:46:48 -07:00
Shane Harvey
5ff33a2a37 PYTHON-1554 Fix datetime decoding memory leak 2018-05-22 13:42:59 -07:00
Bernie Hackett
ba7c95a9df PYTHON-1462 - Import ABCs from collections.abc 2018-02-12 19:42:44 -08:00
Shane Harvey
1a784e1afb PYTHON-1466 Silence minor complaints from Coverity
Remove useless NULL check as GETSTATE cannot return NULL after
successful initialization.
2018-02-12 11:31:48 -08:00
Bernie Hackett
507f954ed4 Update copyright dates 2017-12-01 17:23:39 -08:00
Bernie Hackett
de801be529 Silence various complaints from Coverity 2017-11-30 15:02:20 -08:00
Shane Harvey
a4f58cce53 PYTHON-1404 Avoid copying RawBSONDocument.raw. 2017-11-10 15:45:04 -08:00
Shane Harvey
e775295ab5 PYTHON-1367 Ignore uuid_representation when decoding BSON binary subtype 4. 2017-09-12 17:20:14 -07:00
Anthony Sottile
41be71f09f Trim trailing whitespace 2017-08-31 22:26:39 -07:00
Shane Harvey
47ab8c3187 PYTHON-1343 Use unsigned long to encode Timestamps.
The time and increment portions of a Timestamp are unsigned 32-bit integers
which are not guaranteed to fit inside a long.
2017-08-04 11:33:49 -07:00
Bernie Hackett
2fe8d7cf69 PYTHON-1244 - Fix signed/unsigned comparison 2017-02-27 16:14:47 -08:00
Bernie Hackett
8ae717d0df Always check for errors after calling PyLong/Int_AsLong 2016-10-26 16:48:24 -07:00
Petr Messner
8712009f5a Fix ref count management when building _element_to_dict result tuple 2016-10-20 15:46:00 -07:00
Bernie Hackett
82db71e1e8 PYTHON-1068 - Support for BSON Decimal128 2016-08-29 15:07:07 -07:00
Luke Lovett
b6c74cf33d PYTHON-1106 - Implement BSON corpus test suite. 2016-08-24 11:01:45 -07:00
Luke Lovett
6692e8877a PYTHON-1131 - Fix inconsistent handling of scope, unicode support for Code. 2016-08-19 15:22:19 -07:00
Bernie Hackett
c4e8d22544 PYTHON-1025 - C extensions big endian support 2016-06-24 17:54:24 -07:00
Bernie Hackett
49c847f9b5 Fix a few issues discovered by coverity scan 2016-02-01 17:05:28 -08:00
Bernie Hackett
6a14d70120 PYTHON-1044 - Fix up unknown BSON type handing 2016-01-28 11:21:34 -08:00
Luke Lovett
e4d3392f90 PYTHON-472 - Add a RawBSONDocument class that decodes its comprising bytes only on-demand.
This provides an API for inserting and returning raw BSON.
2015-11-18 15:00:09 -08:00
Luke Lovett
c63c0f1d91 PYTHON-1013 - Only reraise PyExc_Exceptions as InvalidBSON in C extensions. 2015-11-17 11:07:39 -08:00
aherlihy
af0daa4fc4 PYTHON-1010 write_dict now checks the error indicator when exiting iteration loop 2015-11-13 10:58:23 -05:00
Bernie Hackett
c327913cbf Fix issues found in coverity scan 2015-09-29 17:29:59 -07:00
Luke Lovett
f62dbc15bd PYTHON-969 - Check return value from PyObject_Call before using it in PyObject_GetAttrString. 2015-07-22 16:43:34 -07:00
Luke Lovett
880394fe99 PYTHON-222 - Add a 'tzinfo' attribute to CodecOptions that specifies a timezone to which to decode datetime objects. 2015-07-09 13:32:23 -07:00
aherlihy
39308c4b2f PYTHON-721 - Add unicode_decode_error_handler to CodecOptions. 2015-07-09 15:08:02 -04:00
Bernie Hackett
3716b449cc PYTHON-871 - Fix encoding of defaultdict. 2015-03-27 14:35:09 -07:00
Bernie Hackett
76530ccd72 PYTHON-870 - Fix two unlikely reference leaks. 2015-03-26 13:00:40 -07:00
Bernie Hackett
aec685b374 Fix up copyright dates. 2015-03-25 11:55:02 -07:00
Bernie Hackett
c87424e7af PYTHON-856 - as_class -> document_class
This commit changes the name of the as_class option
in CodecOptions to document_class, to match the name
of the MongoClient option.
2015-03-09 14:32:42 -07:00
A. Jesse Jiryu Davis
9da835ab3d PYTHON-825 BSON API changes and internal options handling.
This change resolves four issues:

PYTHON-826 The new codec_options submodule is moved from pymongo to bson.

PYTHON-827 Use codec_options in BSON APIs.

Functions and methods of the bson module that accepted the options as_class,
tz_aware, and uuid_subtype now accept a codec_options parameter instead.

For example, the function definition for bson.decode_all changes from this:

def decode_all(data, as_class=dict, tz_aware=True,
               uuid_subtype=OLD_UUID_SUBTYPE)

to:

def decode_all(data, codec_options=CodecOptions())

The following functions are changed:

- decode_all
- decode_iter
- decode_file_iter

The following methods are changed:

- BSON.encode
- BSON.decode

This is a breaking change for any application that uses the BSON API directly
and changes any of the named parameter defaults. No changes are required for
applications that use the default values for these options. The behavior
remains the same.

PYTHON-828 Internal BSON module changes to support CodecOptions

The pure Python BSON module passes around a CodecOptions instance instead of
as_class, tz_aware, and uuid_subtype. C extensions pass these values around in
a struct.

PYTHON-801 Rename uuid_subtype to uuid_representation.
2015-02-05 23:09:23 -06:00
A. Jesse Jiryu Davis
2ba730722b PYTHON-526 Remove 'compile_re' option.
PyMongo now never attempts to compile BSON regular expressions as Python native
regular expressions.
2014-12-05 14:06:38 -05:00
Bernie Hackett
9c8852d93f PYTHON-760 - BSONInt64 -> Int64 2014-09-23 11:43:41 -07:00
Bernie Hackett
852b2d36f8 PYTHON-346 - Eliminate second _bson_to_dict return value
This has been unnecessary for many releases.
2014-08-22 15:35:56 -07:00
Bernie Hackett
e68fdf2b62 PYTHON-505 - Fix C extension build with VC++. 2014-08-20 13:15:26 -07:00
Luke Lovett
17fb3a2a02 PYTHON-505 Allow C extensions to encode any mapping type, not just dicts. 2014-08-13 16:16:25 +00:00
Bernie Hackett
2d8fc71cf3 PYTHON-707 - Fix -Werror=declaration-after-statement 2014-07-22 16:35:50 -07:00
Luke Lovett
2277ee3531 PYTHON-707 Encode BSONInt64 in C extensions. 2014-07-21 17:40:37 +00:00
Luke Lovett
5136bb723c PYTHON-707 Add a BSONInt64 type. 2014-07-18 14:59:21 +00:00
Bernie Hackett
10b0622bce PYTHON-698 - Try encoding types with broken __getattr__ methods 2014-05-16 16:07:53 -07:00
Jaroslav Semančík
b362cc3454 Fixed wrong Python object name for UTC 2014-05-01 11:31:54 -07:00
Bernie Hackett
939fe8ec70 Remove workaround for python issue7380.
The bug was fixed in python 3.1, which we no longer support.
2014-04-24 11:58:59 -07:00
Bernie Hackett
b26459cd6a Remove useless uuid module checks.
These were only needed for python 2.4 which does
not provide a uuid module.
2014-04-24 10:09:21 -07:00
A. Jesse Jiryu Davis
2fa1750b07 Update copyright notices and company name. 2014-01-31 09:36:46 -05:00
Kyle Erf
e100ddcb20 PYTHON-623: do not allow sending _ids with a key starting with $ 2014-01-14 12:51:37 -08:00
Bernie Hackett
b2d1034989 Use commands for write operations PYTHON-554 2013-11-25 18:21:04 -08:00
Bernie Hackett
2371f32894 Clean up str/bytes/unicode encoding in C.
Minor perf improvements included.
2013-11-18 14:54:10 -08:00
A. Jesse Jiryu Davis
72a90b75c6 Wrap all BSON-decoding errors in InvalidBSON exception. PYTHON-494 2013-10-21 20:41:13 -04:00
A. Jesse Jiryu Davis
eec82f782b Default compile_re to True in _cbson_decode_all. PYTHON-500 2013-10-21 20:41:13 -04:00
A. Jesse Jiryu Davis
cb4706f13e Remove unused variable in _cbsonmodule.c 2013-10-20 20:59:19 -04:00