Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metasearch/QGIS3: failing view results as xml #23943

Closed
qgib opened this issue Jan 2, 2017 · 9 comments
Closed

Metasearch/QGIS3: failing view results as xml #23943

qgib opened this issue Jan 2, 2017 · 9 comments

Comments

@qgib
Copy link
Contributor

@qgib qgib commented Jan 2, 2017

Author Name: Richard Duivenvoorde (@rduivenvoorde)
Original Redmine Issue: 16028
Affected QGIS version: master
Redmine category:metasearch_catalogue_client
Assignee: Tom Kralidis


Trying out Metasearch here on current QGIS3 master, using the 'View search results as XML' give the error you see in the screenshot.

Probably something to do with python3 handling strings?

TypeError: a bytes-like object is required, not 'str' 
Traceback (most recent call last):
  File "/home/richard/bin/qgis_all/master/debug/share/qgis/python/plugins/MetaSearch/dialogs/maindialog.py", line 807, in show_xml
    request_html = highlight_xml(self.context, self.catalog.request)
  File "/home/richard/bin/qgis_all/master/debug/share/qgis/python/plugins/MetaSearch/util.py", line 128, in highlight_xml
    body = highlight(prettify_xml(xml), XmlLexer(), hformat)
  File "/home/richard/bin/qgis_all/master/debug/share/qgis/python/plugins/MetaSearch/util.py", line 113, in prettify_xml
    if xml.count('\
') > 5:  # likely already pretty printed
TypeError: a bytes-like object is required, not 'str'

Installed version: 0.3.4 (in /home/richard/bin/qgis_all/master/debug/share/qgis/python/plugins/MetaSearch)


@qgib

This comment has been minimized.

Copy link
Contributor Author

@qgib qgib commented Mar 5, 2017

Author Name: Tom Kralidis (@tomkralidis)


Richard: thanks for the info. Looks like MetaSearch needs a Python 2 to 3 migration.

@qgib

This comment has been minimized.

Copy link
Contributor Author

@qgib qgib commented Mar 5, 2017

Author Name: Tom Kralidis (@tomkralidis)


Richard: can you try master branch again? Should be fixed now.

@qgib

This comment has been minimized.

Copy link
Contributor Author

@qgib qgib commented Mar 6, 2017

Author Name: Giovanni Manghi (@gioman)


  • status_id was changed from Open to Feedback
@qgib

This comment has been minimized.

Copy link
Contributor Author

@qgib qgib commented Apr 3, 2017

Author Name: Richard Duivenvoorde (@rduivenvoorde)


Hi Tom,

A fresh compile/install today I get a owslib not found error. I thought that was included isn't it? I'm not aware of the need to install it separate?

ImportError: No module named 'owslib' 
Traceback (most recent call last):
  File "/home/richard/bin/qgis_all/master/debug/share/qgis/python/qgis/utils.py", line 337, in startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "/home/richard/bin/qgis_all/master/debug/share/qgis/python/plugins/MetaSearch/__init__.py", line 29, in classFactory
    from MetaSearch.plugin import MetaSearchPlugin
  File "/home/richard/bin/qgis_all/master/debug/share/qgis/python/qgis/utils.py", line 647, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/richard/bin/qgis_all/master/debug/share/qgis/python/plugins/MetaSearch/plugin.py", line 34, in 
    from MetaSearch.dialogs.maindialog import MetaSearchDialog
  File "/home/richard/bin/qgis_all/master/debug/share/qgis/python/qgis/utils.py", line 647, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/richard/bin/qgis_all/master/debug/share/qgis/python/plugins/MetaSearch/dialogs/maindialog.py", line 48, in 
    from owslib.csw import CatalogueServiceWeb
  File "/home/richard/bin/qgis_all/master/debug/share/qgis/python/qgis/utils.py", line 647, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: No module named 'owslib'

@qgib

This comment has been minimized.

Copy link
Contributor Author

@qgib qgib commented Apr 3, 2017

Author Name: Jürgen Fischer (@jef-n)


Richard Duivenvoorde wrote:

Hi Tom,

A fresh compile/install today I get a owslib not found error. I thought that was included isn't it? I'm not aware of the need to install it separate?

[...]

Not anymore. In qgis3 we only have pyspatialite in python/ext-libs - because our targets (for debian/ubuntu and osgeo4w) have more update version of the previously shipped internal copies and didn't use those anyway. Support in 2.18 was also trimmed, but has some more as that still supports jessie/trusty, which don't contain some of the dependencies or older dependencies than our internal copies.

@qgib

This comment has been minimized.

Copy link
Contributor Author

@qgib qgib commented Apr 29, 2017

Author Name: Giovanni Manghi (@gioman)


  • status_id was changed from Feedback to Open
@qgib

This comment has been minimized.

Copy link
Contributor Author

@qgib qgib commented Apr 30, 2017

Author Name: Tom Kralidis (@tomkralidis)


Should we close this ticket given the packaging issues are unrelated?


  • description was changed from Trying out Metasearch here on current QGIS3 master, using the 'View search results as XML' give the error you see in the screenshot.

Probably something to do with python3 handling strings?

TypeError: a bytes-like object is required, not 'str' 
Traceback (most recent call last):
  File "/home/richard/bin/qgis_all/master/debug/share/qgis/python/plugins/MetaSearch/dialogs/maindialog.py", line 807, in show_xml
    request_html = highlight_xml(self.context, self.catalog.request)
  File "/home/richard/bin/qgis_all/master/debug/share/qgis/python/plugins/MetaSearch/util.py", line 128, in highlight_xml
    body = highlight(prettify_xml(xml), XmlLexer(), hformat)
  File "/home/richard/bin/qgis_all/master/debug/share/qgis/python/plugins/MetaSearch/util.py", line 113, in prettify_xml
    if xml.count('\
') > 5:  # likely already pretty printed
TypeError: a bytes-like object is required, not 'str'

Installed version: 0.3.4 (in /home/richard/bin/qgis_all/master/debug/share/qgis/python/plugins/MetaSearch)
to Trying out Metasearch here on current QGIS3 master, using the 'View search results as XML' give the error you see in the screenshot.

Probably something to do with python3 handling strings?

TypeError: a bytes-like object is required, not 'str' 
Traceback (most recent call last):
  File "/home/richard/bin/qgis_all/master/debug/share/qgis/python/plugins/MetaSearch/dialogs/maindialog.py", line 807, in show_xml
    request_html = highlight_xml(self.context, self.catalog.request)
  File "/home/richard/bin/qgis_all/master/debug/share/qgis/python/plugins/MetaSearch/util.py", line 128, in highlight_xml
    body = highlight(prettify_xml(xml), XmlLexer(), hformat)
  File "/home/richard/bin/qgis_all/master/debug/share/qgis/python/plugins/MetaSearch/util.py", line 113, in prettify_xml
    if xml.count('\
') > 5:  # likely already pretty printed
TypeError: a bytes-like object is required, not 'str'

Installed version: 0.3.4 (in /home/richard/bin/qgis_all/master/debug/share/qgis/python/plugins/MetaSearch)

  • easy_fix was configured as 1
  • regression was configured as 1
@qgib

This comment has been minimized.

Copy link
Contributor Author

@qgib qgib commented May 1, 2017

Author Name: Giovanni Manghi (@gioman)


  • status_id was changed from Open to Feedback
  • priority_id was changed from Normal to High
@qgib qgib closed this May 26, 2017
@qgib

This comment has been minimized.

Copy link
Contributor Author

@qgib qgib commented May 26, 2017

Author Name: Giovanni Manghi (@gioman)


Closing for lack of feedback.


  • resolution was changed from to invalid
  • status_id was changed from Feedback to Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.