Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 399417 - <dev-python/django-1.4: Bad geometry escape in PostGIS
Summary: <dev-python/django-1.4: Bad geometry escape in PostGIS
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL: https://code.djangoproject.com/ticket...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2012-01-19 19:36 UTC by Andy Botting
Modified: 2015-02-28 13:49 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for proper escaping in Django PostGIS adapter (postgis-adapter-2.patch,11.89 KB, patch)
2012-01-19 19:37 UTC, Andy Botting
Details | Diff
Improved escaping of PostgreSQL geometries (postgis-adapter-2.patch,1.20 KB, patch)
2013-02-07 19:27 UTC, Aaron W. Swenson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Botting 2012-01-19 19:36:34 UTC
When using Django with PostGIS, escaping of geometries fail when the postgresql setting 'standard_conforming_string' is set to on. postgresql versions earlier 9.1 would not see this bug, because the default setting for standard_conforming_string is off.

This patch (lifted from https://code.djangoproject.com/ticket/16778, all credits to the poster) fixes this issue with Django by fixing the escaping. 

The reply from the Django maintainers is that the patch won't be backported in the 1.3 series, so it would be great to get it added here.

For others to find, the postgresql error I received when encountering this bug was:
invalid byte sequence for encoding "UTF8": 0x00

Reproducible: Always
Comment 1 Andy Botting 2012-01-19 19:37:24 UTC
Created attachment 299331 [details, diff]
Patch for proper escaping in Django PostGIS adapter
Comment 2 Aaron W. Swenson gentoo-dev 2013-02-07 19:27:42 UTC
Created attachment 338268 [details, diff]
Improved escaping of PostgreSQL geometries

Attaching the actual patch to this bug instead of an entire HTML page.
Comment 3 Justin Lecher (RETIRED) gentoo-dev 2015-02-28 13:49:53 UTC
No version <1.4 in the tree. Please reopen if still exists.