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
Exception "'NoneType' object has no attribute 'decode'" when character set is empty. #1038
Comments
This is strictly speaking invalid DICOM (Specific Character Set is type 1C and cannot be empty), and I have never seen that so far. Anyway, it makes sense to handle this case as a missing tag (e.g. ISO-IR 6). |
And given that empty values can always happen (despite the standard) we should always handle it without crashing, so this a bug anyway IMO. |
After verification, you are right, it is strictly speaking invalid DICOM. |
Can we use your example dataset for testing? It is a nice little dataset. |
Yes for sure. |
* Correctly handle reading empty Specific Character Set - fixes #1038 * Removed unneeded check for Specific Character Set - the check was for a tag with undefined length, which cannot be Specific Character Set
* Correctly handle reading empty Specific Character Set - fixes #1038 * Removed unneeded check for Specific Character Set - the check was for a tag with undefined length, which cannot be Specific Character Set
Should be fixed with v1.4.2 |
Describe the bug
If Transfer Syntax UID(0002,0010) is "1.2.840.10008.1.2" (LEI) and Character Set(0008,0005) is empty (that is assuming "ISO-IR 6"), there is an exception ("'NoneType' object has no attribute 'decode'").
Expected behavior
No exception. Defaulting to ISO-IR 6.
Steps To Reproduce
Use the attached dcm file and run :
Traceback:
Your environment
Windows-10-10.0.18362-SP0
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AMD64)]
pydicom 1.4.1
empty_charset_LEI.zip
The text was updated successfully, but these errors were encountered: