#27088: GEOSGeometry should accept Python 2.7 memoryview
--------------------------------------+------------------------
Reporter: carljm | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
--------------------------------------+------------------------
Django's custom `django.util.six` module has its own `memoryview` alias
which is `buffer` on Py2 and `memoryview` on Py3, and `GEOSGeometry`
enforces that its input (if any kind of buffer) be an instance of
`django.util.six.memoryview`
(https://github.com/django/django/blob/master/django/contrib/gis/geos/geometry.py#L73).
However, Python 2.7 has backported the Py3 `memoryview` type, and its use
is preferred over Py2 `buffer` for cross-compatible code:
https://docs.python.org/2/c-api/buffer.html
`GEOSGeometry` should accept Py2 `memoryview` instances.
(For backwards-compatibility reasons, even though Python 2.7 is now the
minimum supported version, we probably can't remove
`django.util.six.memoryview` or change it to refer to `memoryview` on Py2,
because Py2 `buffer` and `memoryview` don't have fully compatible APIs.)
--
Ticket URL: <https://code.djangoproject.com/ticket/27088>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/049.e58281ce40003813ca569b5b6710c30c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.