On Fri, Jul 29, 2011 at 12:19 PM, Michael Weisman <[email protected]> wrote:
> Hi all,
> First of all, I realize that WorldMill hasn't been touched since 2007 or
> something and this issue may never be fixed.
> I am writing a command line utility that scans a directory of files with
> WorldMill to generate metadata from the schemas and geometries. If a
> workspace is created with a file that cannot be read by OGR, I get warnings
> about null pointers in OGR_DS_GetLayerCount and OGR_DS_Destroy (ERROR 10:
> Pointer 'hDS' is NULL in 'OGR_DS_GetLayerCount' and ERROR 10: Pointer 'hDS'
> is NULL in 'OGR_DS_Destroy') sent to stdout, and therefore onto the user's
> console. Is there any way to silence these warnings as they are mostly
> harmless for my uses, but somewhat scary for end users?
> You can reproduce this with the sample below:
> from mill import workspace
> w = workspace("/") # This of course assumes you don't have a shapefile or
> something in /
> w.collections
> Thanks,
> Michael

Hi Michael,

Short of modifying the OGR code, you probably have to tamper with
stdout during execution. Alex Martelli has some good advice at

  
http://stackoverflow.com/questions/2828953/silent-the-stdout-of-a-function-in-python-without-trashing-sys-stdout-and-restori

-- 
Sean Gillies
Programmer
Institute for the Study of the Ancient World
New York University
_______________________________________________
Community mailing list
[email protected]
http://lists.gispython.org/mailman/listinfo/community

Reply via email to