I am trying to follow the example at https://code.google.com/p/pyshp/wiki/ShapeRecords by entering the following code:
import shapefile
r = shapefile.Reader("ne_110m_admin_0_countries")
sr = r.shapeRecords()
However, it gives this error-message under Python 3,3 64 bit on Windows 7:
Traceback (most recent call last):
File "D:\stuff\beispiel1.py", line 3, in <module>
sr = r.shapeRecords()
File "C:\Python33\lib\site-packages\shapefile.py", line 553, in shapeRecords
for rec in zip(self.shapes(), self.records())]
File "C:\Python33\lib\site-packages\shapefile.py", line 525, in records
r = self.__record()
File "C:\Python33\lib\site-packages\shapefile.py", line 501, in __record
value = u(value)
File "C:\Python33\lib\site-packages\shapefile.py", line 60, in u
return v.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf4 in position 1: invalid continuation byte
What am I doing wrong?
Today I received an email from the developer of pyshp, Mr. Joel Lawhead. The problem I mentioned was a bug, which only occurs, when you use python vers 3.x . python vers. 2.x was not affected. He sent me a patched version, which works fine for me. He also told me, that this new version will be released soon.