Le mardi 28 juin 2011 à 16:02 +0200, M.-A. Lemburg a écrit : > How about a more radical change: have open() in Py3 default to > opening the file in binary mode, if no encoding is given (even > if the mode doesn't include 'b') ?
I tried your suggested change: Python doesn't start. sysconfig uses the implicit locale encoding to read sysconfig.cfg, the Makefile and pyconfig.h. I think that it is correct to use the locale encoding for Makefile and pyconfig.h, but maybe not for sysconfig.cfg. Python require more changes just to run "make". I was able to run "make" by using encoding='utf-8' in various functions (of distutils and setup.py). I didn't try the test suite, I expect too many failures. -- Then I tried my suggestion (use "utf-8" by default): Python starts correctly, I can build it (run "make") and... the full test suite pass without any change. (I'm testing on Linux, my locale encoding is UTF-8.) Victor _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com