Skip to content

Excel file content is OK in Window but error in Ubuntu #195

Open
@daongochoanganh

Description

@daongochoanganh

Hi,

I having an issue when trying to download Excel file:

File downloaded in Window run-time work and I can open the Excel file normally using MS Excel and also can use Pandas to read the Excel.

However, when I run the code in Ubuntu, data downloaded open with Open Office show error with content = "Unexpected EOF"

from office365.runtime.auth.authentication_context import AuthenticationContext
from office365.sharepoint.client_context import ClientContext
from office365.sharepoint.file import File
import pandas

ctx_auth = AuthenticationContext(url)
ctx_auth.acquire_token_for_user(username, password)
ctx = ClientContext(url, ctx_auth)
response = File.open_binary(ctx, relative_url + "Excel.xlsx")
with open("/tmp/Excel.xlsx", "wb") as local_file:
    local_file.write(response.content)
df = pandas.read_excel(io = "/tmp/Excel.xlsx)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions