New submission from PyScripter: 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. ---------- components: Library (Lib) messages: 58958 nosy: pyscripter severity: normal status: open title: linecache .updatecache fails on utf8 encoded files versions: Python 3.0 __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1685> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com