TypeError: 'str' does not support buffer interface - python

I am currently doing an online Python series for puzzles, and I have a problem when you need to upload a pickled file. I read the documentation on it, but I kept getting

TypeError: 'str' does not support the buffer interface

... so I search on Google and come to the question of SO with a similar problem. The answer points to http://wiki.python.org/moin/UsingPickle .

I tried the code in the example and am I having the same problem? I am using Python 3.2.2. WTF ??

Complete Tracking:

Traceback (most recent call last):
  File "C:\foo.py", line 11, in <module>
    test1()
  File "C:\foo.py", line 9, in test1
    favorite_color = pickle.load( open( "save.p" ) )
TypeError: 'str' does not support the buffer interface

In the example: http://wiki.python.org/moin/UsingPickle

I have already successfully created save.p file with the first code example in the tutorial.

+5
source share
1

: favorite_color = pickle.load(open("save.p", "rb")).

+13

All Articles