Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
Pickling dictionaries containing dictionaries: failing,recursion-style!
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="John Machin, post: 3163489"] The code that created the dictionary is interesting, but not very relevant. Please consider posting the code that is actually giving the error! The docs for pickle.load(file) say """ Read a string from the open file object file and interpret it as a pickle data stream, reconstructing and returning the original object hierarchy. This is equivalent to Unpickler(file).load(). file must have two methods, a read() method that takes an integer argument, and a readline() method that requires no arguments. Both methods should return a string. Thus file can be a file object opened for reading, a StringIO object, or any other custom object that meets this interface. """ The error message(s) [plural??] that you are getting suggest(s) that the argument that you supplied was *not* an open file object nor anything else with both a read and readline method. Open the file in binary mode ('rb') and pass the result to pickle.load. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
Pickling dictionaries containing dictionaries: failing,recursion-style!
Top