SyntaxError on py-execute-region
Bug #691542 reported by
Yuri Goncharov
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-mode.el |
Fix Released
|
Undecided
|
Andreas Roehler |
Bug Description
I got error:
SyntaxError: Non-ASCII character '\xd0' in file /temp/python-
There are patch:
diff -u orig/python-mode.el mod/python-mode.el
--- orig/python-mode.el 2009-01-29 22:34:59.000000000 +0300
+++ mod/python-mode.el 2010-12-17 16:15:54.088455001 +0300
@@ -1731,6 +1731,7 @@
(let ((needs-if (/= (py-point 'bol) (py-point 'boi))))
+ (insert "#-*- coding: utf-8 -*-\n")
(when needs-if
(insert "if 1:\n")
(setq py-line-
Related branches
lp:~a-roehler/python-mode/myrkwid
- python-mode.el developers: Pending requested
-
Diff: 5004 lines (+2516/-1849)5 files modifiedUnicodeEncodeError-lp:550661-test.py (+4/-0)
py-bug-numbered-tests.el (+738/-245)
python-mode-test.el (+202/-0)
python-mode-tests.sh (+88/-0)
python-mode.el (+1484/-1604)
Changed in python-mode: | |
assignee: | nobody → Andreas Roehler (a-roehler) |
Changed in python-mode: | |
status: | New → Confirmed |
Changed in python-mode: | |
status: | Confirmed → In Progress |
Changed in python-mode: | |
status: | In Progress → Fix Committed |
Changed in python-mode: | |
milestone: | none → 6.0 |
Changed in python-mode: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Hi Yuri,
don't think it's a python-mode bug.
As you're pointing to the pep, it's seems good to have the encoding declared.
BTW here my python-files always start with
#! /usr/bin/env python
# -*- coding: utf-8 -*-
However, providing this seems not the task of python-mode, it's at the user to decide.
Andreas