[Django] #25479: Remove unncessary "# -*- coding: utf-8 -*-" declarations

11 views
Skip to first unread message

Django

unread,
Sep 28, 2015, 10:26:35 AM9/28/15
to django-...@googlegroups.com
#25479: Remove unncessary "# -*- coding: utf-8 -*-" declarations
------------------------------------------------+------------------------
Reporter: timgraham | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Other) | Version: master
Severity: Normal | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
------------------------------------------------+------------------------
PEP8 says, "Files using ASCII (in Python 2) or UTF-8 (in Python 3) should
not have an encoding declaration." In files like
`django/core/checks/__init__.py` which don't have non-ASCII characters, we
should remove `# -*- coding: utf-8 -*- `.

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

Django

unread,
Sep 28, 2015, 10:41:25 AM9/28/15
to django-...@googlegroups.com
#25479: Remove unncessary "# -*- coding: utf-8 -*-" declarations
--------------------------------------+------------------------------------

Reporter: timgraham | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Other) | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by aaugustin):

But it's annoying to have to add the declaration when one introduces a
non-ASCII character in a commit... What about adding this to the list of
cleanups when we drop Python 2?

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

Django

unread,
Sep 28, 2015, 10:53:45 AM9/28/15
to django-...@googlegroups.com
#25479: Remove unncessary "# -*- coding: utf-8 -*-" declarations
--------------------------------------+------------------------------------

Reporter: timgraham | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Other) | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by timgraham):

I haven't faced that annoyance myself. Instead I have asked many times
during a code review for an unnecessary encoding declaration to be removed
in a new file (often copied from an existing file where it's already not
needed, so I figured this would help eliminate that issue). I suppose the
removal can be automated when dropping Python 2, but we avoid some
unnecessary `git log` entries in new files where encoding is never
required between now and then. Anyway, if others are against ticket, I
won't debate further.

I did add it to the Python 2 cleanup ticket (#23919).

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

Django

unread,
Sep 28, 2015, 11:33:40 AM9/28/15
to django-...@googlegroups.com
#25479: Remove unncessary "# -*- coding: utf-8 -*-" declarations
--------------------------------------+------------------------------------

Reporter: timgraham | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Other) | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by claudep):

I think this is really a minor issue and we can live with that until we
drop Python 2.

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

Django

unread,
Sep 28, 2015, 11:34:23 AM9/28/15
to django-...@googlegroups.com
#25479: Remove unncessary "# -*- coding: utf-8 -*-" declarations
--------------------------------------+------------------------------------
Reporter: timgraham | Owner: nobody
Type: Cleanup/optimization | Status: closed

Component: Core (Other) | Version: master
Severity: Normal | Resolution: wontfix

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* status: new => closed
* resolution: => wontfix


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

Reply all
Reply to author
Forward
0 new messages