]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Make IDLE's file decode more robust.
authorKurt B. Kaiser <kbk@shore.net>
Fri, 7 Sep 2007 05:06:21 +0000 (05:06 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Fri, 7 Sep 2007 05:06:21 +0000 (05:06 +0000)
commit44fa8f650f3a69318afe37874e82c6688f88e311
tree97c6429fe8eafeef30256becdd21a165f85e412f
parent504d8854176f1ee70ccb5784a2313575d420d519
Make IDLE's file decode more robust.
1. coding_spec() only looks at first two lines of bytes to avoid
   a UnicodeDecodeError if rest of file is e.g. latin-1
2. coding_spec() handles \n or \r
3. Clarify that locale_encoding is used by calling it that.  However, it's
   still called IOBinding.encoding in other parts of IDLE and that usage
   needs to be checked to verify that's still what is desired.
4. Return None from _decode() if decoding fails.
5. Name the vars representing bytes and strings or chars appropriately.
Lib/idlelib/IOBinding.py