Can't figure out this error message "db type could not be determined"

You forgot to include:

fstooges.close()

from your last open pair. You are attempting to open a file that is already open.

It is better to use the with / open file context manager so that you don’t run into this problem. Once executing the body statements, it will automatically close the file for you even in the event when there are exceptions (i.e., errors).

Something like this:

with open(“3 Stooges.dat”, “rb”) as fstooges:
    pickle.dump(stooges, fstooges)
    pickle.dump(adj, fstooges)

with open(“3 Stooges.dat”, “rb”) as fstooges:
    stooges = pickle.load(fstooges)
    print(stooges)

Here is a Youtube tutorial on this subject that may be helpful:

What is the purpose of the last line?:

fstooges = shelve.open(“3 Stooges.dat”)  

You open the file without accompanying body statements or closing file statement - it just hangs there.