+ # Old versions of the Python urlparse library will take a URL like
+ # s3://bucket/path/ and include the bucket with the path, while new
+ # versions (2.6 and later) treat it as the netloc (which seems more
+ # correct).
+ #
+ # But, so that we can work with either behavior, for now just combine
+ # the netloc and path together before we do any further processing
+ # (which will then split the combined path apart into a bucket and path
+ # again). If we didn't want to support Python 2.5, this would be
+ # easier as we could just use the netloc as the bucket directly.
+ path = self.netloc + '/' + self.path
+ (bucket, prefix) = path.lstrip("/").split("/", 1)