-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Test case for patch, plus fix to not swallow exceptions #13693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
num, text | ||
1,�T�E�����iSauron�A�A�C�k�A�̑n���̎� - ��O�I3019�N3��25���j�́AJ�ER�ER�E�g�[���L���̒�����Ƃ��������w�z�r�b�g�̖`���x�w�w�֕���x�w�V���}�����̕���x�̓o��l���B | ||
2,�w�z�r�b�g�̖`���x�Ɍ��y�̂���u���l����Ȃ��t�v�i�f��w�z�r�b�g�V���[�Y�x�̎����ł́u���l�����i�l�N���}���T�[�j�v�j�Ƃ͔ނ̂��Ƃł���B | ||
3,���̑��҂ł���w�w�֕���x�ɂ����Ắu��̎w�ցithe One Ring�j�v�̍���A�u�����iDark Lord�j�v�A�u���̎ҁithe One�j[1]�v�Ƃ��ēo�ꂷ��B�O�j�ɂ�����w�V���}�����̕���x�ł́A����̖��������S�X�̍ł��͂��鑤�߂ł������B | ||
4,�T�E�����͌����A�A���_�i�n���j�̑n����S�����V�g�I�푰�A�C�k�A�̈���ł��������A�僁���R�[���̔��t�ɉ��S���đ����A�A���_�ɊQ���Ȃ����݂ƂȂ����B | ||
5,�u�T�E�����v�Ƃ̓N�E�F�����Łu�g�̖т̂悾���́v�Ƃ����Ӗ��ł���A�V���_�����œ��l�̈Ӗ��ł��閼�O�u�S���T�E�A�v�ƌĂ�邱�Ƃ�����B | ||
6,�����́A�T�E����������A���������G���t�ɂ�閼�ł���A�w�w�֕���x�쒆�ɂ����ăA���S�����́u����i�T�E�����j�͎����̖{���̖��͎g��Ȃ����A��������ɏ���������ɏo�����肷�邱�Ƃ������Ȃ��v�Ɣ������Ă���B | ||
7,���̂ق��A���I�ɃG���t�ɑ��Ď��̂����Ƃ���閼�ɁA�u�A���i�^�[���i������N�j�v�A�u�A���^�m�i���M�ȍH�t�j�v�A�u�A�E�����f�B���i�A�E���̉��l�j�v������B | ||
8,���I�̍��̃T�E�����́A���݂ɕϐg����\�͂������Ă����B | ||
9,���̔\�͂��g���Ό��ڗ킵�����h�ȊO�������Ƃ�A�܂�����ȘT��z����������Ƃ����������ɕς��邱�Ƃ��ł��A�G���t���狰���ꂽ�B | ||
10,���I�Ɉ�̎w�ւ����グ���T�E�����́A���̗͂̎w�ւŐ�����鎖���₻�̏��L�҂��x�z�ł���悤�ɂȂ����B | ||
11,�܂��A���̂��łтĂ��w�ւ�������艽�x�ł��h�邱�Ƃ��ł����B | ||
12,�������k�[���m�[���v���̍ۂɔ��������̂�j�ꂽ��́A��x�Ɣ������ϐg���邱�Ƃ͂ł��Ȃ��Ȃ�A���̈��ӂ̋�̂悤�Ȍ�������낵���p�����Ƃ�Ȃ��Ȃ����Ƃ����B | ||
13,�܂������u�܂Ԃ��̂Ȃ��ɉ����ꂽ�ځv�Ƃ������S�ە\���ő�����ꂽ�B |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,9 @@ import warnings | |
from csv import QUOTE_MINIMAL, QUOTE_NONNUMERIC, QUOTE_NONE | ||
from cpython cimport (PyObject, PyBytes_FromString, | ||
PyBytes_AsString, PyBytes_Check, | ||
PyUnicode_Check, PyUnicode_AsUTF8String) | ||
PyUnicode_Check, PyUnicode_AsUTF8String, | ||
PyErr_Occurred, PyErr_Fetch) | ||
from cpython.ref cimport PyObject, Py_XDECREF | ||
from io.common import CParserError, DtypeWarning, EmptyDataError | ||
|
||
|
||
|
@@ -1878,6 +1880,17 @@ cdef kh_float64_t* kset_float64_from_list(values) except NULL: | |
|
||
|
||
cdef raise_parser_error(object base, parser_t *parser): | ||
cdef: | ||
object old_exc | ||
PyObject *type, *value, *traceback | ||
if PyErr_Occurred(): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://docs.python.org/2/c-api/exceptions.html do we need to decref this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The return from PyErr_Occurred does not need to be decrefed. The return from PyErr_Fetch does, and is. |
||
PyErr_Fetch(&type, &value, &traceback); | ||
Py_XDECREF(type) | ||
Py_XDECREF(traceback) | ||
if value != NULL: | ||
old_exc = <object> value | ||
Py_XDECREF(value) | ||
raise old_exc | ||
message = '%s. C error: ' % base | ||
if parser.error_msg != NULL: | ||
if PY3: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to close the codec itself? in the test