-
Notifications
You must be signed in to change notification settings - Fork 189
download_async, "yield from wasn't used with future`, and downloading large files errors #161
Comments
Even weirder, running the same
which is the same kind of error, but now it does download for a few seconds while giving that error and than crashes! |
Can you change your title to: |
Looking at the examples, it is downloading, but I think it's doing it in the background. Have you tried something like the async example? import asyncio
@asyncio.coroutine
def run_gets(client):
coroutines = [client.drive('me').request().get_async() for i in range(3)]
for future in asyncio.as_completed(coroutines):
drive = yield from future
print(drive.id)
loop = asyncio.get_event_loop()
loop.run_until_complete(run_gets(client)) When you called import asyncio
@asyncio.coroutine
def run_gets(client):
coroutines = [client.item(drive='me', id=item.id).download_async(filename)]
for future in asyncio.as_completed(coroutines):
print("Completed.")
loop = asyncio.get_event_loop()
loop.run_until_complete(run_gets(client)) |
Okay, this works: import asyncio
# Make sure you've authenticated
def download(client, drivename, localname):
loop = asyncio.get_event_loop()
loop.run_until_complete(client.item(drive='me', path=drivename).download_async(localname))
download(client, "largefile.whatever", "downloadedfile.whatever") I haven't tested it on a large file yet but it worked just fine on my test file. |
Thank you for reaching out and for your patience. This SDK is being officially deprecated. See #209 for more information |
Hi,
I'm trying to download files from my OneDrive, and at times I get this:
which I saw in other issues for uploading errors where it was advised to use
upload_async
instead ofupload
.Trying the same with
download_async
, just changing fromclient.item(drive='me', id=item.id).download(filename)
toclient.item(drive='me', id=item.id).download_async(filename)
just goes through it without downloading, and changing it toreturned = list(client.item(drive='me', id=item.id).download(filename))
(using to_dict() as mentioned in #51 doesn't work) gives me this:which I can't really make sense of.
Are there any other methods to download large files, or am I doing it wrong with
download_async
? Weirdly, I saw a lot of issues aboutupload_async
, but none about that.Thanks in advance for the help!
The text was updated successfully, but these errors were encountered: