#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 <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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018185363b8d-d27b70c1-a815-4257-90d0-1cbc97f17a1d-000000%40eu-central-1.amazonses.com.

Reply via email to