Ilja Everilä added the comment:

After doing some reading on https://docs.python.org/dev/c-api/exceptions.html 
it seems that this is possibly "as designed" or such, since csv_writerows 
explicitly calls PyErr_SetString on receiving NULL from PyObject_GetIter.

Still, it feels like this could either let the original exception fall through 
(since it has nothing in the way of handling it) or form the chain in PY3 for 
easier debugging of the real cause.

To give this thing some context we ran in to this while passing SQLAlchemy 
Query objects to csv_writerows. The Query object is compiled during call to 
__iter__ and the current behaviour masks possible SQL errors etc.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26407>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to