Skip to content

fix : replaced pickle with json and added context managers in Word-Building data.py - #1883

Open
tmdeveloper007 wants to merge 1 commit into
steam-bell-92:mainfrom
tmdeveloper007:#1878
Open

fix : replaced pickle with json and added context managers in Word-Building data.py#1883
tmdeveloper007 wants to merge 1 commit into
steam-bell-92:mainfrom
tmdeveloper007:#1878

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Summary of What Has Been Done

Replaced all pickle operations with json in games/Word-Building/data.py and added proper context managers for all file operations. Also wrapped the module-level file reading in a helper function with error handling.

Changes Made

  • games/Word-Building/data.py:
    • Replaced import pickle with import json
    • Created _load_words() helper function with try/except and context managers
    • Created _save_words() helper function with context managers
    • Refactored DataAdding() to use the helper functions
    • Changed file extension from .bat to .json for the data file
    • Module-level code now uses the _load_words() helper instead of bare pickle.load()

Impact it Made

Improved security (no pickle deserialization vulnerabilities), proper resource cleanup via context managers, and safe module imports even if the data file is corrupted or missing.

Note: Please assign this PR to the tmdeveloper007 account.

@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

@tmdeveloper007 is attempting to deploy a commit to the Anuj's projects Team on Vercel.

A member of the Team first needs to authorize it.

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