Skip to content

fix(uploader): TypeError between offset-native and offset-aware datetimes#1082

Open
mango-tart wants to merge 1 commit into
microsoftgraph:mainfrom
mango-tart:bugfix/large-file-upload-typeerror
Open

fix(uploader): TypeError between offset-native and offset-aware datetimes#1082
mango-tart wants to merge 1 commit into
microsoftgraph:mainfrom
mango-tart:bugfix/large-file-upload-typeerror

Conversation

@mango-tart
Copy link
Copy Markdown

@mango-tart mango-tart commented May 25, 2026

The error:

(.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

@mango-tart mango-tart requested a review from a team as a code owner May 25, 2026 06:58
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant