Code

Opened 3 years ago

Closed 3 years ago

#16375 closed Cleanup/optimization (wontfix)

PEP 0263 for generated project and apps

Reported by: wildfire Owned by: nobody
Component: Core (Other) Version: 1.3
Severity: Normal Keywords: UTF8
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hi,

I have recently been working with a developer who does not natively speak English. This is the first time using Python and Django and as soon as they entered non-Ascii information into the models and view files of their app., things broke.

Attached is a patch which puts the PEP 0263 heading (#encoding: utf-8) on files that both 'startapp' and 'startproject' generate.

Attachments (1)

LICENSE (1.5 KB) - added by wildfire 3 years ago.

Download all attachments as: .zip

Change History (4)

Changed 3 years ago by wildfire

comment:1 Changed 3 years ago by charettes

  • Has patch unset
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

I think you uploaded the wrong file.

In my not natively English speaking opinion I dont think that's the right approach for this issue.

First this is a python issue and second even if the header is provided for most used django-ish modules (models, tests, urls, ...) chances are that one will have to create another non automatically created module (i.e. forms.py, task.py) and will be left scratching his head since he never encountered this issue.

When I first encountered this issue, while i was learning python, I googled the exception and found the fix and explanations http://www.evanjones.ca/python-utf8.html in a matter of seconds.

I say keep it as it is.

comment:2 Changed 3 years ago by anonymous

  • Easy pickings unset

comment:3 Changed 3 years ago by aaugustin

  • Resolution set to wontfix
  • Status changed from new to closed

Since the templates don't contain non-ASCII characters, they don't need this header.

Django assumes developers know Python; if they don't, they should read a Python tutorial first.

Given that I'm the second person here to think it isn't a good idea, I will close the ticket.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.