kou commented on PR #45425:
URL: https://github.com/apache/arrow/pull/45425#issuecomment-2638302784
Can we solve this with requests?
```diff
diff --git a/python/pyarrow/util.py b/python/pyarrow/util.py
index 89780da10f..7b16fadde1 100644
--- a/python/pyarrow/util.py
+++ b/python/pyarrow/util.py
@@ -244,10 +244,10 @@ def download_tzdata_on_windows():
tzdata_compressed = os.path.join(tzdata_path, "tzdata.tar.gz")
os.makedirs(tzdata_path, exist_ok=True)
- from urllib.request import urlopen
- with urlopen('https://data.iana.org/time-zones/tzdata-latest.tar.gz')
as response:
+ import requests
+ with
requests.get('https://data.iana.org/time-zones/tzdata-latest.tar.gz') as
response:
with open(tzdata_compressed, 'wb') as f:
- f.write(response.read())
+ f.write(response.content)
assert os.path.exists(tzdata_compressed)
diff --git a/python/requirements-wheel-test.txt
b/python/requirements-wheel-test.txt
index c051efb0aa..ad81586d37 100644
--- a/python/requirements-wheel-test.txt
+++ b/python/requirements-wheel-test.txt
@@ -4,6 +4,7 @@ hypothesis
pytest
pytz
pyuwsgi; sys.platform != 'win32' and python_version < '3.13'
+requests; sys_platform == 'win32'
tzdata; sys_platform == 'win32'
# We generally test with the oldest numpy version that supports a given
Python
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]