[Django] #36247: BaseGeometryWidget unncessarily writes an error log when deserializing malformed geometry

16 views
Skip to first unread message

Django

unread,
Mar 11, 2025, 6:02:45 PMMar 11
to django-...@googlegroups.com
#36247: BaseGeometryWidget unncessarily writes an error log when deserializing
malformed geometry
-------------------------------------+-------------------------------------
Reporter: David Buhler | Type:
| Cleanup/optimization
Status: new | Component: GIS
Version: 4.2 | 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
-------------------------------------+-------------------------------------
The following bit of error logging happens during deserialization of
malformed geometry:

https://github.com/django/django/blob/stable/4.2.x/django/contrib/gis/forms/widgets.py#L55

I believe this is more appropriate as a warning or debug log as returning
a None value will result in a validation error rather than a failed
request. This will create noise when looking for error logs that need to
be actioned on.

This also impacts the 5.2.x branch.
--
Ticket URL: <https://code.djangoproject.com/ticket/36247>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 12, 2025, 4:04:21 AMMar 12
to django-...@googlegroups.com
#36247: BaseGeometryWidget unncessarily writes an error log when deserializing
malformed geometry
-------------------------------------+-------------------------------------
Reporter: David Buhler | Owner: (none)
Type: | Status: new
Cleanup/optimization |
Component: GIS | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* cc: Claude Paroz (added)

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

Django

unread,
Mar 12, 2025, 4:36:08 AMMar 12
to django-...@googlegroups.com
#36247: BaseGeometryWidget unncessarily writes an error log when deserializing
malformed geometry
-------------------------------------+-------------------------------------
Reporter: David Buhler | Owner: (none)
Type: | Status: new
Cleanup/optimization |
Component: GIS | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Claude Paroz):

I'm fine with the idea to change the log severity to warning or debug.
--
Ticket URL: <https://code.djangoproject.com/ticket/36247#comment:2>

Django

unread,
Mar 12, 2025, 6:07:40 AMMar 12
to django-...@googlegroups.com
#36247: BaseGeometryWidget unncessarily writes an error log when deserializing
malformed geometry
--------------------------------------+------------------------------------
Reporter: David Buhler | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: GIS | Version: 4.2
Severity: Normal | 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 Sarah Boyce):

* stage: Unreviewed => Accepted

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

Django

unread,
Mar 12, 2025, 11:22:34 AMMar 12
to django-...@googlegroups.com
#36247: BaseGeometryWidget unncessarily writes an error log when deserializing
malformed geometry
-------------------------------------+-------------------------------------
Reporter: David Buhler | Owner: hesham
Type: | hatem
Cleanup/optimization | Status: assigned
Component: GIS | Version: 4.2
Severity: Normal | 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 hesham hatem):

* owner: (none) => hesham hatem
* status: new => assigned

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

Django

unread,
Mar 12, 2025, 5:07:41 PMMar 12
to django-...@googlegroups.com
#36247: BaseGeometryWidget unncessarily writes an error log when deserializing
malformed geometry
-------------------------------------+-------------------------------------
Reporter: David Buhler | Owner: hesham
Type: | hatem
Cleanup/optimization | Status: assigned
Component: GIS | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* has_patch: 0 => 1
* needs_docs: 0 => 1
* needs_tests: 0 => 1
* version: 4.2 => dev

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

Django

unread,
Mar 13, 2025, 4:02:00 PMMar 13
to django-...@googlegroups.com
#36247: BaseGeometryWidget unncessarily writes an error log when deserializing
malformed geometry
-------------------------------------+-------------------------------------
Reporter: David Buhler | Owner: hesham
Type: | hatem
Cleanup/optimization | Status: assigned
Component: GIS | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by David Buhler):

Hey folks, thanks for picking this up. Is there any chance this will make
it into a 5.2.x release?
--
Ticket URL: <https://code.djangoproject.com/ticket/36247#comment:6>

Django

