[Django] #32859: Simplify django.utils.text.compress_string by using gzip.compress

15 views
Skip to first unread message

Django

unread,
Jun 17, 2021, 12:34:23 PM6/17/21
to django-...@googlegroups.com
#32859: Simplify django.utils.text.compress_string by using gzip.compress
-------------------------------------+-------------------------------------
Reporter: Illia | Owner: Illia Volochii
Volochii |
Type: | Status: assigned
Cleanup/optimization |
Component: Utilities | Version: dev
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
[https://docs.python.org/3/library/gzip.html#gzip.compress gzip.compress]
can replace the custom logic defined in
[https://github.com/django/django/blob/225d96533a8e05debd402a2bfe566487cc27d95f/django/utils/text.py#L286-L289
django.utils.text.compress_string].
Actually, the function works in the same way under the hood.

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

Django

unread,
Jun 18, 2021, 4:30:38 AM6/18/21
to django-...@googlegroups.com
#32859: Simplify django.utils.text.compress_string by using gzip.compress
-------------------------------------+-------------------------------------
Reporter: Illia Volochii | Owner: Illia
Type: | Volochii
Cleanup/optimization | Status: assigned
Component: Utilities | Version: dev
Severity: Normal | 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 Carlton Gibson):

* has_patch: 0 => 1
* stage: Unreviewed => Accepted


Comment:

OK, I didn't fully review yet, but this looks right at first glance. (The
blame on our version is ''quite old'' — looks like this has been there
since day one.)

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

Django

unread,
Jun 21, 2021, 7:20:48 AM6/21/21
to django-...@googlegroups.com
#32859: Simplify django.utils.text.compress_string by using gzip.compress
-------------------------------------+-------------------------------------
Reporter: Illia Volochii | Owner: Illia
Type: | Volochii
Cleanup/optimization | Status: assigned
Component: Utilities | Version: dev
Severity: Normal | 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


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

Django

unread,
Jun 21, 2021, 7:42:07 AM6/21/21
to django-...@googlegroups.com
#32859: Simplify django.utils.text.compress_string by using gzip.compress
-------------------------------------+-------------------------------------
Reporter: Illia Volochii | Owner: Illia
Type: | Volochii
Cleanup/optimization | Status: closed
Component: Utilities | Version: dev
Severity: Normal | 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:"5a468b4c085900ba28b7f8dfa2cb0b50d7699aa6" 5a468b4c]:
{{{
#!CommitTicketReference repository=""
revision="5a468b4c085900ba28b7f8dfa2cb0b50d7699aa6"
Fixed #32859 -- Simplified compress_string() by using gzip.compress().
}}}

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

Reply all
Reply to author
Forward
0 new messages