[Python] '_io.BytesIO' object has no attribute 'lower'

Discussão em 'Python' iniciado por Stack, Janeiro 15, 2025.

  1. Stack

    Stack Membro Participativo

    Hi encountered this error ('_io.BytesIO' object has no attribute 'lower') while testing to download and process pdf file with azure function app. The code that was failed :

    def download_file_byURL(site_url, file_path, user_credential):
    file_object = io.BytesIO()
    ctx = ClientContext(site_url).with_credentials(user_credential)
    file = ctx.web.get_file_by_server_relative_url(file_path)
    file.download(file_object).execute_query()
    file_object .seek(0)

    return file_object


    pdf_file = download_file_byURL(site_url, file_path, user_credential)

    camelot_tables = camelot.read_pdf(pdf_file, pages='all', flavor='lattice')


    I wanted to process pdf file from sharepoint, read, transform to database

    Continue reading...

Compartilhe esta Página