OneDrive / onedrive-sdk-python

OneDrive SDK for Python! https://dev.onedrive.com
MIT License
1.08k stars 189 forks source link

onedrivesdk.ChildrenCollectionRequest.get_next_page_request: AttributeError: 'ChildrenCollectionPage' object has no attribute '_next_page_link' #124

Closed pertoft closed 3 weeks ago

pertoft commented 6 years ago

Error: AttributeError: 'ChildrenCollectionPage' object has no attribute '_next_page_link'

Terminal output: 0 : 20180408_155657.jpg 1 : 20180408_160051.jpg 2 : 20180408_160150.jpg <class 'onedrivesdk.model.children_collection_page.ChildrenCollectionPage'> 0 : 20180414_181319.jpg 1 : 20180418_164440.jpg 2 : test2.jpg The thread 'MainThread' (0x4580) has exited with code 0 (0x0). Traceback (most recent call last): File "C:\Users\pto\source\repos\OneDrivePhotoOrganizer\OneDrivePhotoOrganizer\OneDrivePhotoOrganizer.py", line 89, in collection = onedrivesdk.ChildrenCollectionRequest.get_next_page_request(collection, client).get() File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\onedrivesdk\request\children_collection.py", line 105, in get_next_page_request if collection_page._next_page_link: AttributeError: 'ChildrenCollectionPage' object has no attribute '_next_page_link'

Steps to reproduce: ... auth part... ` src_folder = "/test/src" dst_folder = "/test/dst/"

collection = client.item(path=src_folder).children.request(top=3).get()

for count, item in enumerate(collection): print("{} : {}".format(count,item.name))

while (collection is not None): collection = onedrivesdk.ChildrenCollectionRequest.get_next_page_request(collection, client).get() print(type(collection)) for count, item in enumerate(collection): print("{} : {}".format(count,item.name)) `

KTibow commented 4 years ago

@pertoft that simply means there isn't another page. Instead of returning None, it throws an exception. I agree that should be changed to returning None, though. Considering helping the community by letting them find this issue, if it makes sense, consider closing.

baywet commented 3 weeks ago

Thank you for reaching out and for your patience. This SDK is being officially deprecated. See #209 for more information