unread,
Mar 14, 2025, 7:35:50 AMMar 14
to django-...@googlegroups.com
#36247: BaseGeometryWidget unncessarily writes an error log when deserializing
malformed geometry
-------------------------------------+-------------------------------------
Reporter: David Buhler | Owner: hesham
Type: | hatem
Cleanup/optimization | Status: assigned
Component: GIS | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Natalia Bidart):

Replying to [comment:6 David Buhler]:
> Hey folks, thanks for picking this up. Is there any chance this will
make it into a 5.2.x release?

Hello David, this change will be available, once merged, in `main` and in
`6.0` and higher. The `5.2` series is currently at beta status so only
bugs introduced during the `5.2` development cycle are backported. The
code referenced by this ticket is 10-12 years old so it will not receive
backports (this is the [https://docs.djangoproject.com/en/dev/internals
/release-process/ documented backport policy]).
--
Ticket URL: <https://code.djangoproject.com/ticket/36247#comment:7>

Django

unread,
Mar 17, 2025, 12:22:55 PMMar 17
to django-...@googlegroups.com
#36247: BaseGeometryWidget unncessarily writes an error log when deserializing
malformed geometry
-------------------------------------+-------------------------------------
Reporter: David Buhler | Owner: hesham
Type: | hatem
Cleanup/optimization | Status: assigned
Component: GIS | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by hesham hatem):

* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/36247#comment:8>

Django

unread,
Mar 17, 2025, 1:57:52 PMMar 17
to django-...@googlegroups.com
#36247: BaseGeometryWidget unncessarily writes an error log when deserializing
malformed geometry
-------------------------------------+-------------------------------------
Reporter: David Buhler | Owner: hesham
Type: | hatem
Cleanup/optimization | Status: assigned
Component: GIS | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* stage: Ready for checkin => Accepted

Comment:

Hello Hesham! I need to kindly ask you to please read the
[https://docs.djangoproject.com/en/dev/internals/contributing/writing-code
/submitting-patches/#contribution-checklist contributing checklist] docs
carefully as they state that:

> If the pull request passes all the criteria below **and is not your
own**, please set the “Triage Stage” on the corresponding Trac ticket to
“Ready for checkin”.

Special attention to "and is not your own". You should not set your own PR
was ready for checkin. This will be done by a reviewer once your PR is
reviewed and approved. When I mentioned in another PR that you need to
update the ticket flags, this is not the ticket "Triage Stage", but the
booleans "has patch", "patch needs improvement" and "needs tests". I hope
this makes sense!
--
Ticket URL: <https://code.djangoproject.com/ticket/36247#comment:9>

Django

unread,
Mar 17, 2025, 3:46:39 PMMar 17
to django-...@googlegroups.com
#36247: BaseGeometryWidget unncessarily writes an error log when deserializing
malformed geometry
-------------------------------------+-------------------------------------
Reporter: David Buhler | Owner: hesham
Type: | hatem
Cleanup/optimization | Status: assigned
Component: GIS | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by hesham hatem):

Oh, I see! I sincerely apologize for the misunderstanding. I appreciate
you taking the time to explain this, and I’ll be more careful to follow
the correct process in the future. Thank you for your patience and
guidance!
--
Ticket URL: <https://code.djangoproject.com/ticket/36247#comment:10>

Django

unread,
Mar 19, 2025, 9:14:25 AMMar 19
to django-...@googlegroups.com
#36247: BaseGeometryWidget unncessarily writes an error log when deserializing
malformed geometry
-------------------------------------+-------------------------------------
Reporter: David Buhler | Owner: hesham
Type: | hatem
Cleanup/optimization | Status: assigned
Component: GIS | 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 hesham hatem):

* needs_docs: 1 => 0
* needs_tests: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/36247#comment:11>

Django

unread,
Mar 25, 2025, 8:02:46 AMMar 25
to django-...@googlegroups.com
#36247: BaseGeometryWidget unncessarily writes an error log when deserializing
malformed geometry
-------------------------------------+-------------------------------------
Reporter: David Buhler | Owner: hesham
Type: | hatem
Cleanup/optimization | Status: assigned
Component: GIS | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/36247#comment:12>
Reply all
Reply to author
Forward
0 new messages