-
Notifications
You must be signed in to change notification settings - Fork 19
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
IndexError: index out of range in STDF.records_from_file #55
Comments
I ran into the same issue and looks like the problem is due to the buffer being empty. By just breaking out of the loop when the buffer is empty fixes the error. Probably that might not be the right solution (though it works). Will be glad if this issue can be resolved. Thanks |
Thanks for sharing, could you comment which line you modified and how to do that? I got error below which is similar but at different lines. Thanks! ~\Anaconda3\lib\site-packages\Semi_ATE\STDF\utils.py in next(self) ~\Anaconda3\lib\site-packages\Semi_ATE\STDF\utils.py in create_record_object(Version, Endian, REC_ID, REC) ~\Anaconda3\lib\site-packages\Semi_ATE\STDF\utils.py in create_record(Version, Endian, REC_ID, REC) ~\Anaconda3\lib\site-packages\Semi_ATE\STDF\GDR.py in init(self, version, endian, record) ~\Anaconda3\lib\site-packages\Semi_ATE\STDF\STDR.py in _default_init(self, endian, record) ~\Anaconda3\lib\site-packages\Semi_ATE\STDF\STDR.py in _unpack(self, record) ~\Anaconda3\lib\site-packages\Semi_ATE\STDF\STDR.py in _unpack_item(self, FieldID) ~\Anaconda3\lib\site-packages\Semi_ATE\STDF\STDR.py in set_value(self, FieldID, Value) IndexError: list index out of range |
Same issue happen to me as well. Looks like treating GDR record is buggy. Sometimes buffer parsing ends up to be empty. |
Hello to everyone, based on your strategy to solve the problem, maybe I have found a solution for which I don't know if necessary to submit it to any approval cycle. I have modified the code directly in the file STDR.py in the library. In particular I have added in the old one row 1508 the code "if self.buffer[0] else 'empty'" and also added the new two rows 1509 e 1510. Bye Thanks 1507 for i in range(K): |
Tasks/Steps/Elements
Need your help on this index out of range. Below is the error
Traceback (most recent call last):
File "C:\Users\user\stdf\stdrreader.py", line 10, in
for REC in STDF.records_from_file("stdf.std"):
File "C:\Users\user\Anaconda3\lib\site-packages\semi_ate_stdf-0.0.0-py3.8.egg\Semi_ATE\STDF\utils.py", line 810, in next
return create_record_object(self.version, self.endian, (REC_TYP, REC_SUB), header+footer)
File "C:\Users\user\Anaconda3\lib\site-packages\semi_ate_stdf-0.0.0-py3.8.egg\Semi_ATE\STDF\utils.py", line 861, in create_record_object
retval = create_record(Version, Endian, REC_ID, REC)
File "C:\Users\user\Anaconda3\lib\site-packages\semi_ate_stdf-0.0.0-py3.8.egg\Semi_ATE\STDF\utils.py", line 885, in create_record
retval = GDR(Version, Endian, REC)
File "C:\Users\user\Anaconda3\lib\site-packages\semi_ate_stdf-0.0.0-py3.8.egg\Semi_ATE\STDF\GDR.py", line 35, in init
self._default_init(endian, record)
File "C:\Users\user\Anaconda3\lib\site-packages\semi_ate_stdf-0.0.0-py3.8.egg\Semi_ATE\STDF\STDR.py", line 265, in _default_init
self._unpack(record)
File "C:\Users\user\Anaconda3\lib\site-packages\semi_ate_stdf-0.0.0-py3.8.egg\Semi_ATE\STDF\STDR.py", line 1798, in _unpack
self._unpack_item(items[index])
File "C:\Users\user\Anaconda3\lib\site-packages\semi_ate_stdf-0.0.0-py3.8.egg\Semi_ATE\STDF\STDR.py", line 1508, in _unpack_item
code = self.buffer[0]
IndexError: index out of range
Versions checklist
The text was updated successfully, but these errors were encountered: