Skip to content

Commit a3a8cf2

Browse files
author
Mike Dirolf
committed
BUMP 1.8 - see changelog for details
1 parent 7a79560 commit a3a8cf2

File tree

12 files changed

+69
-25
lines changed

12 files changed

+69
-25
lines changed

doc/changelog.rst

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,54 @@
11
Changelog
22
=========
33

4+
Changes in Version 1.8
5+
----------------------
6+
7+
Version 1.8 adds support for connecting to replica sets, specifying
8+
per-operation values for `w` and `wtimeout`, and decoding to
9+
timezone-aware datetimes.
10+
11+
- fixed a reference leak in the C extension when decoding a
12+
:class:`~pymongo.dbref.DBRef`.
13+
- added support for `w`, `wtimeout`, and `fsync` (and any other
14+
options for `getLastError`) to "safe mode" operations.
15+
- added :attr:`~pymongo.connection.Connection.nodes` property.
16+
- added a maximum pool size of 10 sockets.
17+
- added support for replica sets.
18+
- DEPRECATED :meth:`~pymongo.connection.Connection.from_uri` and
19+
:meth:`~pymongo.connection.Connection.paired`, both are supplanted
20+
by extended functionality in :meth:`~pymongo.connection.Connection`.
21+
- added tz aware support for datetimes in
22+
:class:`~pymongo.objectid.ObjectId`,
23+
:class:`~pymongo.timestamp.Timestamp` and :mod:`~pymongo.json_util`
24+
methods.
25+
- added :meth:`~pymongo.collection.Collection.drop` helper.
26+
- reuse the socket used for finding the master when a
27+
:class:`~pymongo.connection.Connection` is first created.
28+
- added support for :class:`~pymongo.min_key.MinKey`,
29+
:class:`~pymongo.max_key.MaxKey` and
30+
:class:`~pymongo.timestamp.Timestamp` to :mod:`~pymongo.json_util`.
31+
- added support for decoding datetimes as aware (UTC) - it is highly
32+
recommended to enable this by setting the `tz_aware` parameter to
33+
:meth:`~pymongo.connection.Connection` to ``True``.
34+
- added `network_timeout` option for individual calls to
35+
:meth:`~pymongo.collection.Collection.find` and
36+
:meth:`~pymongo.collection.Collection.find_one`.
37+
- added :meth:`~gridfs.GridFS.exists` to check if a file exists in
38+
GridFS.
39+
- added support for additional keys in :class:`~pymongo.dbref.DBRef`
40+
instances.
41+
- added :attr:`~pymongo.errors.OperationFailure.code` attribute to
42+
:class:`~pymongo.errors.OperationFailure` exceptions.
43+
- fixed serialization of int and float subclasses in the C extension.
44+
445
Changes in Version 1.7
546
----------------------
647

7-
Version 1.7 is a recommended upgrade for all PyMongo users. The full release notes are below, and some more in depth discussion of the highlights is `here <http://dirolf.com/2010/06/17/pymongo-1.7-released.html>`_.
48+
Version 1.7 is a recommended upgrade for all PyMongo users. The full
49+
release notes are below, and some more in depth discussion of the
50+
highlights is `here
51+
<http://dirolf.com/2010/06/17/pymongo-1.7-released.html>`_.
852

953
- no longer attempt to build the C extension on big-endian systems.
1054
- added :class:`~pymongo.min_key.MinKey` and

gridfs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def exists(self, document_or_id=None, **kwargs):
212212
- `**kwargs` (optional): keyword arguments are used as a
213213
query document, if they're present.
214214
215-
.. versionadded:: 1.7+
215+
.. versionadded:: 1.8
216216
"""
217217
if kwargs:
218218
return self.__files.find_one(kwargs) is not None

pymongo/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"""Profile all operations."""
4040

4141
# Remember to change in setup.py as well!
42-
version = "1.7+"
42+
version = "1.8"
4343
"""Current version of PyMongo."""
4444

4545
Connection = PyMongo_Connection

pymongo/bson.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ def to_dict(self, as_class=dict, tz_aware=False):
459459
- `tz_aware` (optional): if ``True``, return timezone-aware
460460
:class:`~datetime.datetime` instances
461461
462-
.. versionadded:: 1.7+
462+
.. versionadded:: 1.8
463463
The `tz_aware` parameter.
464464
.. versionadded:: 1.7
465465
The `as_class` parameter.

pymongo/collection.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def save(self, to_save, manipulate=True, safe=False, **kwargs):
195195
``safe=True``, and will be used as options for the
196196
`getLastError` command
197197
198-
.. versionadded:: 1.7+
198+
.. versionadded:: 1.8
199199
Support for passing `getLastError` options as keyword
200200
arguments.
201201
@@ -246,7 +246,7 @@ def insert(self, doc_or_docs,
246246
``safe=True``, and will be used as options for the
247247
`getLastError` command
248248
249-
.. versionadded:: 1.7+
249+
.. versionadded:: 1.8
250250
Support for passing `getLastError` options as keyword
251251
arguments.
252252
.. versionchanged:: 1.1
@@ -333,7 +333,7 @@ def update(self, spec, document, upsert=False, manipulate=False,
333333
``safe=True``, and will be used as options for the
334334
`getLastError` command
335335
336-
.. versionadded:: 1.7+
336+
.. versionadded:: 1.8
337337
Support for passing `getLastError` options as keyword
338338
arguments.
339339
.. versionchanged:: 1.4
@@ -370,7 +370,7 @@ def drop(self):
370370
>>> db.foo.drop()
371371
>>> db.drop_collection("foo")
372372
373-
.. versionadded:: 1.7+
373+
.. versionadded:: 1.8
374374
"""
375375
self.__database.drop_collection(self.__name)
376376

