Commit Graph

38 Commits

Author SHA1 Message Date
Steven Silvester
b40f13bf7d
PYTHON-3311 Module "pymongo" does not explicitly export attribute "MongoClient"; implicit reexport disabled (#994) 2022-07-06 18:30:00 -05:00
Steven Silvester
b3604a81d3
PYTHON-3171 Add usage of NoReturn annotation (#901) 2022-03-16 15:26:10 -05:00
Steven Silvester
a0fe7c03af
PYTHON-3120 Set up flake8 linting (#868) 2022-02-17 06:44:08 -06:00
Steven Silvester
2db512f5d5
PYTHON-3078 Remove Use of Unsupported NoReturn Type Class (#864) 2022-02-14 16:14:36 -06:00
Steven Silvester
5578999a90
PYTHON-1834 Use a code formatter (#852) 2022-02-09 06:44:28 -06:00
Steven Silvester
52ed5a4135
PYTHON-3052 Add Typings to PyMongo Itself (#829) 2022-01-13 16:09:48 -06:00
Shane Harvey
f9bfd11290
PYTHON-2870 Add support for man/text/latex/etc.. docs output (#708)
Regenerate sphinx makefile with sphinx-quickstart 3.5.4.
Remove problematic mongodoc sphinx extension.
2021-08-19 13:31:46 -07:00
Bernie Hackett
521f7b9af4 PYTHON-2133 Fix up docs
And finish deleting python 2 specific code.
2021-01-21 15:49:23 -08:00
Bernie Hackett
c70071df1d PYTHON-2133 Remove Py2 compatibility from bson 2021-01-14 14:57:20 -08:00
Shane Harvey
87793a9058 Saner random byte generation 2019-04-29 12:12:25 -07:00
Prashant Mital
58851e1221
PYTHON-1619 Implement ObjectID Specification (#373)
PYTHON-1619 Implement ObjectID Specification
2018-08-29 12:24:28 -05:00
Bernie Hackett
61850357a0 PYTHON-1521 - Use FNV-1a for ObjectId machine bytes 2018-05-31 12:26:53 -07:00
Bernie Hackett
aec685b374 Fix up copyright dates. 2015-03-25 11:55:02 -07:00
A. Jesse Jiryu Davis
710227237a PYTHON-789 Clarify valid ObjectId input (3.0-dev). 2014-11-20 23:18:41 -05:00
A. Jesse Jiryu Davis
08dccbba46 Remove ancient version annotations.
Delete "versionchanged" and "versionadded" directives that predate 2.0.
2014-10-31 14:15:24 -04:00
A. Jesse Jiryu Davis
f91c3d61cb Use with-statements to acquire locks.
We can use with-statements now that we've dropped support
for Python 2.4.
2014-10-02 10:07:43 -04:00
Bernie Hackett
1accea6fc2 PYTHON-226 - Optimize ObjectId creation from BSON
This change optimizes creating an instance of ObjectId
from a 12 byte bytes instance. It gets us most of the way
to what was requested in the ticket without creating a
separate subtype just for decoding.

There are also a number of changes to clean up the module
in general and silence pylint complaints.
2014-08-28 21:07:14 -07:00
A. Jesse Jiryu Davis
504c5a9889 PYTHON-712 ObjectId.is_valid(None) should be False. 2014-06-18 17:02:07 -04:00
Bernie Hackett
bd8d4a3b10 PYTHON-673 - Use bytes and remove binary_type
The binary_type alias was added to support python
2.4 and 2.5, which we no longer support.
2014-04-23 13:25:00 -07:00
Luke Lovett
d4a94d30fd PYTHON-673 python 2/3 single-source for the bson module 2014-04-17 21:29:15 +00:00
A. Jesse Jiryu Davis
2fa1750b07 Update copyright notices and company name. 2014-01-31 09:36:46 -05:00
behackett
2483775f0b Silence C extension RuntimeWarning PYTHON-569
When encoding a document in C while running in a python sub interpreter
(e.g. mod_wsgi spawning sub interpreters) PyMongo would often have
to reload its cache of pure python types - ObjectId, Timestamp,
UUID, etc. - raising RuntimeWarning in the process. The reason this was
necessary is described in the mod_wsgi documentation here:

https://code.google.com/p/modwsgi/wiki/ApplicationIssues#Multiple_Python_Sub_Interpreters

With workarounds documented here:

http://api.mongodb.org/python/2.6.2/faq.html#does-pymongo-work-with-mod-wsgi

With this commit PyMongo will no longer use cached pure python types
when running in a sub interpreter. Instead it will look up pure python
types as needed (primarily when decoding BSON). This eliminates the
problem described in the mod_wsgi docs and eliminates the need for the
Runtime warning.
2013-09-16 17:24:37 -04:00
Bernie Hackett
c8f6d4aa03 ObjectId.__str__ should return str in 2.x.
This addresses the issue raised in pull request
155.
2013-02-09 13:13:45 -08:00
Ross Lawley
29b9de45db Added __ne__ for DBRefs PYTHON-440 2012-11-22 11:12:36 +00:00
behackett
001d72b245 Support non-ascii hostnames in ObjectId PYTHON-430 2012-11-08 12:44:21 -08:00
behackett
dfaadd53e8 Doc updates for PyMongo 2.3 2012-08-16 15:52:14 -07:00
Ross Lawley
f2ea613400 Added is_valid classmethod to ObjectId
Refs PYTHON-360
2012-07-10 16:09:01 +01:00
Glenn Maynard
4ecbd22c19 Initialize ObjectId._inc to a random value.
This is required to prevent collisions on very large clusters.  See
https://groups.google.com/forum/?fromgroups#!topic/mongodb-user/ajgO9wUxbos
for details.  Other drivers also initialize this field to a random value.
2012-06-15 10:21:34 -07:00
Bernie Hackett
f4ec4be807 Avoid encoding errors with pickle.loads PYTHON-355.
This works around issues caused by applications that
use sys.setdefaultencoding to set an interpreter-wide
encoding other than ascii or utf8. This is only an
issue in python 2.x. In python 3.0 and 3.1
setdefaultencoding is a noop. It was completely
removed in python 3.2.
2012-05-30 09:56:03 -07:00
behackett
0ee7170cc2 It's 2012... 2012-04-19 12:40:38 -07:00
Chris Tompkinson
80e59ddd15 Add __ne__ method to bson/objectid.py 2012-04-12 15:12:47 +01:00
behackett
6bd0238629 ObjectId rich comparison operators and doc updates. 2012-03-21 15:39:07 -07:00
behackett
7474f5cde8 Python 3 bson changes PYTHON-84 2012-03-20 13:56:15 -07:00
behackett
9f9b4a6666 Fix loading of OIDs pickled in 1.9.
Credit goes to Steve Lacy <slacy@slacy.com>
for developing the fix and test.
2011-04-04 20:43:23 -07:00
Richard Shea
f202c535d5 change ObjectId __getstate__ and __setstate__ to just use __id also added unit test for pickling/unpickling ObjectId 2011-04-02 11:10:26 -07:00
Richard Shea
c9c54575ff fix pickling of ObjectId by defining __getstate__() and __setstate__() because __slots__() is defined 2011-04-02 11:10:26 -07:00
behackett
7c35ca96c9 Use __slots__ in ObjectId PYTHON-225 2011-03-23 10:09:55 -07:00
Mike Dirolf
9c182809f3 Create a separate bson package PYTHON-60
Many of the pymongo modules have been moved into the bson
package. Aliases for those modules have been added to the pymongo
package, without deprecation warnings for now. Application developers
should begin to use the bson namespace, as deprecation of moved
modules will probably begin in the next release.
2010-09-14 13:52:50 -04:00