Closed volkerjaenisch closed 1 year ago
Thank you. This is indeed a bug, I never tested this code with chunked HTTP responses. I will incorporate this fix into the next version of PySHACL.
Hi @volkerjaenisch The latest v0.21.0 release of PySHACL is finally released, that contains a fix for this issue. Sorry for such a long delay on this fix.
Dear PySHACL Developers!
PySHACL fails to open a http resource if it is chunked. I propose a quickfix and additional info below the stacktrace.
Code to reproduce:
Stacktrace:
The case of the problem is in load.py : 161
Here the filepointer resp.fp of the response is used as source for the parser. This goes well as long as the response is not chunked.
If the response is chunked there is a difference between
and
This is due to the fact that fp is the low level filepointer, which has to be used differently with chunking. b'3ae7\r \n' is position of the next chunk.
Patching load.py : 161 to
fp = resp
solves the problem for this case.But this code is complex and maybe some other use cases do need the use of the filepointer.
Cheers,
Volker