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

TypeError: __init__() got an unexpected keyword argument 'file_size_limit' #77

Closed
charlieamer opened this issue Mar 8, 2023 · 2 comments

Comments

@charlieamer
Copy link

Describe the bug
In production environment I get the error in title. In local development however, I don't get that error. This is the stacktrace:

Traceback (most recent call last):
  File ...
    bucket = client.storage().get_bucket('tasks')
  File ".../storage3/_sync/bucket.py", line 52, in get_bucket
    return SyncBucket(**json, _client=self._client)
TypeError: __init__() got an unexpected keyword argument 'file_size_limit'

I solved this by adding 2 properties to BaseBucket in types.py:

file_size_limit: int
allowed_mime_types: list[string]

However when I add these 2 lines, the development environment stops working because of new error: TypeError: __init__() missing 2 required positional arguments: 'file_size_limit' and 'allowed_mime_types'

To Reproduce

f = open('test.txt', 'w')
f.write("HELLO WORLD")
f.close()
client = create_client(os.environ['SUPABASE_URL'], os.environ['SUPABASE_KEY'])
# create SOME_BUCKET in your supabase
client.storage().get_bucket('SOME_BUCKET').upload('test.txt', 'test.txt')

Expected behavior
No error

Screenshots
/

Desktop (please complete the following information):

  • Ubuntu
  • Python 3.9

Additional context
/

@anand2312
Copy link
Contributor

What version are you on? This was fixed in #72 and released in storage-py v0.5.2

@anand2312
Copy link
Contributor

Fixed in storage-py 0.5.2, and added upstream in supabase-py 1.0.2

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

No branches or pull requests

2 participants