@@ -408,7 +408,7 @@ def remove(self, spec_or_id=None, safe=False, **kwargs):
408408
``safe=True``, and will be used as options for the
409409
`getLastError` command
410410
411-
.. versionadded:: 1.7+
411+
.. versionadded:: 1.8
412412
Support for passing `getLastError` options as keyword arguments.
413413
.. versionchanged:: 1.7
414414
Accept any type other than a ``dict`` instance for removal
@@ -536,7 +536,7 @@ def find(self, *args, **kwargs):
536536
.. note:: The `max_scan` parameter requires server
537537
version **>= 1.5.1**
538538
539-
.. versionadded:: 1.7+
539+
.. versionadded:: 1.8
540540
The `network_timeout` parameter.
541541
542542
.. versionadded:: 1.7

pymongo/connection.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,12 @@ def __init__(self, host=None, port=None, pool_size=None,
215215
aware (otherwise they will be naive)
216216
217217
.. seealso:: :meth:`end_request`
218-
.. versionchanged:: 1.7+
218+
.. versionchanged:: 1.8
219219
The `host` parameter can now be a full `mongodb URI
220220
<http://dochub.mongodb.org/core/connections>`_, in addition
221221
to a simple hostname. It can also be a list of hostnames or
222222
URIs.
223-
.. versionadded:: 1.7+
223+
.. versionadded:: 1.8
224224
The `tz_aware` parameter.
225225
.. versionadded:: 1.7
226226
The `document_class` parameter.
@@ -299,7 +299,7 @@ def __init__(self, host=None, port=None, pool_size=None,
299299
def from_uri(cls, uri="mongodb://localhost", **connection_args):
300300
"""DEPRECATED Can pass a mongodb URI directly to Connection() instead.
301301
302-
.. versionchanged:: 1.7+
302+
.. versionchanged:: 1.8
303303
DEPRECATED
304304
.. versionadded:: 1.5
305305
"""
@@ -311,7 +311,7 @@ def from_uri(cls, uri="mongodb://localhost", **connection_args):
311311
def paired(cls, left, right=None, **connection_args):
312312
"""DEPRECATED Can pass a list of hostnames to Connection() instead.
313313
314-
.. versionchanged:: 1.7+
314+
.. versionchanged:: 1.8
315315
DEPRECATED
316316
"""
317317
warnings.warn("Connection.paired is deprecated - can pass multiple "
@@ -403,7 +403,7 @@ def nodes(self):
403403
created, as well as nodes discovered through the replica set
404404
discovery mechanism.
405405
406-
.. versionadded:: 1.7+
406+
.. versionadded:: 1.8
407407
"""
408408
return self.__nodes
409409

@@ -432,7 +432,7 @@ def tz_aware(self):
432432
433433
See the `tz_aware` parameter to :meth:`Connection`.
434434
435-
.. versionadded:: 1.7+
435+
.. versionadded:: 1.8
436436
"""
437437
return self.__tz_aware
438438

pymongo/dbref.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __init__(self, collection, id, database=None, _extra={}, **kwargs):
3737
- `**kwargs` (optional): additional keyword arguments will
3838
create additional, custom fields
3939
40-
.. versionchanged:: 1.7+
40+
.. versionchanged:: 1.8
4141
Now takes keyword arguments to specify additional fields.
4242
.. versionadded:: 1.1.1
4343
The `database` parameter.

pymongo/errors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ConfigurationError(PyMongoError):
4747
class OperationFailure(PyMongoError):
4848
"""Raised when a database operation fails.
4949
50-
.. versionadded:: 1.7+
50+
.. versionadded:: 1.8
5151
The :attr:`code` attribute.
5252
"""
5353

@@ -59,7 +59,7 @@ def __init__(self, error, code=None):
5959
class TimeoutError(OperationFailure):
6060
"""Raised when a database operation times out.
6161
62-
.. versionadded:: 1.7+
62+
.. versionadded:: 1.8
6363
"""
6464

6565

pymongo/json_util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@
3434
:class:`~pymongo.binary.Binary` and :class:`~pymongo.code.Code`
3535
instances.
3636
37-
.. versionchanged:: 1.7+
37+
.. versionchanged:: 1.8
3838
Handle timezone aware datetime instances on encode, decode to
3939
timezone aware datetime instances.
4040
41-
.. versionchanged:: 1.7+
41+
.. versionchanged:: 1.8
4242
Added support for encoding/decoding
4343
:class:`~pymongo.max_key.MaxKey` and
4444
:class:`~pymongo.min_key.MinKey`, and for encoding

pymongo/objectid.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def from_datetime(cls, generation_time):
103103
- `generation_time`: :class:`~datetime.datetime` to be used
104104
as the generation time for the resulting ObjectId.
105105
106-
.. versionchanged:: 1.7+
106+
.. versionchanged:: 1.8
107107
Properly handle timezone aware values for
108108
`generation_time`.
109109
@@ -177,7 +177,7 @@ def generation_time(self):
177177
represents the generation time in UTC. It is precise to the
178178
second.
179179
180-
.. versionchanged:: 1.7+
180+
.. versionchanged:: 1.8
181181
Now return an aware datetime instead of a naive one.
182182
183183
.. versionadded:: 1.2

0 commit comments

Comments
 (0)