Opened 9 years ago

Closed 9 years ago

#26736 closed Bug (fixed)

SpatialReference crashes when initialized with WKT containining unicode characters

Reported by: Sergey Fedoseev Owned by: Sergey Fedoseev
Component: GIS Version: 1.8
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

from django.contrib.gis.db.backends.spatialite.models import SpatialiteSpatialRefSys as SpatialRefSys
from django.contrib.gis.gdal.srs import SpatialReference
SpatialReference(SpatialRefSys.objects.get(srid=187939).srtext)
/home/sergey/dev/django/django/contrib/gis/gdal/srs.py in __init__(self, srs_input, srs_type)
     58             # Encoding to ASCII if unicode passed in.
     59             if isinstance(srs_input, six.text_type):
---> 60                 srs_input = srs_input.encode('ascii')
     61             try:
     62                 # If SRID is a string, e.g., '4326', then make acceptable

UnicodeEncodeError: 'ascii' codec can't encode character u'\xdf' in position 34: ordinal not in range(128)

Change History (5)

comment:1 by Sergey Fedoseev, 9 years ago

Owner: changed from nobody to Sergey Fedoseev
Status: newassigned

comment:2 by Sergey Fedoseev, 9 years ago

Has patch: set

comment:3 by Tim Graham, 9 years ago

Triage Stage: UnreviewedAccepted

comment:4 by Tim Graham, 9 years ago

Summary: SpatialReference couldn't be initialized with WKT that contains unicode charactersSpatialReference crashes when initialized with WKT containining unicode characters
Triage Stage: AcceptedReady for checkin

comment:5 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: assignedclosed

In 6928ad18:

Fixed #26736 -- Fixed crashes in SpatialReference with non-ASCII characters.

Note: See TracTickets for help on using tickets.
Back to Top