Commit d1a1b4e
committed
Enable debugging for urllib
As of today, using -d or --debug does not offer
debugging for the requests made using urllib.
This is needed for debugging connection issues,
in particular when there are redirects involved.
We need this monkey patching because between Python
3.5.2 [1] and 3.11.X, Python stopped respecting
http.client.HTTPConnection.debuglevel, and the fix [2]
seems got only available starting with Python 3.12
When we start using only 3.12 and later, we can rollback
this and just change the code to set
http.client.HTTPConnection.debuglevel to 1, when debugging
is enabled
[1] https://stackoverflow.com/a/74416575
[2] python/cpython#99353
BEFORE:
$ rm -rf test/; python3 -m obs_maven.core -d ../spacewalk/java/buildconf/ivy/obs-maven-config.yaml test -a antlr4-runtime
DEBUG:root:Reading configuration
INFO:root:Processing artifact antlr4-runtime
DEBUG:root:Parsing https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Master/openSUSE_Leap_15.6/repodata/repomd.xml
DEBUG:root:Loading RPMs from cache file: .obs-to-maven-cache/Uyuni/63cc3f113c0efce8106bf832c89795ff5111983a9e4bd5cea7742462e48c6221-primary.xml.gz.data
DEBUG:root:package mtime: 1775727845, []
INFO:root:Downloading /tmp/obsmvn-rwdr_yt4/antlr4-java-4.13.0-241000.1.12.uyuni5.noarch.rpm
DEBUG:root:Getting binary from: https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Master/openSUSE_Leap_15.6/noarch/antlr4-java-4.13.0-241000.1.12.uyuni5.noarch.rpm
DEBUG:root:not linked:
/usr/share/doc/packages/antlr4-java
/usr/share/doc/packages/antlr4-java/CHANGES.txt
/usr/share/doc/packages/antlr4-java/README.md
/usr/share/java/antlr4
/usr/share/java/antlr4/antlr4-runtime.jar
/usr/share/licenses/antlr4-java
/usr/share/licenses/antlr4-java/LICENSE.txt
/usr/share/maven-metadata/antlr4-antlr4-runtime.xml
/usr/share/maven-poms/antlr4
/usr/share/maven-poms/antlr4/antlr4-master.pom
/usr/share/maven-poms/antlr4/antlr4-runtime.pom
DEBUG:root:full pattern: ^/usr/.*/antlr4-runtime[^/]*\.jar$
INFO:root:extracting /usr/share/java/antlr4/antlr4-runtime.jar to /tmp/obsmvn-rwdr_yt4/antlr4-runtime.jar
INFO:root:deploying /tmp/obsmvn-rwdr_yt4/antlr4-runtime.jar to test/suse/antlr4-runtime/4.13.0/antlr4-runtime-4.13.0.jar
DEBUG:root:Setting mtime 1775727845 on test/suse/antlr4-runtime/4.13.0/antlr4-runtime-4.13.0.jar
DEBUG:root:Computing test/suse/antlr4-runtime/4.13.0/antlr4-runtime-4.13.0.jar.sha1
DEBUG:root:Computing test/suse/antlr4-runtime/4.13.0/antlr4-runtime-4.13.0.pom.sha1
AFTER:
$ rm -rf test/; python3 -m obs_maven.core -d ../spacewalk/java/buildconf/ivy/obs-maven-config.yaml test -a antlr4-runtime
DEBUG:root:Reading configuration
INFO:root:Processing artifact antlr4-runtime
DEBUG:root:Parsing https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Master/openSUSE_Leap_15.6/repodata/repomd.xml
DEBUG:root:HTTPS Request: GET /repositories/systemsmanagement:/Uyuni:/Master/openSUSE_Leap_15.6/repodata/repomd.xml HTTP/1.1
DEBUG:root:HTTPS Response: 200 OK
DEBUG:root:Loading RPMs from cache file: .obs-to-maven-cache/Uyuni/63cc3f113c0efce8106bf832c89795ff5111983a9e4bd5cea7742462e48c6221-primary.xml.gz.data
DEBUG:root:package mtime: 1775727845, []
INFO:root:Downloading /tmp/obsmvn-f2s6lyau/antlr4-java-4.13.0-241000.1.12.uyuni5.noarch.rpm
DEBUG:root:Getting binary from: https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Master/openSUSE_Leap_15.6/noarch/antlr4-java-4.13.0-241000.1.12.uyuni5.noarch.rpm
DEBUG:root:HTTPS Request: GET /repositories/systemsmanagement:/Uyuni:/Master/openSUSE_Leap_15.6/noarch/antlr4-java-4.13.0-241000.1.12.uyuni5.noarch.rpm HTTP/1.1
DEBUG:root:HTTPS Response: 302 Found
DEBUG:root:HTTPS Redirect to: https://ftp.gwdg.de/pub/opensuse/repositories/systemsmanagement%3A/Uyuni%3A/Master/openSUSE_Leap_15.6/noarch/antlr4-java-4.13.0-241000.1.12.uyuni5.noarch.rpm
DEBUG:root:HTTPS Request: GET /pub/opensuse/repositories/systemsmanagement%3A/Uyuni%3A/Master/openSUSE_Leap_15.6/noarch/antlr4-java-4.13.0-241000.1.12.uyuni5.noarch.rpm HTTP/1.1
DEBUG:root:HTTPS Response: 200 OK
DEBUG:root:not linked:
/usr/share/doc/packages/antlr4-java
/usr/share/doc/packages/antlr4-java/CHANGES.txt
/usr/share/doc/packages/antlr4-java/README.md
/usr/share/java/antlr4
/usr/share/java/antlr4/antlr4-runtime.jar
/usr/share/licenses/antlr4-java
/usr/share/licenses/antlr4-java/LICENSE.txt
/usr/share/maven-metadata/antlr4-antlr4-runtime.xml
/usr/share/maven-poms/antlr4
/usr/share/maven-poms/antlr4/antlr4-master.pom
/usr/share/maven-poms/antlr4/antlr4-runtime.pom
DEBUG:root:full pattern: ^/usr/.*/antlr4-runtime[^/]*\.jar$
INFO:root:extracting /usr/share/java/antlr4/antlr4-runtime.jar to /tmp/obsmvn-f2s6lyau/antlr4-runtime.jar
INFO:root:deploying /tmp/obsmvn-f2s6lyau/antlr4-runtime.jar to test/suse/antlr4-runtime/4.13.0/antlr4-runtime-4.13.0.jar
DEBUG:root:Setting mtime 1775727845 on test/suse/antlr4-runtime/4.13.0/antlr4-runtime-4.13.0.jar
DEBUG:root:Computing test/suse/antlr4-runtime/4.13.0/antlr4-runtime-4.13.0.jar.sha1
DEBUG:root:Computing test/suse/antlr4-runtime/4.13.0/antlr4-runtime-4.13.0.pom.sha11 parent 39e05b3 commit d1a1b4e
1 file changed
Lines changed: 56 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
35 | 87 | | |
36 | 88 | | |
37 | 89 | | |
| |||
107 | 159 | | |
108 | 160 | | |
109 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
110 | 166 | | |
111 | 167 | | |
112 | 168 | | |
| |||
0 commit comments