cbook.get_sample_data broken #478

jdh2358 opened this Issue Sep 18, 2011 · 3 comments


None yet

2 participants

jdh2358 commented Sep 18, 2011

Christoph Golke first reported that cbook.get_sample_data from github is broken:

I have trouble receiving the sample_data from github via cbook.py. There
are frequent HTTP 304 (Not Modified) and 500 (Internal Server Error)
exceptions and redirection to

I can confirm this on linux::

msierig@pinchiepie:> python -c "import matplotlib.cbook as cbook; datafile = cbook.get_sample_data('ct.raw', asfileobj=False); print datafile"
Traceback (most recent call last):
File "", line 1, in
File "/home/msierig/dev/lib/python2.7/site-packages/matplotlib/cbook.py", line 688, in get_sample_data
return myserver.get_sample_data(fname, asfileobj=asfileobj)
File "/home/msierig/dev/lib/python2.7/site-packages/matplotlib/cbook.py", line 626, in get_sample_data
raise KeyError(msg)
KeyError: 'file ct.raw not in cache; received HTTP Error 304: Not Modified when trying to retrieve'

@jkseppan jkseppan was assigned Sep 18, 2011

It seems that github redirection has broken the cache: we look for https://github.com/matplotlib/sample_data/raw/master/ct.raw but the cache key is https://raw.github.com/matplotlib/sample_data/master/ct.raw

@jkseppan jkseppan added a commit to jkseppan/matplotlib that referenced this issue Sep 18, 2011
@jkseppan jkseppan Fix github url
This is a quick patch to fix #478, not a future-proof solution.

Quick fix for the URL in #479, no time for a better solution right now but we should fix this properly so that future redirections by github don't keep breaking our code.

jdh2358 commented Sep 23, 2011

Eric merged this into master, so I am closing this issue

@jdh2358 jdh2358 closed this Sep 23, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment