Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: NoneType object has no attribute lstrip #126

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions storage3/_sync/file_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from dataclasses import dataclass, field
from io import BufferedReader, FileIO
from pathlib import Path
from typing import Any, Optional, Union, cast
from typing import Any, Optional, Union

from httpx import HTTPError, Response

Expand Down Expand Up @@ -167,9 +167,10 @@ def create_signed_url(
json=json,
)
data = response.json()
data[
"signedURL"
] = f"{self._client.base_url}{cast(str, data['signedURL']).lstrip('/')}"
if data['signedURL']:
data[
"signedURL"
] = f"{self._client.base_url}{str, data['signedURL'].lstrip('/')}"
return data

def create_signed_urls(
Expand All @@ -196,9 +197,10 @@ def create_signed_urls(
)
data = response.json()
for item in data:
item[
"signedURL"
] = f"{self._client.base_url}{cast(str, item['signedURL']).lstrip('/')}"
if item['signedURL']:
item[
"signedURL"
] = f"{self._client.base_url}{str, item['signedURL'].lstrip('/')}"
return data

def get_public_url(self, path: str, options: TransformOptions = {}) -> str:
Expand Down