-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Labels
bugSomething isn't workingSomething isn't working
Description
| if content_sha1.startswith(UNVERIFIED_CHECKSUM_PREFIX): |
This function is invoked in context where content_sha1 is typed as str | None. This code will crash on None input.
b2-sdk-python/b2sdk/v2/file_version.py
Line 47 in 4aa3d3c
| content_sha1: str | None, |
Simple test output with just related code copypasta into my own test runner.
Traceback (most recent call last):
File "/Users/mikes/PycharmProjects/account-api/tests/testing.py", line 147, in wrapper
return self.loop.run_until_complete(coro)
File "/Users/mikes/.pyenv/versions/3.6.12/lib/python3.6/asyncio/base_events.py", line 488, in run_until_complete
return future.result()
File "/Users/mikes/PycharmProjects/account-api/tests/test_storage_providers.py", line 84, in test_b2_object_attr_sha1_unset
result = await self.b2_provider.get_object_metadata('key', photo)
File "/Users/mikes/PycharmProjects/account-api/accounts/files/v4_1/providers.py", line 167, in get_object_metadata
if sha1.startswith(UNVERIFIED_CHECKSUM_PREFIX):
AttributeError: 'NoneType' object has no attribute 'startswith'
snejku
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working