Skip to content

Commit 80b754e

Browse files
Bugfix for Python 3
1 parent ab050b8 commit 80b754e

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ The Python __geo_interface__ convention provides a data interchange interface
653653
among geospatial Python libraries. The interface returns data as GeoJSON.
654654
More information on the __geo_interface__ protocol can be found at:
655655
https://gist.github.com/sgillies/2217756.
656-
More information on GeoJSON is available at http://geojson.org http://geojson.org.
656+
More information on GeoJSON is available at http://geojson.org.
657657

658658
>>> s = sf.shape(0)
659659
>>> s.__geo_interface__["type"]

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
from setuptools import setup
22

33
setup(name='pyshp',
4-
version='1.2.2',
4+
version='1.2.3',
55
description='Pure Python read/write support for ESRI Shapefile format',
66
long_description=open('README.txt').read(),
77
author='Joel Lawhead',
88
author_email='[email protected]',
99
url='https://github.com/GeospatialPython/pyshp',
10+
download_url='https://github.com/GeospatialPython/pyshp/archive/1.2.2.tar.gz',
1011
py_modules=['shapefile'],
1112
license='MIT',
1213
zip_safe=False,

shapefile.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
shapefile.py
33
Provides read and write support for ESRI Shapefiles.
44
author: jlawhead<at>geospatialpython.com
5-
date: 2015/01/09
6-
version: 1.2.2
5+
date: 2015/06/22
6+
version: 1.2.3
77
Compatible with Python versions 2.4-3.x
8-
version changelog: Added `Reader.iterShapeRecords` to help work with larger files
8+
version changelog: Reader.iterShapeRecords() bugfix for Python 3
99
"""
1010

11-
__version__ = "1.2.2"
11+
__version__ = "1.2.3"
1212

1313
from struct import pack, unpack, calcsize, error
1414
import os
@@ -39,6 +39,9 @@
3939

4040
if PYTHON3:
4141
xrange = range
42+
izip = zip
43+
else:
44+
from itertools import izip
4245

4346
def b(v):
4447
if PYTHON3:
@@ -571,7 +574,7 @@ def shapeRecords(self):
571574
def iterShapeRecords(self):
572575
"""Returns a generator of combination geometry/attribute records for
573576
all records in a shapefile."""
574-
for shape, record in itertools.izip(self.iterShapes(), self.iterRecords()):
577+
for shape, record in izip(self.iterShapes(), self.iterRecords()):
575578
yield _ShapeRecord(shape=shape, record=record)
576579

577580

0 commit comments

Comments
 (0)