comparison Python/pythonrun.c @ 44134:e08b12c3b913

Add an errors parameter to open() and TextIOWrapper() to specify error handling.
author Guido van Rossum <guido@python.org>
date Mon, 03 Dec 2007 22:54:21 +0000
parents f324631462a2
children ef5399b353c9
comparison
equal deleted inserted replaced
44130:ead7a053f5b4 44134:e08b12c3b913
768 #else 768 #else
769 goto error; 769 goto error;
770 #endif 770 #endif
771 } 771 }
772 else { 772 else {
773 if (!(std = PyFile_FromFd(fd, "<stdin>", "r", -1, NULL, 773 if (!(std = PyFile_FromFd(fd, "<stdin>", "r", -1, NULL, NULL,
774 "\n", 0))) { 774 "\n", 0))) {
775 goto error; 775 goto error;
776 } 776 }
777 } /* if (fd < 0) */ 777 } /* if (fd < 0) */
778 PySys_SetObject("__stdin__", std); 778 PySys_SetObject("__stdin__", std);
788 #else 788 #else
789 goto error; 789 goto error;
790 #endif 790 #endif
791 } 791 }
792 else { 792 else {
793 if (!(std = PyFile_FromFd(fd, "<stdout>", "w", -1, NULL, 793 if (!(std = PyFile_FromFd(fd, "<stdout>", "w", -1, NULL, NULL,
794 "\n", 0))) { 794 "\n", 0))) {
795 goto error; 795 goto error;
796 } 796 }
797 } /* if (fd < 0) */ 797 } /* if (fd < 0) */
798 PySys_SetObject("__stdout__", std); 798 PySys_SetObject("__stdout__", std);
809 #else 809 #else
810 goto error; 810 goto error;
811 #endif 811 #endif
812 } 812 }
813 else { 813 else {
814 if (!(std = PyFile_FromFd(fd, "<stderr>", "w", -1, NULL, 814 if (!(std = PyFile_FromFd(fd, "<stderr>", "w", -1, NULL, NULL,
815 "\n", 0))) { 815 "\n", 0))) {
816 goto error; 816 goto error;
817 } 817 }
818 } /* if (fd < 0) */ 818 } /* if (fd < 0) */
819 PySys_SetObject("__stderr__", std); 819 PySys_SetObject("__stderr__", std);