@@ -65,7 +65,7 @@ def __ne__(self, other):
65
65
__hash__ = None
66
66
return K
67
67
68
- # support python 2
68
+ # support python 2 and 3
69
69
if sys .version_info [0 ] >= 3 :
70
70
from urllib .request import build_opener as urllib_build_opener
71
71
from urllib .request import HTTPSHandler
@@ -83,7 +83,7 @@ def cmp(a, b):
83
83
84
84
__copyright__ = 'Copyright (c) 2011-2017 Digital Bazaar, Inc.'
85
85
__license__ = 'New BSD license'
86
- __version__ = '0.7.3 '
86
+ __version__ = '0.7.4-dev '
87
87
88
88
__all__ = [
89
89
'compact' , 'expand' , 'flatten' , 'frame' , 'link' , 'from_rdf' , 'to_rdf' ,
@@ -383,10 +383,13 @@ def load_document(url):
383
383
'jsonld.InvalidUrl' , {'url' : url },
384
384
code = 'loading document failed' )
385
385
https_handler = VerifiedHTTPSHandler ()
386
+ #https_handler = HTTPSHandler()
386
387
url_opener = urllib_build_opener (https_handler )
387
388
url_opener .addheaders = [
388
389
('Accept' , 'application/ld+json, application/json' ),
389
390
('Accept-Encoding' , 'deflate' )]
391
+
392
+ print ('URLGO' , url )
390
393
with closing (url_opener .open (url )) as handle :
391
394
content_encoding = handle .info ().get ('Content-Encoding' , '' )
392
395
if content_encoding == 'gzip' :
@@ -424,6 +427,7 @@ def load_document(url):
424
427
except JsonLdError as e :
425
428
raise e
426
429
except Exception as cause :
430
+ print ('URLERR' , url )
427
431
raise JsonLdError (
428
432
'Could not retrieve a JSON-LD document from the URL.' ,
429
433
'jsonld.LoadDocumentError' , code = 'loading document failed' ,
0 commit comments