Skip to content

Commit

Permalink
Bugfix for Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
GeospatialPython committed Jun 22, 2015
1 parent ab050b8 commit 80b754e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ The Python __geo_interface__ convention provides a data interchange interface
among geospatial Python libraries. The interface returns data as GeoJSON.
More information on the __geo_interface__ protocol can be found at:
https://gist.github.com/sgillies/2217756.
More information on GeoJSON is available at http://geojson.org http://geojson.org.
More information on GeoJSON is available at http://geojson.org.

>>> s = sf.shape(0)
>>> s.__geo_interface__["type"]
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
from setuptools import setup

setup(name='pyshp',
version='1.2.2',
version='1.2.3',
description='Pure Python read/write support for ESRI Shapefile format',
long_description=open('README.txt').read(),
author='Joel Lawhead',
author_email='[email protected]',
url='https://github.com/GeospatialPython/pyshp',
download_url='https://github.com/GeospatialPython/pyshp/archive/1.2.2.tar.gz',
py_modules=['shapefile'],
license='MIT',
zip_safe=False,
Expand Down
13 changes: 8 additions & 5 deletions shapefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
shapefile.py
Provides read and write support for ESRI Shapefiles.
author: jlawhead<at>geospatialpython.com
date: 2015/01/09
version: 1.2.2
date: 2015/06/22
version: 1.2.3
Compatible with Python versions 2.4-3.x
version changelog: Added `Reader.iterShapeRecords` to help work with larger files
version changelog: Reader.iterShapeRecords() bugfix for Python 3
"""

__version__ = "1.2.2"
__version__ = "1.2.3"

from struct import pack, unpack, calcsize, error
import os
Expand Down Expand Up @@ -39,6 +39,9 @@

if PYTHON3:
xrange = range
izip = zip
else:
from itertools import izip

def b(v):
if PYTHON3:
Expand Down Expand Up @@ -571,7 +574,7 @@ def shapeRecords(self):
def iterShapeRecords(self):
"""Returns a generator of combination geometry/attribute records for
all records in a shapefile."""
for shape, record in itertools.izip(self.iterShapes(), self.iterRecords()):
for shape, record in izip(self.iterShapes(), self.iterRecords()):
yield _ShapeRecord(shape=shape, record=record)


Expand Down

0 comments on commit 80b754e

Please sign in to comment.