potiuk commented on code in PR #799:
URL: https://github.com/apache/airflow-site/pull/799#discussion_r1227679114


##########
post-docs/add-back-references.py:
##########
@@ -40,11 +42,18 @@ class GenerationType(enum.Enum):
 
 
 def download_file(url):
-    filedata = urlopen(url)
-    datatowrite = filedata.read()
-
-    with open('redirects.txt', 'wb') as f:
-        f.write(datatowrite)
+    with tempfile.TemporaryDirectory() as tmpdir:
+        temp_dir = Path(tmpdir)
+        file_name = temp_dir / "redirects.txt"

Review Comment:
   The downloaded redirects.txt file will not be used - it is notpassed 
anywhere. I see that in case of construct_mapping method it still opens 
"current working dir" redirects.txt - which is not going to work - if you 
downliad the file here, it should be passed on to processing 



##########
post-docs/add-back-references.py:
##########
@@ -40,11 +42,18 @@ class GenerationType(enum.Enum):
 
 
 def download_file(url):
-    filedata = urlopen(url)
-    datatowrite = filedata.read()
-
-    with open('redirects.txt', 'wb') as f:
-        f.write(datatowrite)
+    with tempfile.TemporaryDirectory() as tmpdir:
+        temp_dir = Path(tmpdir)
+        file_name = temp_dir / "redirects.txt"

Review Comment:
   The downloaded redirects.txt file will not be used - it is notpassed 
anywhere. I see that in case of construct_mapping method it still opens 
"current working dir" redirects.txt - which is not going to work - if you 
download the file here, it should be passed on to processing 



-- 
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]

Reply via email to