Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
daongochoanganh opened this issue May 21, 2020 · 1 comment
Open

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

daongochoanganh opened this issue May 21, 2020 · 1 comment
Labels

Comments

@daongochoanganh
Copy link

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)
@vgrem vgrem added the question label May 25, 2020
@beliaev-maksim
Copy link
Contributor

@daongochoanganh
Hi,
did you try to manually copy the file to the Linux and try to open it?
since library is downloading binary content it should match 1 to 1 version on Sharepoint.

so I assume the issue is in file itself rather than in Python module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants