zhikrullah / pyshp

Automatically exported from code.google.com/p/pyshp
MIT License
0 stars 0 forks source link

Editor Constructor Doesn't Call Super #29

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The constructor for `Editor()` optionally takes a `shapefile` param. As 
currently written,

* If no `shapefile` specified, we call the `Writer()` super constructor as if 
we're creating a new shapefile
* If `shapefile` is specified by name, and it exists, we call the `Writer()` 
super constructor, and populate it with the contents of the shapefile read by a 
`Reader() ` instance
* If `shapefile` is specified by name but it does not exist, the `Writer()` 
super constructor is never called and the `_shapes`, `fields`, and `records` 
members never get initialized, causing things to blow up on the first call to 
`point()`.

Trivial patch attached to call the `Writer()` constructor in this case.

Original issue reported on code.google.com by david.ri...@myotisoft.com on 26 Feb 2012 at 2:43

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by jlawh...@gmail.com on 28 Feb 2012 at 5:24