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 takluyver
Recipients docs@python, eric.araujo, takluyver, terry.reedy, vstinner
Date 2015-03-09.18:07:37
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1425924457.73.0.45422142325.issue11726@psf.upfronthosting.co.za>
In-reply-to
Content
Someone on reddit ran into this, expecting that linecache can be used for an arbitrary text file:
http://www.reddit.com/r/Python/comments/2yetxc/utf8_encoding_problems/

I was quite surprised that the docs say "allows one to get any line from any file." I've always understood that linecache is specifically for Python files, and the use of tokenize.open() means that it will only work for files that are UTF-8 or have the #coding: magic comment in the first two lines.

I think the docs should at least mention this; I'm happy to work on a patch for it at some point if people agree.
History
Date User Action Args
2015-03-09 18:07:37takluyversetrecipients: + takluyver, terry.reedy, vstinner, eric.araujo, docs@python
2015-03-09 18:07:37takluyversetmessageid: <1425924457.73.0.45422142325.issue11726@psf.upfronthosting.co.za>
2015-03-09 18:07:37takluyverlinkissue11726 messages
2015-03-09 18:07:37takluyvercreate