You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(.venv) C:\DeveloperFiles\Repos\reporting\bitbucket-reporter>python test.py
Traceback (most recent call last):
File "C:\DeveloperFiles\Repos\reporting\bitbucket-reporter\test.py", line 21, in <module>
asyncio.run(uploader.upload_large_file(file_to_upload='mango_test.txt', destination_path="root:/Reports/mango.txt:"))
File "C:\Users\mango\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Users\mango\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\mango\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 654, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\DeveloperFiles\Repos\reporting\bitbucket-reporter\sharepoint_uploader.py", line 110, in upload_large_file
upload_result = await task.upload(progress_callback)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\DeveloperFiles\Repos\reporting\bitbucket-reporter\.venv\Lib\site-packages\msgraph_core\tasks\large_file_upload.py", line 91, in upload
if self.upload_session_expired(self.upload_session):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\DeveloperFiles\Repos\reporting\bitbucket-reporter\.venv\Lib\site-packages\msgraph_core\tasks\large_file_upload.py", line 81, in upload_session_expired
interval = now - then
~~~~^~~~~~
TypeError: can't subtract offset-naive and offset-aware datetimes
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Fixes a TypeError in LargeFileUploadTask.upload_session_expired caused by subtracting offset-aware and offset-naive datetime values when validating whether an upload session has expired.
Changes:
Forces expiration_date_time datetimes to be treated as UTC to avoid naive/aware subtraction errors.
(default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
(when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The error: