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

mac encoding error #48

Closed
SPlanzer opened this issue Feb 7, 2019 · 4 comments
Closed

mac encoding error #48

SPlanzer opened this issue Feb 7, 2019 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@SPlanzer
Copy link

SPlanzer commented Feb 7, 2019

Below error reported by user

In trying to load the plug-in into QGIS (v3.4.4) running on my Mac (v10.13.6) the error shown below is produced. It is a showstopper.


Couldn't load plugin 'linz-data-importer' due to an error when calling its initGui() method

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 607: ordinal not in range(128)

Traceback (most recent call last):
  File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 344, in startPlugin
    plugins[packageName].initGui()
  File "/Users/petersharris/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/linz-data-importer/linz_data_importer.py", line 285, in initGui
    about_html=file.read()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 607: ordinal not in range(128)
Python version: 3.6.6 (v3.6.6:4cf1f54eb7, Jun 26 2018, 17:02:57) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] QGIS version: 3.4.4-Madeira Madeira, exported

Python Path:

/Applications/QGIS3.app/Contents/MacOS/../Resources/python
/Users/petersharris/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users/petersharris/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
/Applications/QGIS3.app/Contents/MacOS/../Resources/python/plugins
/Library/Frameworks/SQLite3.framework/Versions/D/Python/3.6
/Library/Frameworks/Python.framework/Versions/3.6/lib/python36.zip
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
/Users/petersharris/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users/petersharris/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
/Users/petersharris/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/mmqgis/forms

The error is related to reading macrons in the about.html doc
about_html=file.read()

This is only related to osx. It has not be reported by the many linux and windows users (it would be, does not let the user use the plugin)

Solutions:

  • have an alternative doc without macrons that is read when this fails
    • But what about macrons in the capacities doc?
  • Review encoding (this was changed with the switch to python3).
@SPlanzer SPlanzer added the bug Something isn't working label Feb 7, 2019
@SPlanzer SPlanzer self-assigned this Feb 7, 2019
@stale
Copy link

stale bot commented Feb 12, 2019

This issue has been automatically marked as stale as there has not been any activity for sometime. The issue will be closed in 5 days if no further activity.

@stale stale bot added the Stale label Feb 12, 2019
@stale
Copy link

stale bot commented Feb 17, 2019

Closed by Stale Bot due to no activity on issue.

@stale stale bot closed this as completed Feb 17, 2019
@SPlanzer
Copy link
Author

still relevant

@SPlanzer
Copy link
Author

SPlanzer commented Feb 25, 2019

closed by #50

QGIS in mac is defaulting to ASCII even though it is using python3 that should default to utf-8. Python3 in the mac terminal is using utf-8

locale.getprefferedencoding(False)

Tests not updated as there is a test for this but it only affects osx. Only thing that could be done is build mac CI

Reading and importing of service data with utf-8 chars tested in mac also as part of this bug fix

SPlanzer pushed a commit that referenced this issue Feb 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant