diff --git a/gridfs/__init__.py b/gridfs/__init__.py index 5c9193938..2dc41be89 100644 --- a/gridfs/__init__.py +++ b/gridfs/__init__.py @@ -44,7 +44,11 @@ class GridFS(object): """Open a GridFile for reading or writing. Shorthand method for creating / opening a GridFile from a filename. mode - must be a mode supported by `gridfs.grid_file.GridFile` + must be a mode supported by `gridfs.grid_file.GridFile`. + + Only a single opened GridFile instance may exist for a file in gridfs + at any time. Care must be taken to close GridFile instances when done + using them. :Parameters: - `filename`: name of the GridFile to open diff --git a/gridfs/grid_file.py b/gridfs/grid_file.py index a2612f6ca..63281f4cd 100644 --- a/gridfs/grid_file.py +++ b/gridfs/grid_file.py @@ -44,7 +44,11 @@ class GridFile(object): """Open a "file" in GridFS. Application developers should generally not need to instantiate this - class directly. + class directly - instead see the `gridfs.open` method. + + Only a single opened GridFile instance may exist for a file in gridfs + at any time. Care must be taken to close GridFile instances when done + using them. Raises TypeError if file_spec is not an instance of dict, database is not an instance of `pymongo.database.Database`, or collection is not an