CMU-MS-DAS-Modern-Programming-Mini / ClassAssignmentNo3

Creative Commons Zero v1.0 Universal
0 stars 0 forks source link

Pickling error #8

Open jonathat22 opened 3 years ago

jonathat22 commented 3 years ago

When I try to use the pickle files to define Tuv, Vuv, etc in my test_SCF file, I get the following error:

ERROR tests/SCF/test_SCF.py - _pickle.UnpicklingError: invalid load key, '\x0a'.

I use:

Tuv = pickle.load(open("tuv.pkl", "rb")) to define Tuv, which is what some of my classmates have used to define their Tuv variables but I get the above error. I'm not sure what the cause is?

shots47s commented 3 years ago

Does it occur with the other files, or just that one? If only that one, I will try to recreate it and make sure it is not the file.

Are you on Windows / Linux / MacOS?

jonathat22 commented 3 years ago

It occurs with all of them. I'm on MacOS.

shots47s commented 3 years ago

Ok, try using just "r" rather than "rb".

jonathat22 commented 3 years ago

When I do that, I get this error now:

ERROR tests/SCF/test_SCF.py - UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0...

shots47s commented 3 years ago

Ok, can you drop into the python interpreter (just type python) and send me the output of:

import pickle
print(pickle.__version__)
jonathat22 commented 3 years ago

"AttributeError: module 'pickle' has no attribute 'version' "

shots47s commented 3 years ago

Well, that isn't helpful, ok working on a solution.

shots47s commented 3 years ago

Hmm, I cannot find a solution to this, which is troubling

I would need to take a look at it from your terminal, I cannot reproduce the error, and it doesn't appear others have the problem. You could try downloading the files directly from the website and see if that fixes it.

I can get on a quick Zoom with you to go over it if you like. If not, we can look at it in class tomorrow.

shots47s commented 3 years ago

@jonathat22, I added a new pkl file to the repo (you will need to sync upstream to get it) called "tuv_new.pkl", see if you can read that file with the "rb".

Let me know if that works, if it does, I will add the others.