astropy/astropy — pull request #956 by mdboom (2013-04-08 23:59:10+00:00)
Title: Setting string-like WCS attributes in Python 3

At the moment, the following code fails in Python 3:

```
In [1]: from astropy.wcs import WCS
wcs
In [2]: wcs = WCS()

In [3]: wcs.wcs.radesys = 'ICRS'
ERROR: TypeError: expected bytes, str found [IPython.core.interactiveshell]
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
in ()
----> 1 wcs.wcs.radesys = 'ICRS'

TypeError: expected bytes, str found
```

while I understand that of course WCS can't really use unicode, I'd like to suggest that we automatically try and encode as ASCII on-the-fly so users don't have to always remember to convert to bytes first.