lannymac / pyshp

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

can't write zeros to numeric fields #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The logic of line 808:

                if field[0] in recordDict:
                    val = recordDict[field[0]]
         -->        if val:
                        record.append(val)
                    else:
                        record.append("")

...doesn't allow the writing of zeros to numeric fields.

There may be a more robust way to do things, but 'if val != "":' works for me.

What steps will reproduce the problem?
1. try to write a zero to a numeric field

What version of the product are you using? On what operating system?
1.1.4 on winXP

Please provide any additional information below.
Thanks!

Original issue reported on code.google.com by lordv...@gmail.com on 16 Nov 2011 at 11:30

GoogleCodeExporter commented 9 years ago

Original comment by geospati...@gmail.com on 17 Nov 2011 at 3:18

GoogleCodeExporter commented 9 years ago
Patch.
{{{
                    if val is None:
                        record.append("")
                    else:
                        record.append(val)
}}}

Original comment by david.a....@gmail.com on 14 Jan 2012 at 8:55

GoogleCodeExporter commented 9 years ago
Please fix this simple but awful bug!

Original comment by david.ri...@myotisoft.com on 25 Feb 2012 at 10:15

GoogleCodeExporter commented 9 years ago
Very annoying issue for an awesome python package.

Original comment by codyalan...@gmail.com on 29 Oct 2012 at 8:03

GoogleCodeExporter commented 9 years ago
Fixed in version 1.1.7

Original comment by geospati...@gmail.com on 23 Jun 2013 at 7:43