io.fits does not appear to allow indexing an extension by name using a unicode string, and hence str() is used here to convert unicode into ascii. This might in fact be a bug in io.fits? I have now opened an issue for it here: #2184