Simon Grantham added the comment: Thanks Ammar. Curiously, the comment I had put in my code was a note regarding usage and actually didn't contain the word "coding:" but the word "encoding:".
# curl -v --header "Transfer-Encoding: chunked" -d @somefile.txt "http://localhost:80/" Perhaps this is a slightly different kind of bug in that the interpreter doesn't regex /[^a-zA-Z]coding:/ . Or a documentation bug. ;) Simon On 1/10/2017 11:44 AM, Ammar Askar wrote: > Ammar Askar added the comment: > > This is because the "coding:" in a comment is a special syntax used to define > the encoding of the file. The only documentation I could find for it on the > official docs is a brief mention here: > https://docs.python.org/3/howto/unicode.html#the-string-type > > More details can be found on the PEP for it: > https://www.python.org/dev/peps/pep-0263/ > > The SyntaxError itself is not a bug, though I think the documentation for > this feature is certainly a little sparse. > > ---------- > nosy: +ammar2 > resolution: -> not a bug > stage: -> resolved > status: open -> closed > > _______________________________________ > Python tracker <rep...@bugs.python.org> > <http://bugs.python.org/issue29226> > _______________________________________ ---------- title: encoding comment generates a SyntaxError -> Comment generates syntax error _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29226> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com