Get Content from drive returns None

Open
#1,578 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
api

Research direction

Reproduce the issue through client.graph_client.drives.by_drive_id(drive_id).items.by_drive_item_id(item_path).content.get() using SDK 1.63.0, then compare behavior with 1.62.0 and the requests workaround. The change is done when a valid SharePoint file request returns its file content instead of None.

Written by the indexing model from the issue text.

Description

status:waiting-for-triage type:bug
Describe the bug

Trying to get the content of a sharepoint file returns None. Example code:

content = await ( client.graph_client.drives.by_drive_id(drive_id).items.by_drive_item_id(item_path).content.get() )

This has started happening a couple days ago

Expected behavior

The api call should return the content of the file

How to reproduce

execute

drive_id = drive_id
item_path = f"root:/{file_path}:"
content = await ( client.graph_client.drives.by_drive_id(drive_id).items.by_drive_item_id(item_path).content.get() )

on a relevant drive_id and item_path and check content. The function executes successfully, but content will be None.
Even though it used to work a couple days ago, using msgraph-sdk==1.62.0 did not work either.

SDK Version

1.63.0

Latest version known to work for scenario above?

1.62.0

Known Workarounds

Use requests library to get the file

Debug output
Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_
Dominant language
Python
Stars
630
Forks
96
Avg merge
15h 20m
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoftgraph/msgraph-sdk-python

All issues in microsoftgraph/msgraph-sdk-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.