Client use with Python 3

921 views
Skip to first unread message

Robin M

unread,
Jan 20, 2016, 1:24:24 PM1/20/16
to OWASP ZAP User Group
Hi,

I am adding the Zap Python client into a continuous delivery pipeline which uses a test framework that supports Python 3.x code. Since the Zap client is written in Python 2, I have attempted a conversion using 2to3 lib. 

The modifications are pretty light, and the client setup still works, however there's an error in urllib:

TypeError: urlopen() got an unexpected keyword argument 'proxies'

It seems to be a problem with the way __init__ is called with dict{proxy='http:127.0.0.1:8080'}. This is no longer in the correct syntax in python 3 or the urllib library that it uses. I suspect if this could be resolved, the client would be compatible with 3.x.

Thanks,
Robin

Simon Bennetts

unread,
Jan 21, 2016, 5:11:26 AM1/21/16
to OWASP ZAP User Group
That would be good :)
Any pythonistas able to suggest a fix that would be compatible with Python 2 and 3?
Reply all
Reply to author
Forward
0 new messages