Add an errors parameter to open() and TextIOWrapper() to specify error handling.

This commit is contained in:
Guido van Rossum 2007-12-03 22:54:21 +00:00
parent c6fe37bab9
commit e7fc50f2d0
7 changed files with 77 additions and 17 deletions

View file

@ -770,7 +770,7 @@ initstdio(void)
#endif
}
else {
if (!(std = PyFile_FromFd(fd, "<stdin>", "r", -1, NULL,
if (!(std = PyFile_FromFd(fd, "<stdin>", "r", -1, NULL, NULL,
"\n", 0))) {
goto error;
}
@ -790,7 +790,7 @@ initstdio(void)
#endif
}
else {
if (!(std = PyFile_FromFd(fd, "<stdout>", "w", -1, NULL,
if (!(std = PyFile_FromFd(fd, "<stdout>", "w", -1, NULL, NULL,
"\n", 0))) {
goto error;
}
@ -811,7 +811,7 @@ initstdio(void)
#endif
}
else {
if (!(std = PyFile_FromFd(fd, "<stderr>", "w", -1, NULL,
if (!(std = PyFile_FromFd(fd, "<stderr>", "w", -1, NULL, NULL,
"\n", 0))) {
goto error;
}