Skip to content

Commit ca9430d

Browse files
committed
RF: revert fix allowing upper case file extensions
I thought about this for a while, but I don't like it, because it changes the behavior of nibabel globally. Previously if you asked to open ``my_image.NII`` it would barf, now it might find an image when it previously it did not. This is probably what the user intended, but it's still a guess. It's not hard to specify the upper case file extension on systems that need it. The next commit adds an explicit function to ignore extension case for parrec2nii.
1 parent f4c2272 commit ca9430d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

nibabel/openers.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
""" Context manager openers for various fileobject types
1010
"""
1111

12-
from os.path import splitext, isfile
12+
from os.path import splitext
1313
import gzip
1414
import bz2
1515

@@ -49,10 +49,6 @@ def __init__(self, fileish, *args, **kwargs):
4949
self._name = None
5050
return
5151
_, ext = splitext(fileish)
52-
# allow for ext to be lower or upper case
53-
if not isfile(fileish):
54-
if isfile(_ + ext.upper()):
55-
fileish = _ + ext.upper()
5652
if ext in self.compress_ext_map:
5753
is_compressor = True
5854
opener, arg_names = self.compress_ext_map[ext]

0 commit comments

Comments
 (0)