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.

Title: No Module named ..." and UTF-8 Byte Order Marks
Type: Stage: resolved
Components: Versions:
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: Stephen_Tucker, steven.daprano
Priority: normal Keywords:

Created on 2019-10-03 12:10 by Stephen_Tucker, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg353841 - (view) Author: Stephen Tucker (Stephen_Tucker) Date: 2019-10-03 12:10

I am running Python 2.7.10 on Windows 10.

I have discovered that if a .py source text file (that is, a Module text
file) starts with a UTF-8 Byte Order Mark, the module does not get "found"
by the  import  statement.

I have just spent an inordinate amount of time reaching this conclusion.

I realise that 2.7.10 is probably not being supported any more, however,
please let me ask the questions anyway:

Could ...
   Either:   ... the error message please be more helpful? (Like, for
example,  "Module begins with a Byte Order Mark")
   Or:    ... the BOM be allowed at the start of a Module?


Stephen Tucker.
msg353859 - (view) Author: Steven D'Aprano (steven.daprano) * (Python committer) Date: 2019-10-03 15:41
False alarm, see Stephen Tucker's message here

File name has a trailing space which is why it wasn't found.
Date User Action Args
2022-04-11 14:59:21adminsetgithub: 82544
2019-10-03 15:41:03steven.dapranosetstatus: open -> closed

nosy: + steven.daprano
messages: + msg353859

resolution: works for me
stage: resolved
2019-10-03 12:10:17Stephen_Tuckercreate