Describe the bug
This is a simple indexing error:
Line 1128 of View.py:
extension = fname.split('.')[1].upper()
Will not return the extension as desired if a period proceeds it in the path.
Version of PDS View
Version:
To Reproduce
Create a path that has a period it it before the file name:
e.g. mybrance/python2.7.12/pds4_files/test_array.xml
This will not return the '7' as the extension
Expected behavior
Test for a know extension. If 'XML' continue, if another know extension, assume PDS3 file and translate the file to PDS4 xml.
Fix
Simple change the index to use the last period to split the string:
extension = fname.split('.')[-1].upper()
Describe the bug This is a simple indexing error: Line 1128 of View.py: extension = fname.split('.')[1].upper() Will not return the extension as desired if a period proceeds it in the path.
Version of PDS View Version:
To Reproduce Create a path that has a period it it before the file name: e.g. mybrance/python2.7.12/pds4_files/test_array.xml This will not return the '7' as the extension
Expected behavior Test for a know extension. If 'XML' continue, if another know extension, assume PDS3 file and translate the file to PDS4 xml.
Fix Simple change the index to use the last period to split the string: extension = fname.split('.')[-1].upper()