Skip to content

Commit

Permalink
Updated the wording to stress that thousands of
Browse files Browse the repository at this point in the history
keys weren't being fetched before.
  • Loading branch information
toastdriven committed Feb 7, 2014
1 parent ac7b717 commit d7ff5c3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
3 changes: 2 additions & 1 deletion boto/s3/connection.py
Expand Up @@ -445,7 +445,8 @@ def get_bucket(self, bucket_name, validate=True, headers=None):
If the default ``validate=True`` is passed, a request is made to the
service to ensure the bucket exists. Prior to Boto v2.25.0, this fetched
a list of keys in the bucket (& included better error messages), at an
a list of keys (but with a max limit set to ``0``, always returning an empty
list) in the bucket (& included better error messages), at an
increased expense. As of Boto v2.25.0, this now performs a HEAD request
(less expensive but worse error messages).
Expand Down
22 changes: 12 additions & 10 deletions docs/source/s3_tut.rst
Expand Up @@ -175,15 +175,7 @@ override this behavior by passing ``validate=False``.::

>>> nonexistent = conn.get_bucket('i-dont-exist-at-all', validate=False)

If the bucket does not exist, a ``S3ResponseError`` will commonly be thrown. If
you'd rather not deal with any exceptions, you can use the ``lookup`` method.::

>>> nonexistent = conn.lookup('i-dont-exist-at-all')
>>> if nonexistent is None:
... print "No such bucket!"
...
No such bucket!

.. versionchanged:: 2.25.0
.. warning::

If ``validate=False`` is passed, no request is made to the service (no
Expand All @@ -192,7 +184,8 @@ you'd rather not deal with any exceptions, you can use the ``lookup`` method.::

If the default ``validate=True`` is passed, a request is made to the
service to ensure the bucket exists. Prior to Boto v2.25.0, this fetched
a list of keys in the bucket (& included better error messages), at an
a list of keys (but with a max limit set to ``0``, always returning an empty
list) in the bucket (& included better error messages), at an
increased expense. As of Boto v2.25.0, this now performs a HEAD request
(less expensive but worse error messages).

Expand All @@ -202,6 +195,15 @@ you'd rather not deal with any exceptions, you can use the ``lookup`` method.::
bucket = conn.get_bucket('<bucket_name>', validate=False)
bucket.get_all_keys(maxkeys=0)

If the bucket does not exist, a ``S3ResponseError`` will commonly be thrown. If
you'd rather not deal with any exceptions, you can use the ``lookup`` method.::

>>> nonexistent = conn.lookup('i-dont-exist-at-all')
>>> if nonexistent is None:
... print "No such bucket!"
...
No such bucket!


Deleting A Bucket
-----------------
Expand Down

0 comments on commit d7ff5c3

Please sign in to comment.