Make encoding header Emacs friendly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ceilometer |
Fix Released
|
Low
|
Martin Geisler | ||
python-ceilometerclient |
Fix Released
|
Low
|
Unassigned |
Bug Description
The file encoding line serves a dual purpose: it informs both Python
and Emacs about the file encoding.
PEP 263 explains that a file with non-ASCII characters must specify an
encoding. Without an encoding line, importing the file will raise a
SyntaxError.
The problem is now that while Python will accept both of
-*- encoding: <some-encoding> -*-
-*- coding: <some-encoding> -*-
whereas Emacs only accepts the latter since it looks for a file
variable named "coding", not "encoding".
Setting a variable called "encoding" has at best no effect, but it can
result in Emacs prompting the user with
The local variable list in __init__.py contains values that may not
be safe.
when opening the file. This is because the "encoding" variable is not
whitelisted as a safe variable.
I've opened reviews for patches fixing this here:
https:/
https:/
Changed in ceilometer: | |
assignee: | nobody → Martin Geisler (mgeisler) |
status: | Triaged → In Progress |
Changed in ceilometer: | |
milestone: | none → juno-1 |
Changed in ceilometer: | |
status: | Fix Committed → Fix Released |
Changed in ceilometer: | |
milestone: | juno-1 → 2014.2 |
thanks for explanation. i have preference to remove that line... if not possible, then the change is fine with me.