You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pickle closed-file loading test exercises dumping instead of loading #159361
In Lib/test/pickletester.py, test_load_closed_file calls self.dump, duplicating test_dump_closed_file instead of exercising self.load on a closed file.
The existing assertion is:
self.assertRaises(ValueError, self.dump, 123, f)
The loading test should open a readable binary file, close it, and assert that self.load(f) raises ValueError. This restores coverage of the intended failure path for both Python and C pickle implementations.
Verified on CPython main at 9ed41860b411144dbb6d2e4f53489d432364fd19: the corrected cases pass with the real loaders and fail when the loaders are replaced with no-ops. The complete test_pickle module passed on a Windows debug build.
Activity
pythongh-159361: Add NEWS entry for pickle-closed-load-test
pythongh-159361: Omit NEWS for test-only changes