Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

py_compile does not follow PEP 0263 #46190

Closed
jwilk mannequin opened this issue Jan 21, 2008 · 2 comments
Closed

py_compile does not follow PEP 0263 #46190

jwilk mannequin opened this issue Jan 21, 2008 · 2 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@jwilk
Copy link
Mannequin

jwilk mannequin commented Jan 21, 2008

BPO 1882
Nosy @birkenfeld, @jwilk

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2008-01-21.18:37:35.537>
created_at = <Date 2008-01-21.10:51:49.629>
labels = ['type-bug', 'library']
title = 'py_compile does not follow PEP 0263'
updated_at = <Date 2008-01-21.18:37:35.535>
user = 'https://github.com/jwilk'

bugs.python.org fields:

activity = <Date 2008-01-21.18:37:35.535>
actor = 'georg.brandl'
assignee = 'none'
closed = True
closed_date = <Date 2008-01-21.18:37:35.537>
closer = 'georg.brandl'
components = ['Library (Lib)']
creation = <Date 2008-01-21.10:51:49.629>
creator = 'jwilk'
dependencies = []
files = []
hgrepos = []
issue_num = 1882
keywords = []
message_count = 2.0
messages = ['61384', '61434']
nosy_count = 2.0
nosy_names = ['georg.brandl', 'jwilk']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue1882'
versions = ['Python 2.5', 'Python 2.4']

@jwilk
Copy link
Mannequin Author

jwilk mannequin commented Jan 21, 2008

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'

@jwilk jwilk mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jan 21, 2008
@birkenfeld
Copy link
Member

Thanks for the report, fixed in r60168, r60169 (2.5).

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant