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

python3 py_compile does not ignore UTF-8 BOM characters #52415

Closed
ned-deily opened this issue Mar 18, 2010 · 3 comments
Closed

python3 py_compile does not ignore UTF-8 BOM characters #52415

ned-deily opened this issue Mar 18, 2010 · 3 comments
Labels
stdlib Python modules in the Lib dir

Comments

@ned-deily
Copy link
Member

BPO 8168
Nosy @benjaminp, @ned-deily, @koobs

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 2010-03-18.22:39:30.817>
created_at = <Date 2010-03-18.10:43:00.068>
labels = ['library']
title = 'python3 py_compile does not ignore UTF-8 BOM characters'
updated_at = <Date 2014-02-21.13:44:14.081>
user = 'https://github.com/ned-deily'

bugs.python.org fields:

activity = <Date 2014-02-21.13:44:14.081>
actor = 'koobs'
assignee = 'none'
closed = True
closed_date = <Date 2010-03-18.22:39:30.817>
closer = 'benjamin.peterson'
components = ['Library (Lib)']
creation = <Date 2010-03-18.10:43:00.068>
creator = 'ned.deily'
dependencies = []
files = []
hgrepos = []
issue_num = 8168
keywords = []
message_count = 3.0
messages = ['101257', '101288', '211859']
nosy_count = 3.0
nosy_names = ['benjamin.peterson', 'ned.deily', 'koobs']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue8168'
versions = ['Python 3.1', 'Python 3.2']

@ned-deily
Copy link
Member Author

$ cat bom3.py
# coding: utf-8
print("BOM BOOM!")
$ file bom3.py 
bom3.py: UTF-8 Unicode (with BOM) text
$ python3.1
Python 3.1.1+ (r311:74480, Jan 20 2010, 00:37:31) 
[GCC 4.4.3 20100108 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import bom3
BOM BOOM!
>>> import py_compile
>>> py_compile.compile("bom3.py")
  File "bom3.py", line 1
    # coding: utf-8
      ^
SyntaxError: invalid character in identifier

The same test does not fail with python2.6.4.
(Same results on OS X.)

@ned-deily ned-deily added the stdlib Python modules in the Lib dir label Mar 18, 2010
@benjaminp
Copy link
Contributor

Fixed in r79068.

@koobs
Copy link

koobs commented Feb 21, 2014

Breadcrumb: this was reported against 3.2 and 3.1, but never backported to the latter.

@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
Projects
None yet
Development

No branches or pull requests

3 participants