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

check if underlying file object is closed in closed method #1249

Merged
merged 2 commits into from May 23, 2023

Conversation

jordancrane
Copy link
Contributor

@jordancrane jordancrane commented May 19, 2023

Currently it appears that S3Boto3StorageFile uses the closed property defined by FileProxyMixin, which checks the condition not self.file or self.file.closed (source). Since self.file in S3Boto3StorageFile is a property that delegates to _get_file, this check reopens the file. Thus closed always returns False.

@jschneier
Copy link
Owner

Thanks, can you fix the linting issue.

Also, let's add the beginnings of a test class for S3Boto3StorageFile that covers this fix.

@jschneier jschneier merged commit af91e2c into jschneier:master May 23, 2023
15 checks passed
@jschneier
Copy link
Owner

Thanks!

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.

None yet

2 participants