The problem isn't the shapefile itself, it rather means any archive with non ascii character would break the upload.<br><br><signature>Sent from <a href="https://n1.nylas.com/link/e7ff7c3b032f46b6dd3e309f08c86d94b82f0f07cf9d80d8bdd823be6680ce06/0?redirect=https%3A%2F%2Fnylas.com%3Fref%3Dn1&recipient=geonode-users%40lists.osgeo.org">Nylas Mail</a>, the best free email app for work</signature><img class="n1-open" width="0" height="0" style="border:0; width:0; height:0;" src="https://n1.nylas.com/open/e7ff7c3b032f46b6dd3e309f08c86d94b82f0f07cf9d80d8bdd823be6680ce06?recipient=geonode-users%40lists.osgeo.org">
<div class="gmail_quote nylas-quote nylas-quote-id-063193338595257c6a3ccc989c011a84b8d17b69f3ea18870ead6e7e43f6e73a">
<br>
On lug 12 2017, at 10:53 pm, Stefan Steiniger <sstein@geo.uzh.ch> wrote:
<br>
<blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<meta content="text/html; charset=utf-8" />
<body bgcolor="#FFFFFF">
<p>perhaps not helpful, but would it not be easier to load the shape
in QGIS and save it as a new dataset with another encoding there?</p>
<p>..just wondering,<br />
</p>
<p>stefan<br />
</p>
<br />
<div>On 07/12/2017 04:34 PM, Francesco
Bartoli wrote:<br />
</div>
<blockquote type="cite">
<div style="max-width: 100%; font-family: Nylas-Pro, Helvetica,
"Lucidia Grande", sans-serif; font-size: 14.5px;">All,</div>
<div style="max-width: 100%; font-family: Nylas-Pro, Helvetica,
"Lucidia Grande", sans-serif; font-size: 14.5px;"><br />
</div>
<div style="max-width: 100%; font-family: Nylas-Pro, Helvetica,
"Lucidia Grande", sans-serif; font-size: 14.5px;">I'm
facing a common error while uploading an archived shapefile. The
file is the commonly used ne_50m_admin_0_countries.</div>
<div style="max-width: 100%; font-family: Nylas-Pro, Helvetica,
"Lucidia Grande", sans-serif; font-size: 14.5px;">The
error is well known also in django documentation and due to non
ascii characters:</div>
<div style="max-width: 100%; font-family: Nylas-Pro, Helvetica,
"Lucidia Grande", sans-serif; font-size: 14.5px;"><br />
</div>
<div style="max-width: 100%; font-family: Nylas-Pro, Helvetica,
"Lucidia Grande", sans-serif; font-size: 14.5px;"><a href="https://n1.nylas.com/link/df895d51a877f962a1d28456afd3ff6a2ad03f057079e07181a3bc641bd29713/0?redirect=https%3A%2F%2Fdocs.djangoproject.com%2Fen%2F1.8%2Fref%2Funicode%2F%23files&recipient=geonode-users%40lists.osgeo.org" title="https://docs.djangoproject.com/en/1.8/ref/unicode/#files" style="color: rgb(16, 129, 247);">https://docs.djangoproject.com/en/1.8/ref/unicode/#files</a><br />
</div>
<div style="max-width: 100%; font-family: Nylas-Pro, Helvetica,
"Lucidia Grande", sans-serif; font-size: 14.5px;"><br />
</div>
<div style="max-width: 100%; font-family: Nylas-Pro, Helvetica,
"Lucidia Grande", sans-serif; font-size: 14.5px;">
<div style="max-width: 100%;">Unfortunately the recommended
solution from the django docs for deployments with apache and
mod_wsgi </div>
<div style="max-width: 100%;"><br />
</div>
<div style="max-width: 100%;"><a href="https://n1.nylas.com/link/df895d51a877f962a1d28456afd3ff6a2ad03f057079e07181a3bc641bd29713/1?redirect=https%3A%2F%2Fdocs.djangoproject.com%2Fen%2F1.8%2Fhowto%2Fdeployment%2Fwsgi%2Fmodwsgi%2F&recipient=geonode-users%40lists.osgeo.org" title="https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/modwsgi/" style="color: rgb(16, 129, 247);">https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/modwsgi/</a></div>
<div style="max-width: 100%;"><br />
</div>
<div style="max-width: 100%;">doesn't solve the issue in centos
7. The box has been created while reviewing the installation
on that environment as per this PR <a href="https://n1.nylas.com/link/df895d51a877f962a1d28456afd3ff6a2ad03f057079e07181a3bc641bd29713/2?redirect=https%3A%2F%2Fgithub.com%2FGeoNode%2Fgeonode%2Fpull%2F3168&recipient=geonode-users%40lists.osgeo.org" title="https://github.com/GeoNode/geonode/pull/3168" style="color: rgb(16, 129, 247);">https://github.com/GeoNode/geonode/pull/3168</a><br />
</div>
<div style="max-width: 100%;"><br />
</div>
<div style="max-width: 100%;">
<div style="max-width: 100%;">It can be easily reproduced by
adding this view and route within geonode app:</div>
<div style="max-width: 100%;"><br />
</div>
<div style="max-width: 100%;">#my_views.py</div>
<div style="max-width: 100%;">import locale<br />
import sys<br />
from django.http import HttpResponse<br />
<br />
def view_locale(request):<br />
loc_info = "getlocale: " + str(locale.getlocale()) + \<br />
"<br/>getdefaultlocale(): " +
str(locale.getdefaultlocale()) + \<br />
"<br/>fs_encoding: " +
str(sys.getfilesystemencoding()) + \<br />
"<br/>sys default encoding: " +
str(sys.getdefaultencoding())<br />
return HttpResponse(loc_info)<br />
</div>
<div style="max-width: 100%;"><br />
</div>
<div style="max-width: 100%;">#urls.py</div>
<div style="max-width: 100%;">...</div>
<div style="max-width: 100%;">url(r'^locale/$',
'geonode.my_views.view_locale'),<br />
</div>
<div style="max-width: 100%;">...</div>
<div style="max-width: 100%;"><br />
</div>
<div style="max-width: 100%;">Result is always this:</div>
<div style="max-width: 100%;">getlocale: (None, None)<br style="color: rgb(0, 0, 0); font-family: Times; font-size:
medium;" />
getdefaultlocale(): ('en_US', 'UTF-8')<br style="color:
rgb(0, 0, 0); font-family: Times; font-size: medium;" />
fs_encoding: UTF-8<br style="color: rgb(0, 0, 0);
font-family: Times; font-size: medium;" />
<span style="font-weight: 600;">sys default encoding: ascii</span><br />
</div>
<div style="max-width: 100%;"><br />
</div>
<div style="max-width: 100%;">Setting the following variables
in /etc/sysconfig/httpd and restart as suggested</div>
<div style="max-width: 100%;"><br />
</div>
<div style="max-width: 100%;">export LANG="en_US.UTF-8"<br />
export LC_ALL="en_US.UTF-8"<br />
</div>
<div style="max-width: 100%;"><br />
</div>
<div style="max-width: 100%;">does not change anything in
particular the system default encoding which is the reason
why the upload is failing.</div>
<div style="max-width: 100%;"><br />
</div>
<div style="max-width: 100%;">Adding such variables to
WSGIDaemonProcess:</div>
<div style="max-width: 100%;"><br />
</div>
<div style="max-width: 100%;">WSGIDaemonProcess geonode
lang='en_US.UTF-8' locale='en_US.UTF-8'
python-path=/home/geonode/geonode:/home/geonode/.venvs/geonode/lib/python2.7/site-packages
user=apache threads=15 processes=2</div>
<div style="max-width: 100%;"><br />
</div>
<div style="max-width: 100%;">just affects the getlocale()
function while default encoding is unaltered. The only way
to affect it would be to add and enforce it:</div>
<div style="max-width: 100%;"><br />
</div>
<div style="max-width: 100%;">import sys</div>
<div style="max-width: 100%;">reload(sys)<br />
<a href="https://n1.nylas.com/link/df895d51a877f962a1d28456afd3ff6a2ad03f057079e07181a3bc641bd29713/3?redirect=sys.setdefaultencoding%28%27utf-8" title="sys.setdefaultencoding('utf-8" style="color:
rgb(16, 129, 247);">sys.setdefaultencoding('utf-8</a>')<br />
</div>
<div style="max-width: 100%;"><br />
</div>
<div style="max-width: 100%;">but this is strongly not
recommended and discouraged. More here <a href="https://n1.nylas.com/link/df895d51a877f962a1d28456afd3ff6a2ad03f057079e07181a3bc641bd29713/4?redirect=https%3A%2F%2Fanonbadger.wordpress.com%2F2015%2F06%2F16%2Fwhy-sys-setdefaultencoding-will-break-code%2F&recipient=geonode-users%40lists.osgeo.org" title="https://anonbadger.wordpress.com/2015/06/16/why-sys-setdefaultencoding-will-break-code/" style="color: rgb(16, 129, 247);">https://anonbadger.wordpress.com/2015/06/16/why-sys-setdefaultencoding-will-break-code/</a>.</div>
<div style="max-width: 100%;"><br />
</div>
<div style="max-width: 100%;">Did anyone already encounter
this kind of error? Actually I don't have a solution but for
sure it's not a bug in geonode code base despite I did not
figure out the real source.</div>
<div style="max-width: 100%;"><br />
</div>
<div style="max-width: 100%;">Any help and idea, how to
overcome it, is welcome :)</div>
<div style="max-width: 100%;"><br />
</div>
<div style="max-width: 100%;">thx</div>
<div style="max-width: 100%;">Francesco</div>
</div>
</div>
<br />
Sent from <a href="https://n1.nylas.com/link/df895d51a877f962a1d28456afd3ff6a2ad03f057079e07181a3bc641bd29713/5?redirect=https%3A%2F%2Fnylas.com%3Fref%3Dn1&recipient=geonode-users%40lists.osgeo.org">Nylas Mail</a>, the best free email app
for work<img style="border:0;
width:0; height:0;" src="https://n1.nylas.com/open/df895d51a877f962a1d28456afd3ff6a2ad03f057079e07181a3bc641bd29713" height="0" width="0" />
<br />
<fieldset></fieldset>
<br />
<pre>_______________________________________________
geonode-users mailing list
<a href="mailto:geonode-users@lists.osgeo.org">geonode-users@lists.osgeo.org</a>
<a href="https://lists.osgeo.org/mailman/listinfo/geonode-users?recipient=geonode-users%40lists.osgeo.org">https://lists.osgeo.org/mailman/listinfo/geonode-users</a>
</pre>
</blockquote>
<br />
</body>
<pre class="nylas-plaintext">_______________________________________________
geonode-users mailing list
geonode-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/geonode-users
</pre>
</blockquote>
</div>