Ticket #877 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

Encoding header in generated files is not PEP 0263 compliant.

Reported by: francis@… Owned by: andrew
Priority: minor Milestone: 1.0
Component: commands Version: 0.7.3
Keywords: Cc:


South's "manage.py datamigration" command generates Python files with the following header:
# encoding: utf-8

This header is not compliant with PEP 0263. I suggest changing it to
# -*- coding: utf-8 -*-
which is PEP 0263 compliant and also works in Emacs.

Change History

comment:2 Changed 4 years ago by kmike84@…

The existing header is PEP 0263 compliant because it matches 'coding[:=]\s*([-\w.]+)' regexp, the only issue here is Emacs.

comment:3 Changed 4 years ago by Francis Devereux <francis@…>

Sorry, you're right - I didn't read the PEP properly, I was looking at the examples in it and saw that what South generates isn't the same as any of the examples.
It would still be nice to have encoding headers that work in Emacs though.

comment:4 Changed 4 years ago by andrew

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone set to 1.0

I've pulled them anyway, no harm in changing the headers so it works with more things!

comment:5 Changed 4 years ago by Francis Devereux <francis@…>

Thanks :-)

Note: See TracTickets for help on using tickets.