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.

Author mjpieters
Recipients mjpieters, paul.moore, steve.dower, tim.golden, zach.ware
Date 2016-08-19.07:37:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
To reproduce, create an ASCII file with > io.DEFAULT_BUFFER_SIZE bytes (can be blank lines) and *UNIX line endings*, with the first two lines reading:

  #!/usr/bin/env python
  # -*- coding: cp1252 -*-

Try to run this as a script on Windows:

     File "", line 2
    SyntaxError: encoding problem: cp1252

Converting the file to use CRLF (Windows) line endings makes the problem go away.

This appears to be a fallout from issue #20731.

Demo file that reproduces this issue at 710 bytes:

First reported by anatoly techtonik at
Date User Action Args
2016-08-19 07:38:02mjpieterssetrecipients: + mjpieters, paul.moore, tim.golden, zach.ware, steve.dower
2016-08-19 07:38:02mjpieterssetmessageid: <>
2016-08-19 07:38:02mjpieterslinkissue27797 messages
2016-08-19 07:37:57mjpieterscreate