This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: py_compile does not follow PEP 0263
Type: behavior Stage:
Components: Library (Lib) Versions: Python 2.4, Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, jwilk
Priority: normal Keywords:

Created on 2008-01-21 10:51 by jwilk, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg61384 - (view) Author: Jakub Wilk (jwilk) Date: 2008-01-21 10:51
PEP 0263 allows an encoding declaration in the second line, but
py_compile seems not to recognize such ones:

>>> MODULE = "\n# encoding=UTF-8\nU = u'\xc3\xb3'\n"
>>> f = file('tmp.py', 'w')
>>> f.write(MODULE)
>>> f.close()
>>> from py_compile import compile
>>> compile('tmp.py', 'tmp_buggy.pyc', 'tmp_buggy.py', doraise = True)
>>> import tmp
>>> import tmp_buggy
>>> tmp.U
u'\xf3'
>>> tmp_buggy.U
u'\xc3\xb3'
msg61434 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-01-21 18:37
Thanks for the report, fixed in r60168, r60169 (2.5).
History
Date User Action Args
2022-04-11 14:56:30adminsetgithub: 46190
2008-01-21 18:37:35georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg61434
nosy: + georg.brandl
2008-01-21 10:51:49jwilkcreate