Re: Very bizarre bug I've been stuck on for a week. please help

Sean Gillies


If you haven't done so already, check to see that you have the same versions of fiona and GDAL on your systems. Since there are no Windows wheels on the python package index, it would be easy to be running different versions. Another thing that commonly differs between Unix/Linux and Windows systems is default file encoding. Certain characters in your data could be fail to be processed in some cases. 

I see in your code that you are catching exceptions and then passing. I believe this explains the absence of properties. If you let those exceptions propagate all the way up you may get some more clues about what's going on.

On Mon, Feb 7, 2022, 2:50 PM <billybabis@...> wrote:
Hi there. I tried to simplify the code below as much as possible while still reproducing the error. 
Bug I'm facing:
It works on my mac laptop but when I try to run the same code on my windows VM, it only works half the time. That's correct: half the time the code works as expected.
What I'm trying to do:
I have a CSV of precipitation statistics for each county in the US (which I generated using a TIGER US county shapefile). Using that same TIGER US county shapefile, I'd like to add each county-level statistic as a property to each county in the shapefile. 
What's going wrong:
Half the time, nothing. It works as expected. Half the time, though, the new shapefile is created but none of the features have any properties. Either all features properly write the properties or none of the features have any properties. 
Of course, I can just run this code in a loop until it works as expected but obviously that is a terrible hack. Please help me try to debug what is going on here. I'm happy to attach the shapefile and csv but when I try to do so I'm told "Your message is too large"

Join to automatically receive all group messages.