Skip to content

AttributeError: 'NoneType' object has no attribute 'rstrip' error #114

@JinIgarashi

Description

@JinIgarashi

the bug caused by merging this PR #89

  • reproduction

just run the below command

rapida --init
  • log
 rapida --init
2025-01-20 11:25:31,720 - INFO - Initializing Azure Blob Storage Manager
Traceback (most recent call last):
  File "/app/.venv/bin/rapida", line 5, in <module>
    from cbsurge.cli import cli
  File "/app/cbsurge/cli.py", line 15, in <module>
    from cbsurge.exposure.population import population
  File "/app/cbsurge/exposure/population/__init__.py", line 5, in <module>
    from cbsurge.exposure.population.worldpop import population_sync, process_aggregates, download
  File "/app/cbsurge/exposure/population/worldpop.py", line 328, in <module>
    async def check_aggregates_exist(storage_manager=AzureBlobStorageManager(conn_str=os.getenv("AZURE_STORAGE_CONNECTION_STRING")), country_code=None):
                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/cbsurge/azure/blob_storage.py", line 26, in __init__
    self.container_client = ContainerClient.from_connection_string(conn_str=conn_str, container_name=AZURE_BLOB_CONTAINER_NAME)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/azure/storage/blob/aio/_container_client_async.py", line 254, in from_connection_string
    account_url, secondary, credential = parse_connection_str(conn_str, credential, 'blob')
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/azure/storage/blob/_shared/base_client_async.py", line 213, in parse_connection_str
    conn_str = conn_str.rstrip(";")
               ^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'rstrip'

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions