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 pyscripter
Recipients pyscripter
Date 2007-12-22.05:17:13
SpamBayes Score 0.056272145
Marked as misclassified No
Message-id <1198300635.1.0.891509425639.issue1685@psf.upfronthosting.co.za>
In-reply-to
Content
linecache.updatecache works as follows after it finds a module name:

fp = open(fullname, 'rU')
lines = fp.readlines()
fp.close()

It then tries to detect a file encoding comment...

The problem is that readlines fails with a UnicodeDecodeError if the 
file is utf8 encoded, the preferred locale encoding is something else 
and the file contains characters that cannot be decoded.

Instead the function should:
a) read the raw data into a bytes object 
b)then search for a file encoding comment and
c)use one if found else use utf8 since this is not the default file 
encoding.
History
Date User Action Args
2007-12-22 05:17:15pyscriptersetspambayes_score: 0.0562721 -> 0.056272145
recipients: + pyscripter
2007-12-22 05:17:15pyscriptersetspambayes_score: 0.0562721 -> 0.0562721
messageid: <1198300635.1.0.891509425639.issue1685@psf.upfronthosting.co.za>
2007-12-22 05:17:14pyscripterlinkissue1685 messages
2007-12-22 05:17:13pyscriptercreate