def split_s3_path(s3_path):
    """Get a bucket name and object path from an 's3 path'.
    An S3 path is one in which the object path is appended to the bucket name.
    For example: my-music-bucket/path/to/file.mp3

    S3 paths may also begin with the character sequence "S3://" to disambiguate
    it from a local path in arguments that might accept both.

    Returns a tuple containing the bucket name and object path.
    """
    # If the s3_path begins with an "S3://" or "s3://", strip it off.
    if s3_path.startswith('S3://') or s3_path.startswith('s3://'):
        s3_path = s3_path[5:]

    # Split the s3 path after the *first* slash character. The bucket name
    # can't have a slash in it; anything after the first slash is considered
    # the S3 object name.
    if '/' in s3_path:
        return s3_path.split('/', 1)
    else:
        return (s3_path, None)