Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#33794 closed Bug (fixed)

PostGISAdapter str() returns bytes

Reported by: Claude Paroz Owned by: Claude Paroz
Component: GIS Version: 4.1
Severity: Release blocker Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Commit [64c3f049ea3bcb1c] introduced a regression as PostGISAdapter str() implementation delegates to getquoted which returns now bytes.

Change History (6)

comment:1 by Mariusz Felisiak, 3 years ago

Triage Stage: UnreviewedAccepted

Thanks for the report. Does calling decode() in __str__() works for you?

  • django/contrib/gis/db/backends/postgis/adapter.py

    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 b class PostGISAdapter:  
    4242        return hash(self.ewkb)
    4343
    4444    def __str__(self):
    45         return self.getquoted()
     45        return self.getquoted().decode()
    4646
    4747    @classmethod
    4848    def _fix_polygon(cls, poly):

comment:2 by Mariusz Felisiak, 3 years ago

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

comment:3 by Claude Paroz, 3 years ago

Has patch: set

PR

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

in reply to:  3 comment:4 by Mariusz Felisiak, 3 years ago

Triage Stage: AcceptedReady for checkin

Replying to Claude Paroz:

PR

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

We've used the handbreak :)

comment:5 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

Resolution: fixed
Status: assignedclosed

In de74a74:

Fixed #33794 -- Fixed string-casting of GIS queries on PostgreSQL.

Regression in 64c3f049ea3bcb1c82f35ae09f1dd5349a826a5c.

comment:6 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

In 42e4b0e6:

[4.1.x] Fixed #33794 -- Fixed string-casting of GIS queries on PostgreSQL.

Regression in 64c3f049ea3bcb1c82f35ae09f1dd5349a826a5c.

Backport of de74a74b4b889c986cabab837bb03e2113880afe from main

Note: See TracTickets for help on using tickets.
Back to Top