Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unicode error when trying Audio('data/Bach Cello Suite #3.wav') #4520

Closed
stonebig opened this issue Nov 11, 2013 · 1 comment · Fixed by #4521
Closed

unicode error when trying Audio('data/Bach Cello Suite #3.wav') #4520

stonebig opened this issue Nov 11, 2013 · 1 comment · Fixed by #4521
Milestone

Comments

@stonebig
Copy link
Contributor

Hello,

I'm under ipython2.0dev/windows7 / python3

Trying the greatest and latest @ellisonbg notebook at
https://github.com/ellisonbg/talk-pydata-nyc2013/blob/master/Close to Data.ipynb

I get an unicode error at the wave example.
Does anyone else has the same problem ? (I suspect a bug, as the file plays music if I click on it via the explorer)

from IPython.display import display, Audio, Latex
a = Audio('data/Bach Cello Suite #3.wav')
--------------------------------------------------------------------------
UnicodeDecodeError                        Traceback (most recent call last)
<ipython-input-4-35380f5da86b> in <module>()
----> 1 a = Audio('data/Bach Cello Suite #3.wav')

c:\users\famille\documents\winpython\winpython-32bit-3.3.2.3ggplotip2\python-3.3.2\src\master\IPython\lib\display.py in __init__(self, data, filename, url, embed, rate, autoplay)
     80             self.embed = True
     81         self.autoplay = autoplay
---> 82         super(Audio, self).__init__(data=data, url=url, filename=filename)
     83 
     84         if self.data is not None and not isinstance(self.data, bytes):

c:\users\famille\documents\winpython\winpython-32bit-3.3.2.3ggplotip2\python-3.3.2\src\master\IPython\core\display.py in __init__(self, data, url, filename)
    304         self.filename = None if filename is None else unicode_type(filename)
    305 
--> 306         self.reload()
    307 
    308     def reload(self):

c:\users\famille\documents\winpython\winpython-32bit-3.3.2.3ggplotip2\python-3.3.2\src\master\IPython\lib\display.py in reload(self)
     89         import mimetypes
     90         if self.embed:
---> 91             super(Audio, self).reload()
     92 
     93         if self.filename is not None:

c:\users\famille\documents\winpython\winpython-32bit-3.3.2.3ggplotip2\python-3.3.2\src\master\IPython\core\display.py in reload(self)
    310         if self.filename is not None:
    311             with open(self.filename, self._read_flags) as f:
--> 312                 self.data = f.read()
    313         elif self.url is not None:
    314             try:

C:\Users\famille\Documents\winpython\WinPython-32bit-3.3.2.3ggplotip2\python-3.3.2\lib\encodings\cp1252.py in decode(self, input, final)
     21 class IncrementalDecoder(codecs.IncrementalDecoder):
     22     def decode(self, input, final=False):
---> 23         return codecs.charmap_decode(input,self.errors,decoding_table)[0]
     24 
     25 class StreamWriter(Codec,codecs.StreamWriter):

UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 75132: character maps to <undefined>
takluyver added a commit to takluyver/ipython that referenced this issue Nov 11, 2013
@takluyver
Copy link
Member

Thanks for the report, should be fixed in #4521

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants