Skip to content

Commit d6b41b6

Browse files
committed
provide user-agent
1 parent f797801 commit d6b41b6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

python/pyarrow/util.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,9 @@ def _break_traceback_cycle_from_frame(frame):
231231

232232

233233
def _download_urllib(url, out_path):
234-
from urllib.request import urlopen
235-
with urlopen(url) as response:
234+
from urllib.request import urlopen, Request
235+
req = Request(url, headers={'User-Agent': 'pyarrow'})
236+
with urlopen(req) as response:
236237
with open(out_path, 'wb') as f:
237238
f.write(response.read())
238239

0 commit comments

Comments
 (0)