• Guido van Rossum's avatar
    Provisional fix for writefile() [SF bug # 541730]. · f90d5292
    Guido van Rossum yazdı
    The problem was that an exception can occur in the text.get() call or
    in the write() call, when the text buffer contains non-ASCII
    characters.  This causes the previous contents of the file to be lost.
    
    The provisional fix is to call str(self.text.get(...)) *before*
    opening the file, so that if the exception occurs, we never open the
    file.
    
    Two orthogonal better solutions have to wait for policy decisions:
    
    1. We could try to encode the data as Latin-1 or as UTF-8; but that
       would require IDLE to grow a notion of file encoding which requires
       more thought.
    
    2. We could make backups before overwriting a file.  This requires
       more thought because it needs to be fast and cross-platform and
       configurable.
    f90d5292
Adı
Son kayıt (commit)
Son güncelleme
Demo Loading commit data...
Doc Loading commit data...
Grammar Loading commit data...
Include Loading commit data...
Lib Loading commit data...
Mac Loading commit data...
Misc Loading commit data...
Modules Loading commit data...
Objects Loading commit data...
PC Loading commit data...
PCbuild Loading commit data...
Parser Loading commit data...
Python Loading commit data...
RISCOS Loading commit data...
Tools Loading commit data...
.cvsignore Loading commit data...
.hgtags Loading commit data...
LICENSE Loading commit data...
Makefile.pre.in Loading commit data...
PLAN.txt Loading commit data...
README Loading commit data...
configure Loading commit data...
configure.in Loading commit data...
install-sh Loading commit data...
pyconfig.h.in Loading commit data...
setup.py Loading commit data...