ItemProvider.open

ItemProvider.open()

Opens the receiver as a file in 'rb' mode with the first item item returned by get_type_identifiers() as the type identifier. You must use this function with the with keyword:

with item_provider.open() as f:
    f.read()