[Django] #33794: PostGISAdapter str() returns bytes

29 views
Skip to first unread message

Django

unread,
Jun 21, 2022, 3:33:39 AM6/21/22
to django-...@googlegroups.com
#33794: PostGISAdapter str() returns bytes
-------------------------------------------+------------------------------
Reporter: Claude Paroz | Owner: Claude Paroz
Type: Bug | Status: assigned
Component: GIS | Version: 4.1
Severity: Release blocker | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------+------------------------------
Commit [64c3f049ea3bcb1c] introduced a regression as PostGISAdapter
`str()` implementation delegates to `getquoted` which returns now bytes.

--
Ticket URL: <https://code.djangoproject.com/ticket/33794>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 21, 2022, 3:42:15 AM6/21/22
to django-...@googlegroups.com
#33794: PostGISAdapter str() returns bytes
---------------------------------+----------------------------------------

Reporter: Claude Paroz | Owner: Claude Paroz
Type: Bug | Status: assigned
Component: GIS | Version: 4.1
Severity: Release blocker | 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 Mariusz Felisiak):

* stage: Unreviewed => Accepted


Comment:

Thanks for the report. Does calling `decode()` in `__str__()` works for
you?
{{{#!diff
diff --git a/django/contrib/gis/db/backends/postgis/adapter.py
b/django/contrib/gis/db/backends/postgis/adapter.py
index 0e02427811..20b0327d5c 100644
--- a/django/contrib/gis/db/backends/postgis/adapter.py
+++ b/django/contrib/gis/db/backends/postgis/adapter.py
@@ -42,7 +42,7 @@ class PostGISAdapter:
return hash(self.ewkb)

def __str__(self):
- return self.getquoted()
+ return self.getquoted().decode()

@classmethod
def _fix_polygon(cls, poly):
}}}

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

Django

unread,
Jun 21, 2022, 3:43:06 AM6/21/22
to django-...@googlegroups.com
#33794: PostGISAdapter str() returns bytes
---------------------------------+----------------------------------------
Reporter: Claude Paroz | Owner: Claude Paroz
Type: Bug | Status: assigned
Component: GIS | Version: 4.1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+----------------------------------------

Comment (by Mariusz Felisiak):

and great timing, today is the beta1 release day :D

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

Django

unread,
Jun 21, 2022, 3:55:26 AM6/21/22
to django-...@googlegroups.com
#33794: PostGISAdapter str() returns bytes
---------------------------------+----------------------------------------
Reporter: Claude Paroz | Owner: Claude Paroz
Type: Bug | Status: assigned
Component: GIS | Version: 4.1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+----------------------------------------
Changes (by Claude Paroz):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/15785 PR]

While writing the report, I hoped you didn't start the release :-)

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

Django

unread,
Jun 21, 2022, 4:13:16 AM6/21/22
to django-...@googlegroups.com
#33794: PostGISAdapter str() returns bytes
-------------------------------------+-------------------------------------

Reporter: Claude Paroz | Owner: Claude
| Paroz
Type: Bug | Status: assigned
Component: GIS | Version: 4.1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

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

* stage: Accepted => Ready for checkin


Comment:

Replying to [comment:3 Claude Paroz]:


> [https://github.com/django/django/pull/15785 PR]
>
> While writing the report, I hoped you didn't start the release :-)

We've used the handbreak :)

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

Django

unread,
Jun 21, 2022, 5:02:26 AM6/21/22
to django-...@googlegroups.com
#33794: PostGISAdapter str() returns bytes
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Claude
| Paroz
Type: Bug | Status: closed
Component: GIS | Version: 4.1
Severity: Release blocker | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"de74a74b4b889c986cabab837bb03e2113880afe" de74a74]:
{{{
#!CommitTicketReference repository=""
revision="de74a74b4b889c986cabab837bb03e2113880afe"
Fixed #33794 -- Fixed string-casting of GIS queries on PostgreSQL.

Regression in 64c3f049ea3bcb1c82f35ae09f1dd5349a826a5c.
}}}

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

Django

unread,
Jun 21, 2022, 5:02:29 AM6/21/22
to django-...@googlegroups.com
#33794: PostGISAdapter str() returns bytes
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Claude
| Paroz
Type: Bug | Status: closed
Component: GIS | Version: 4.1
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"42e4b0e608fb439ca98756546bbda1152f64c8b1" 42e4b0e6]:
{{{
#!CommitTicketReference repository=""
revision="42e4b0e608fb439ca98756546bbda1152f64c8b1"
[4.1.x] Fixed #33794 -- Fixed string-casting of GIS queries on PostgreSQL.

Regression in 64c3f049ea3bcb1c82f35ae09f1dd5349a826a5c.

Backport of de74a74b4b889c986cabab837bb03e2113880afe from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33794#comment:6>

Reply all
Reply to author
Forward
0 new messages