comparison Python/pythonrun.c @ 47611:da47e7e135ae

#2630: Implement PEP 3138. The repr() of a string now contains printable Unicode characters unescaped. The new ascii() builtin can be used to get a repr() with only ASCII characters in it. PEP and patch were written by Atsuo Ishimoto.
author Georg Brandl <georg@python.org>
date Wed, 11 Jun 2008 18:37:52 +0000
parents e2eb70235392
children 2ee09afee126
comparison
equal deleted inserted replaced
47610:177f1aae3bb4 47611:da47e7e135ae
791 goto error; 791 goto error;
792 #endif 792 #endif
793 } 793 }
794 else { 794 else {
795 if (!(std = PyFile_FromFd(fd, "<stderr>", "w", -1, encoding, 795 if (!(std = PyFile_FromFd(fd, "<stderr>", "w", -1, encoding,
796 errors, "\n", 0))) { 796 "backslashreplace", "\n", 0))) {
797 goto error; 797 goto error;
798 } 798 }
799 } /* if (fd < 0) */ 799 } /* if (fd < 0) */
800 800
801 /* Same as hack above, pre-import stderr's codec to avoid recursion 801 /* Same as hack above, pre-import stderr's codec to avoid recursion