Skip to content

Conversation

AbhiTheModder
Copy link
Member

Opening a file using with statement is preferred as function open implements the context manager protocol that releases the resource when it is outside of the with block. Not doing so requires you to manually release the resource.

Copy link
Contributor

deepsource-io bot commented May 1, 2024

Here's the code health analysis summary for commits 292ac91..a7a185c. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Shell LogoShell✅ SuccessView Check ↗
DeepSource Python LogoPython✅ Success
🎯 6 occurences resolved
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@AbhiTheModder AbhiTheModder changed the title File opened without the with statement Fix: File opened without the with statement and Re-defined variable from outer scope May 1, 2024
@AbhiTheModder AbhiTheModder marked this pull request as ready for review May 1, 2024 18:21
@AbhiTheModder AbhiTheModder merged commit 5d883b7 into main May 1, 2024
@AbhiTheModder AbhiTheModder deleted the abhi-with-open-fix branch May 1, 2024 18:22
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.

1 participant