#18640: django.contrib.gis.gdal.DataSource fields give gibberish or segfault
when
accessed directly
-------------------------------+--------------------
Reporter: YenTheFirst | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.4
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
if you hold a feature in a variable, and access a field, it will give the
correct value.
however, if you access a feature's field by layer[<index>][<field_name>],
it gives gibberish, or a segfault.
this might be related to https://code.djangoproject.com/ticket/9448.
however, given that the ticket was closed, it might be a different issue.
script to reproduce issue:
{{{
import os
import django.contrib.gis
from django.contrib.gis.gdal import DataSource
GIS_PATH = os.path.dirname(django.contrib.gis.__file__)
CITIES_PATH = os.path.join(GIS_PATH, 'tests/data/cities/cities.shp')
ds = DataSource(CITIES_PATH)
layer = ds[0]
feature = layer[0]
field = feature['Name']
print "this is valid: %r (%r)" % (field.value, list(field.value))
field = layer[0]['Name']
print "but this isn't: %r (%r)" % (field.value, list(field.value))
}}}
in python, results in segfault.
in ipython:
this is valid: 'Pueblo' (['P', 'u', 'e', 'b', 'l', 'o'])
but this isn't: ':\xd5\xe2=\xb1\xb4\xb9\xb4Q' ([':', '\xd5', '\xe2', '=',
'\xb1', '\xb4', '\xb9', '\xb4', 'Q'])
saved as script, results in:
this is valid: 'Pueblo' (['P', 'u', 'e', 'b', 'l', 'o'])
but this isn't: '' ([])
this is on an ubuntu 11.04, with django 1.4, and gdal 1.7
--
Ticket URL: <https://code.djangoproject.com/ticket/18640>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.