mirror of https://github.com/sipwise/repoapi.git
Fixes: | No attribute 'code' on urllib.request._HTTPResponse [attribute-error] as reported by pytype. The urllib module has been split into parts and renamed in Python 3 to urllib.request, urllib.parse, and urllib.error, and therefore will fail with: | AttributeError: module 'urllib' has no attribute 'request' This used to work only because other components loaded within repoapi did the `import urllib.request` for us. Also the errors were never reported as such, as e.g. 404 errors are throwing an exception (instead of provided as return code as expected by our code so far), which we didn't catch so far. And the arguments provided to logger/ logging were incorrect (number vs string), so fix this and also slightly improve the logging messages while at it. JFTR, `import urllib.request` is py3k-only, which is fine for us though, since repoapi is supporting only py3k nowadays. We should also think about migrating from urllib towards requests everywhere. Change-Id: Ibc965daa94216aaad80758dba0f50a74d8658887changes/27/31127/3
parent
24ba69cbb1
commit
19dbf6bea1
Loading…
Reference in new issue