Your error is typical of pickle file savek.p that exists, but is empty.
When I replace the actual pickle file contents with the following text:
When I replace the actual pickle file contents with the following text:
Lewis
When I replace the actual pickle file contents with the following text:
Output:xxx yyy zzz
the following Traceback error occurs:Error:Traceback (most recent call last):
File "Pickle-002.py", line 4, in <module>
favorite_yankees = pickle.load( open( "Pickle-001.p", "rb" ) )
_pickle.UnpicklingError: invalid load key, 'x'.
When I replace the actual pickle file contents with the following text:
Output:hello world
this is a corrupted pickle file
the following Traceback error occurs:Error:Traceback (most recent call last):
File "Pickle-002.py", line 4, in <module>
favorite_yankees = pickle.load( open( "Pickle-001.p", "rb" ) )
KeyError: 101
Please note that the pickle file has a non-ASCII (non utf-8) hex format that is not meant to be edited.Lewis
To paraphrase: 'Throw out your dead' code. https://www.youtube.com/watch?v=grbSQ6O6kbs Forward to 1:00