#31162: GIS error logging when using WKT string as input to filter() query. ------------------------+------------------------------------ Reporter: Arno | Owner: nobody Type: Bug | Status: new Component: GIS | Version: master Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 ------------------------+------------------------------------ Changes (by felixxm):
* type: Uncategorized => Bug * version: 2.2 => master * stage: Unreviewed => Accepted Comment: > According to https://docs.djangoproject.com/en/2.2/ref/contrib/gis/db- api/#geometry-lookups passing WKT strings is allowed, but there's no mention of being able to pass a filename as parameter. Thanks for this report. Django tries to use a `GDALRaster` if you pass `bytes` or `str` and if conversion is not successful then uses `GEOSGeometry`. `GDALRaster` accepts a string representing a file path. I agree that we should restore [https://github.com/django/django/commit/6f44f714c92d2966dca390ebd3054e5fb0bb0c80 #diff-6fa0bf748827a59b6730835b5439ded8L69-L70 the previous check] to avoid logging: {{{GDAL_ERROR 4: b'LINESTRING(0 0, 1 1, 5 5): No such file or directory'}}} We should also protect `GDALRaster._del__()` to avoid: {{{GDAL_ERROR 10: b"Pointer 'hObject' is NULL in 'GDALGetDescription'.}}} Maybe: {{{ @cached_property def is_vsi_based(self): return self._ptr and self.name.startswith(VSI_FILESYSTEM_BASE_PATH) }}} -- Ticket URL: <https://code.djangoproject.com/ticket/31162#comment:1> 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 unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.43ca3b8f65c9f69ac863692eb8c955ac%40djangoproject.com.