Skip to content

fix : close file handles with context manager in Word-Building data.py #1842

Description

@tmdeveloper007

Summary of What Needs to be Done

The DataAdding function in games/Word-Building/data.py opens files without using a context manager, which can leave file handles unclosed if an exception occurs during the write operation.

Changes that Need to be Made

  • Wrap the read file handle in a with statement (context manager) in the DataAdding function
  • Wrap the write file handle in a with statement as well
  • Remove the manual file.close() calls since context managers handle this automatically

Impact that it would Provide

  • Prevents file handle leaks in error scenarios
  • Follows Python best practices for resource management
  • Makes the code more robust under exceptional conditions

Note: Please assign this issue to the tmdeveloper007 account.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions