Permalink
Browse files

Add Python 3.2+ gzip usage note.

  • Loading branch information...
1 parent 3ef1761 commit e8ee5042e96c6765839dbdca3694d3972a35c3fa @davidlehn davidlehn committed May 12, 2016
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/pyld/jsonld.py
View
@@ -390,6 +390,7 @@ def load_document(url):
with closing(url_opener.open(url)) as handle:
content_encoding = handle.info().get('Content-Encoding', '')
if content_encoding == 'gzip':
+ # NOTE: Python 3.2+: gzip.decompress(handle.read())
buf = io.BytesIO(handle.read())
f = gzip.GzipFile(fileobj=buf, mode='rb')
data = f.read()

0 comments on commit e8ee504

Please sign in to comment.