Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can python generate an error on comment?

I've already posed a question about this a few days ago. The question was unnoticed, I suppose, but the behavior is really strange so I'm trying to reduce it to simpler elements and asking again.

please look at this traceback:

Traceback (most recent call last):
  File "/home/m2user/webapps/enea/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 114, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/m2user/webapps/enea/local/lib/python2.7/site-packages/django/utils/decorators.py", line 99, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/m2user/webapps/enea/local/lib/python2.7/site-packages/django/views/generic/base.py", line 69, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/m2user/webapps/enea/local/lib/python2.7/site-packages/django/utils/decorators.py", line 29, in _wrapper
    return bound_func(*args, **kwargs)
  File "/home/m2user/webapps/enea/local/lib/python2.7/site-packages/django/utils/decorators.py", line 99, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/m2user/webapps/enea/local/lib/python2.7/site-packages/django/utils/decorators.py", line 25, in bound_func
    return func(self, *args2, **kwargs2)
  File "/home/m2user/webapps/enea/src/django-geojson/djgeojson/views.py", line 51, in dispatch
    return super(GeoJSONLayerView, self).dispatch(*args, **kwargs)
  File "/home/m2user/webapps/enea/local/lib/python2.7/site-packages/django/views/generic/base.py", line 87, in dispatch
    return handler(request, *args, **kwargs)
  File "/home/m2user/webapps/enea/local/lib/python2.7/site-packages/django/views/generic/list.py", line 153, in get
    return self.render_to_response(context)
  File "/home/m2user/webapps/enea/src/django-geojson/djgeojson/views.py", line 41, in render_to_response
    **options)
  File "/home/m2user/webapps/enea/src/django-geojson/djgeojson/serializers.py", line 335, in serialize
    self.serialize_object_list(queryset)
  File "/home/m2user/webapps/enea/src/django-geojson/djgeojson/serializers.py", line 277, in serialize_queryset
    self.start_object(obj)
  File "/home/m2user/webapps/enea/src/django-geojson/djgeojson/serializers.py", line 177, in handle_field
    if value is not None:
  File "/home/m2user/webapps/enea/src/django-geojson/djgeojson/serializers.py", line 159, in _handle_geom
    #logger.warn('%s != '%(self.srid, geometry.srid))
  File "/home/m2user/webapps/enea/local/lib/python2.7/site-packages/django/contrib/gis/geos/geometry.py", line 510, in transform
    raise GEOSException("Calling transform() with no SRID set is not supported")

how can line 159 generate such error? It's a comment!

What tried so far: I've deleted all .pyc files and restarted gunicorn before querying the view that generates this error. In source code (django-geojson lib) there is no other call to transform() function (I commented them all).

any ideas?

UPDATE: I was able to solve my issue by uninstalling and then re-installing all the libraries (as ubuntu packages), the python interpreter, all the code, by re-generating the database (including reinstalling postgis) and then by completely restart nginx (and thus gunicorn). No libraries were updated, however, so I still do not understand what really happened.

like image 992
furins Avatar asked Dec 06 '25 10:12

furins


1 Answers

You might want to go through the discussion here if you have not already. https://github.com/makinacorpus/django-geojson/pull/11

like image 88
Anup Avatar answered Dec 08 '25 01:12

Anup



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!