Python2: 'str' has no attribute 'maketrans'
dfranke76 opened this issue · 5 comments
$ denss.py -f ly01.out
Traceback (most recent call last):
File "/apps/prod/denss/latest/bin/denss.py", line 48, in
args = dopts.parse_arguments(parser)
File "/apps/prod/denss/latest/lib/python2.7/site-packages/saxstats/denssopts.py", line 121, in parse_arguments
q, I, sigq, Ifit, file_dmax, isout = saxs.loadProfile(args.file, units=args.units)
File "/apps/prod/denss/latest/lib/python2.7/site-packages/saxstats/saxstats.py", line 722, in loadProfile
keys = {key.lower().strip().translate(str.maketrans('','', '_ ')): key for key in list(results.keys())}
File "/apps/prod/denss/latest/lib/python2.7/site-packages/saxstats/saxstats.py", line 722, in
keys = {key.lower().strip().translate(str.maketrans('','', '_ ')): key for key in list(results.keys())}
AttributeError: type object 'str' has no attribute 'maketrans'
stackoverflow tells me that maketrans is only available in Python3.
To note, since this is the 'str' object, this may be related to my "fix" for issue #17?
fixed by this commit
Misunderstanding. The ImportError on builtins is fixed, the maketrans issue still exists. Sorry.
ah okay, I will work on a fix then.
turns out denss does not need maketrans, so I just removed it. Let me know if you still run into issues.