Message56488
> I've carefully checked and tested the initstdio() method. I'm sure that
> I've catched every edged case. The unit tests pass w/o complains.
>
> I've also added a PyErr_Display() call to Py_FatalError(). It's still
> hard to understand an error in io.py but at least the dependency on
> site.py is removed.
Very cool!
Some final suggestions:
+ Py_FatalError("Py_Initialize: can't initialize sys standard"
+ "streams");
Break this differently:
Py_FatalError(
"Py_........");
Don't call open() with keyword arg for newline="\r"; open() takes
positional args too. This is done specifically to simplify life for C
code calling it. :-) Perhaps one of the PyFunction_Call(..) variants
makes it easier to call it without having to explicitly construct the
tuple for the argument list. (All this because you're leaking the
value of PyString_FromString("\n"). :-)
I would change the error handling to avoid the 'finally' label, like this:
if (0) {
error:
status = -1;
Py_XDECREF(args);
}
I would add a comment "see initstdio() in pythonrun.c" to the
OpenWrapper class, which otherwise looks a bit mysterious (as it's not
used anywhere in the Python code).
Thanks for doing this!!! |
|
| Date |
User |
Action |
Args |
| 2007-10-16 03:47:59 | gvanrossum | set | spambayes_score: 0.00202756 -> 0.0020275642 recipients:
+ gvanrossum, brett.cannon, christian.heimes |
| 2007-10-16 03:47:59 | gvanrossum | link | issue1267 messages |
| 2007-10-16 03:47:59 | gvanrossum | create | |
|