def getBundleKey(bundlePath):
    """
       Return all parts of a bundle's "key" as used in a timestamp file,
       given its full filename.

       >>> getBundleKey("/bundleinfo/tor-browser/win32/some-file-name.txt")
       '/bundleinfo/tor-browser/win32/'
    """
    # No, we can't use "os.path.directory" or "os.path.split".  Those are
    # OD-dependent, and all of our paths are in Unix format.
    idx = bundlePath.rindex("/")
    return bundlePath[:idx+1]