[Django] #27088: GEOSGeometry should accept Python 2.7 memoryview

4 views
Skip to first unread message

Django

unread,
Aug 18, 2016, 2:07:24 PM8/18/16
to django-...@googlegroups.com
#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.

Django

unread,
Aug 18, 2016, 2:18:18 PM8/18/16
to django-...@googlegroups.com
#27088: GEOSGeometry should accept Python 2.7 memoryview
------------------------+------------------------------------

Reporter: carljm | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: 1.10
Severity: Normal | Resolution:
Keywords: py2 | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------+------------------------------------
Changes (by timgraham):

* keywords: => py2
* stage: Unreviewed => Accepted


Comment:

Patches accepted by January 2017 at which point we're dropping Python 2
support in master and could close this as wontfix.

--
Ticket URL: <https://code.djangoproject.com/ticket/27088#comment:1>

Django

unread,
Sep 10, 2016, 9:11:02 AM9/10/16
to django-...@googlegroups.com
#27088: GEOSGeometry should accept Python 2.7 memoryview
------------------------+------------------------------------

Reporter: carljm | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: 1.10
Severity: Normal | Resolution:
Keywords: py2 | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------+------------------------------------

Comment (by jtiai):

Documentation
https://docs.djangoproject.com/en/1.10/ref/contrib/gis/geos/#django.contrib.gis.geos.GEOSGeometry.wkb
at refers value type to be "Python buffer". Couldn't actually to find any
examples where buffer is used as an input so wonder how many would be
affected by the change.

--
Ticket URL: <https://code.djangoproject.com/ticket/27088#comment:2>

Django

unread,
Nov 5, 2016, 10:43:34 AM11/5/16
to django-...@googlegroups.com
#27088: GEOSGeometry should accept Python 2.7 memoryview
----------------------------+------------------------------------------
Reporter: Carl Meyer | Owner: Michał Ociepka
Type: Bug | Status: assigned
Component: GIS | Version: 1.10

Severity: Normal | Resolution:
Keywords: py2 | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+------------------------------------------
Changes (by Michał Ociepka):

* status: new => assigned
* owner: nobody => Michał Ociepka


--
Ticket URL: <https://code.djangoproject.com/ticket/27088#comment:3>

Django

unread,
Nov 5, 2016, 11:41:26 AM11/5/16
to django-...@googlegroups.com
#27088: GEOSGeometry should accept Python 2.7 memoryview
----------------------------+------------------------------------------
Reporter: Carl Meyer | Owner: Michał Ociepka
Type: Bug | Status: assigned
Component: GIS | Version: 1.10

Severity: Normal | Resolution:
Keywords: py2 | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
----------------------------+------------------------------------------
Changes (by Michał Ociepka):

* needs_better_patch: 0 => 1
* has_patch: 0 => 1


Comment:

https://github.com/django/django/pull/7503

--
Ticket URL: <https://code.djangoproject.com/ticket/27088#comment:4>

Django

unread,
Dec 1, 2016, 7:03:14 AM12/1/16
to django-...@googlegroups.com
#27088: GEOSGeometry should accept Python 2.7 memoryview
----------------------------+------------------------------------------
Reporter: Carl Meyer | Owner: Michał Ociepka
Type: Bug | Status: closed
Component: GIS | Version: 1.10
Severity: Normal | Resolution: wontfix

Keywords: py2 | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
----------------------------+------------------------------------------
Changes (by Tim Graham):

* status: assigned => closed
* resolution: => wontfix


Comment:

From the person who worked on the pull request, "There is not elegant way
to solve this issue. If Django drops support to python 3 it is pointless
to continue."

--
Ticket URL: <https://code.djangoproject.com/ticket/27088#comment:5>

Reply all
Reply to author
Forward
0 new messages