[pycsw-devel] Error requesting iso

Tom Kralidis tomkralidis at gmail.com
Fri Jan 17 02:40:10 PST 2020


Hi Sophie: a fix has just been applied to master. We will have a bug fix release shortly. 

Thanks

..Tom


> On Nov 8, 2019, at 04:48, Sophie Herrmann <sophie.herrmann at eodc.eu> wrote:
> 
> 
> Hi Tom!
> 
> Thanks for the Info, I somehow completely missed this issue.
> 
> I'm running python3.6 and postgresql with postgis extension.
> 
> Best,
> Sophie
> From: Tom Kralidis <tomkralidis at gmail.com>
> Sent: Friday, November 8, 2019 1:30 AM
> To: Sophie Herrmann <sophie.herrmann at eodc.eu>
> Cc: pycsw-devel at lists.osgeo.org <pycsw-devel at lists.osgeo.org>
> Subject: Re: [pycsw-devel] Error requesting iso
>  
> Hi Sophie: thanks for the info.  There's an issue at [1] which has a patch
> that seems to work.  What version of Python are you using and what is
> your database backend?  Feel free to chime in on the ticket as well if you
> wish.
> 
> ..Tom
> 
> 
> [1] https://github.com/geopython/pycsw/issues/576#issuecomment-494138478
> 
> On Tue, Oct 29, 2019 at 12:06 PM Sophie Herrmann
> <sophie.herrmann at eodc.eu> wrote:
> >
> > Hello pycsw-team!
> >
> > I just set up pycsw locally, inserted some xmls and tried to retrieve them again (using getRecordById) and I got an error when requesting http://isotoc211.org/2005/gmd as outputSchema.
> >
> > In more detail I get the following error:
> > ...
> >   File "some/path/to/pycsw/pycsw/plugins/profiles/apiso/apiso.py", line 389, in write_record
> >     if caps is None and xml_blob is not None and xml_blob.startswith(b'<gmd:MD_Metadata'):
> > TypeError: startswith first arg must be str or a tuple of str, not bytes
> >
> > It seems that my xml_blob is of type string not bytes. I tried to understand where the object is coming from, and for what I see it's the unchanged
> > content of the xml  database column. I inserted xmls in iso format (see attachment) so I assume they are stored as they are in this database column.
> >
> > Coming back to the types, the xml column is of type text, so it makes sense that xml_blob is of type string. Following this idea I tried to use
> > '<gmd:MD_Metadata' instead of b'<gmd:MD_Metadata'. This works for me, so I get the expected xml.
> >
> > Do you understand why this is happening for me?
> >
> > Maybe also important: I'm using postgresql with postgis extension as a database.
> >
> > Thanks a lot for any help!
> > Best,
> > Sophie
> >
> > _______________________________________________
> > pycsw-devel mailing list
> > pycsw-devel at lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/pycsw-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pycsw-devel/attachments/20200117/488382be/attachment.html>


More information about the pycsw-devel mailing list